A SysOps Administrator manages a production web application deployed via an AWS CloudFormation template. The application runs on an Amazon EC2 Auto Scaling group (ASG) behind an Application Load Balancer, with a desired capacity of instances. The administrator is preparing to update the template to roll out a new AMI using the AutoScalingRollingUpdate policy. The application must maintain its full capacity of healthy instances throughout the update process to handle peak traffic. Which configuration for the AutoScalingRollingUpdate policy will satisfy this requirement?
- ASet MinInstancesInService to and MaxBatchSize to .
- BSet MinInstancesInService to and MaxBatchSize to .
- Set MinInstancesInService to and MaxBatchSize to .Answer
- DSet SuspendProcesses to include Launch and Terminate processes.
Answer
Setting MinInstancesInService to and MaxBatchSize to ensures that AWS CloudFormation launches new instances first to maintain the desired capacity of instances during the rolling update.
The correct configuration requires setting MinInstancesInService to and MaxBatchSize to . This tells AWS CloudFormation that it must keep at least instances running and healthy at all times. Since the group's desired capacity is , CloudFormation will satisfy this by first provisioning a batch of new instances (bringing the total to ) before terminating old instances, keeping capacity at or above throughout the rollout.
Step-by-Step Solution
Key Concept
AWS CloudFormation AutoScalingRollingUpdate UpdatePolicy configuration for maintaining application capacity
Alternative Method
Instead of an in-place rolling update on the same Auto Scaling group, the administrator could perform a blue/green deployment by creating a second Auto Scaling group using the new launch template, validating the new instances, and then updating the Application Load Balancer listener rule to point to the new target group. However, this would require managing additional resources outside the single Auto Scaling group scope.
Estimated Time:1m 30s