Soru

Zorluk: ZorDeployment Strategies and Execution

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?

  1. 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.Cevap
  2. B
    Configure the AutoScalingRollingUpdate policy with MaxBatchSize set to 2 and MinInstancesInService set to 6, while keeping the Auto Scaling Group's MaxSize at 6.
  3. C
    Configure the AutoScalingRollingUpdate policy with MaxBatchSize set to 2 and MinInstancesInService set to 4, while keeping the Auto Scaling Group's MaxSize at 6.
  4. D
    Configure 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.

Cevap

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.

Adım Adım Çözüm

1
Analyze the availability requirement during the update.
The application requires at least 6 healthy instances in service at all times, with updates happening in batches of 2.
This establishes the minimum capacity constraint (MinInstancesInService=6MinInstancesInService = 6) and the batch size (MaxBatchSize=2MaxBatchSize = 2).
2
Calculate the required temporary capacity during rolling updates.
To update 2 instances while keeping 6 in service, CloudFormation must launch 2 new instances first (totaling 8 instances) before terminating 2 old instances.
If it terminated the old instances first, the active capacity would drop to 4, violating the availability threshold.
3
Evaluate the Auto Scaling Group size limitations.
The Auto Scaling Group's MaxSize must be at least 8 to allow scaling out to the required temporary capacity.
If MaxSize remains at 6, CloudFormation cannot launch the new instances and the update will hang or rollback.

Anahtar Kavram

Auto Scaling Group Rolling Updates via CloudFormation
Bu soruyu puanla