Maintaining a fixed number of instances in your Auto Scaling group - Amazon EC2 Auto Scaling

Maintaining a fixed number of instances in your Auto Scaling group

Amazon EC2 Auto Scaling lets you set various parameters to have an Auto Scaling group maintain a fixed size. You can then choose whether to manually add or remove Amazon EC2 instances from the group to deal with traffic changes to your application.

If a fixed number of instances is needed, this can be achieved by setting the same value for minimum, maximum, and desired capacity. After you have created your Auto Scaling group, the group starts by launching enough instances to meet its desired capacity. If there are no other scaling conditions attached to the Auto Scaling group, the group maintains this number of running instances even if an instance becomes unhealthy.

Amazon EC2 Auto Scaling monitors the health of each Amazon EC2 instance that it launches. When it finds that an instance is unhealthy, it terminates that instance and launches a new one. If you stop or terminate a running instance, the instance is considered to be unhealthy and is replaced. If any instance terminates unexpectedly, Amazon EC2 Auto Scaling detects the termination and launches a replacement instance. This capability enables you to maintain a fixed, desired number of EC2 instances automatically. For more information about health check replacements, see Health checks for Auto Scaling instances.

Amazon EC2 Auto Scaling also lets you adjust the desired capacity to update the number of instances that it attempts to maintain. Before you can adjust the desired capacity to a value outside of the minimum and maximum capacity range, you must update these limits.