A retail company is hosting a high-traffic REST API on Amazon EC2 instances within an Auto Scaling group behind an Application Load Balancer (ALB). The API's launch template needs to be updated with a new AMI. The company has strict cost constraints and cannot run a parallel environment or double its EC2 instance count during the deployment. However, they must maintain at least 60% of the normal serving capacity during the update. Additionally, if the ALB 5XX error rate increases during the deployment or within a 10-minute monitoring window after the update completes, the deployment must automatically roll back to the previous AMI. Which deployment strategy meets these requirements with the lowest operational overhead?
- AConfigure a AWS CodeDeploy Blue/Green deployment. Set up CodeDeploy to copy the Auto Scaling group, deploy the updated AMI, and use a weighted Application Load Balancer target group to shift traffic. Configure automatic rollbacks based on the ALB 5XX error rate CloudWatch alarm.
- Configure an EC2 Auto Scaling Instance Refresh with a rolling strategy. Set the minimum healthy percentage to 60%. Specify the ALB 5XX error rate CloudWatch alarm in the alarm specification of the deployment preferences, and enable auto-rollback.Cevap
- CConfigure a AWS CodeDeploy In-Place deployment for the Auto Scaling group. Use a custom deployment configuration to update 40% of the instances at a time, and configure triggers to roll back when the ALB 5XX error rate CloudWatch alarm is activated. Manually update the Auto Scaling group launch template after the deployment completes.
- DUpdate the launch template in a AWS CloudFormation template and perform a stack update. Set the AutoScalingRollingUpdate policy's MinInstancesInService to 60%. Configure a CloudFormation rollback trigger pointing to the ALB 5XX error rate CloudWatch alarm.
Cevap
Configure an EC2 Auto Scaling Instance Refresh with a rolling strategy, set the minimum healthy percentage to 60%, specify the ALB 5XX error rate CloudWatch alarm in the alarm specification of the deployment preferences, and enable auto-rollback.
The correct answer is the strategy using EC2 Auto Scaling Instance Refresh with an alarm specification. This strategy updates the instances in-place within the same Auto Scaling group, meeting the requirement of not running a parallel environment or doubling instance costs, while maintaining the required 60% capacity. It natively supports configuring CloudWatch alarms in the alarm specification and performing an automatic rollback to the previous launch template version if these alarms are triggered during the update or the post-deployment monitoring window.
Adım Adım Çözüm
Anahtar Kavram
EC2 Auto Scaling Instance Refresh allows rolling updates of instances within an Auto Scaling group based on a new launch template or AMI, supporting minimum healthy capacity controls and automatic rollbacks via CloudWatch alarms during both the deployment and post-deployment monitoring phases.