An enterprise is designing a deployment strategy for a stateless API service running on Amazon EC2 instances in Auto Scaling groups behind Application Load Balancers across AWS Regions. The deployment must achieve zero downtime, restrict the blast radius by deploying sequentially across regions, and perform a gradual traffic shift (starting with of traffic) within each region to monitor for application errors. The deployment must automatically roll back immediately if the error rate or latency exceeds defined thresholds, and the rollout to subsequent regions must be halted. Which deployment architecture meets these requirements with the least operational overhead?
- Deploy updates using AWS CodePipeline to orchestrate a sequential deployment across Regions. In each Region stage, configure AWS CodeDeploy to perform a blue/green deployment. CodeDeploy shifts of traffic to the green Auto Scaling group using an Application Load Balancer, monitors CloudWatch alarms, and automatically rolls back traffic to the blue group if thresholds are breached.Cevap
- BDeploy updates using AWS CodePipeline to update AWS CloudFormation StackSets sequentially across Regions. Configure the StackSet template to perform an in-place rolling update of the Auto Scaling group using an AutoScalingRollingUpdate policy. If CloudWatch alarms are triggered during the update, roll back the CloudFormation StackSet to the previous version.
- CDeploy updates using AWS CodePipeline to trigger a sequential deployment. For each Region, update the launch template of the Auto Scaling group and execute an Instance Refresh. Use an AWS Lambda function to update Route 53 weighted routing policies, routing of DNS queries to a new secondary Auto Scaling group, and revert the weights if CloudWatch alarms are triggered.
- DDeploy updates using AWS CodePipeline to update AWS Elastic Beanstalk environments sequentially. In each Region, configure the deployment policy to Immutable. If CloudWatch alarms are triggered or the deployment fails during the bake period, Elastic Beanstalk automatically rolls back the environment by deleting the temporary Auto Scaling group.
Cevap
Deploy updates using AWS CodePipeline to orchestrate a sequential deployment across Regions. In each Region stage, configure AWS CodeDeploy to perform a blue/green deployment. CodeDeploy shifts traffic to the green Auto Scaling group using an Application Load Balancer, monitors CloudWatch alarms, and automatically rolls back traffic to the blue group if thresholds are breached.
The correct strategy uses AWS CodePipeline for sequential cross-region orchestration and AWS CodeDeploy to execute blue/green deployments. CodeDeploy handles traffic shifting at the Application Load Balancer level, which allows a precise traffic cutover and immediate rollback to the active blue group if CloudWatch alarms (tracking error rate and latency) are triggered, ensuring zero downtime.
Adım Adım Çözüm
Anahtar Kavram
AWS CodeDeploy Blue/Green deployments for EC2 utilize Application Load Balancer target group traffic shifting to enable precise, immediate traffic redirection and instant rollback, bypassing DNS caching limitations associated with Route 53 weighted routing.