A company runs a production web application on Amazon EC2 instances within an Auto Scaling Group (ASG) managed by AWS CloudFormation. The ASG is configured with a DesiredCapacity of 6 and a MinSize of 6. A SysOps administrator is updating the CloudFormation stack to deploy a new version of the application using an AutoScalingRollingUpdate policy. The application is highly sensitive to capacity reductions, and the administrator must ensure that at least 6 healthy instances remain in service at all times during the update, which should proceed in batches of 2. Which configuration will successfully complete this deployment while meeting the application's availability requirements?
- Configure the AutoScalingRollingUpdate policy with MaxBatchSize set to 2 and MinInstancesInService set to 6, and increase the Auto Scaling Group's MaxSize to at least 8.Answer
- BConfigure the AutoScalingRollingUpdate policy with MaxBatchSize set to 2 and MinInstancesInService set to 6, while keeping the Auto Scaling Group's MaxSize at 6.
- CConfigure the AutoScalingRollingUpdate policy with MaxBatchSize set to 2 and MinInstancesInService set to 4, while keeping the Auto Scaling Group's MaxSize at 6.
- DConfigure an AWS Systems Manager Run Command script to execute the update across all instances simultaneously, relying on default patch baseline target tags to roll back the instances if the update fails.
Answer
Configure the AutoScalingRollingUpdate policy with MaxBatchSize set to 2 and MinInstancesInService set to 6, and increase the Auto Scaling Group's MaxSize to at least 8.
The correct answer is to configure the AutoScalingRollingUpdate policy with MaxBatchSize set to 2 and MinInstancesInService set to 6, and increase the Auto Scaling Group's MaxSize to at least 8. During a rolling update, if the minimum instances in service is equal to the desired capacity, CloudFormation must launch new instances before terminating old ones. Since the batch size is 2, CloudFormation needs to launch 2 new instances first, raising the total instance count to 8. If the Auto Scaling Group's MaxSize is not increased to at least 8, the Auto Scaling service will block the launch of these new instances, causing the CloudFormation stack update to stall and eventually roll back.
Step-by-Step Solution
Key Concept
Auto Scaling Group Rolling Updates via CloudFormation