A company uses an AWS CloudFormation template to manage a stateless web application. The application runs on Amazon EC2 instances within an Auto Scaling group (ASG) behind an Application Load Balancer (ALB). The ASG has a desired capacity of 8 instances. The company needs to deploy a new version of the application by updating the launch template with a new Amazon Machine Image (AMI). The deployment must maintain the full capacity of 8 instances at all times during the update to prevent performance issues. Which configuration of the `UpdatePolicy` attribute for the Auto Scaling group in the CloudFormation template meets this requirement?
- Configure an `AutoScalingRollingUpdate` policy with `MinInstancesInService` set to 8 and `MaxBatchSize` set to 2.Cevap
- BConfigure an `AutoScalingRollingUpdate` policy with `MinInstancesInService` set to 6 and `MaxBatchSize` set to 2.
- CConfigure an `AutoScalingRollingUpdate` policy with `MinInstancesInService` set to 8 and `MaxBatchSize` set to 0.
- DConfigure an `AutoScalingRollingUpdate` policy with `MinInstancesInService` set to 0 and `MaxBatchSize` set to 8.
Cevap
Configure an `AutoScalingRollingUpdate` policy with `MinInstancesInService` set to 8 and `MaxBatchSize` set to 2.
Configuring the `AutoScalingRollingUpdate` policy with `MinInstancesInService` set to 8 and `MaxBatchSize` set to a positive integer (such as 2) ensures that CloudFormation launches new instances first before terminating old instances. Because the minimum instances in service is equal to the desired capacity, CloudFormation must temporarily scale out the Auto Scaling group to maintain 8 healthy instances throughout the rolling update.
Adım Adım Çözüm
Anahtar Kavram
Using CloudFormation AutoScalingRollingUpdate policies to manage deployment capacity and prevent downtime.