Question

Difficulty: MediumDeployment Strategy Design

A company is designing the deployment pipeline for a new web application. The application will run on Amazon EC2 instances within an Auto Scaling group behind an Application Load Balancer (ALB). The infrastructure is provisioned using AWS CloudFormation. The team requires a deployment strategy that can route exactly 10%10\% of user traffic to the new version for testing. If any errors are detected, the deployment must immediately roll back all traffic to the old version. If the deployment is successful, all traffic must be shifted to the new version. The strategy must minimize both the time to roll back and the cost of keeping duplicate environments running after the deployment is complete.

Which deployment strategy meets these requirements?

  1. A
    Provision a second Auto Scaling group and a new ALB for the new application version. In Amazon Route 53, configure weighted routing policies for the application's domain name, setting a weight of 1010 for the new ALB and 9090 for the existing ALB. If errors occur, update the Route 53 weights to route 100%100\% of the traffic to the existing ALB.
  2. B
    Configure the existing Auto Scaling group with a CloudFormation UpdatePolicy set to AutoScalingRollingUpdate. Configure the MaxBatchSize parameter to 10%10\% of the total instance count to ensure only a subset of instances are updated first. Define CloudFormation rollback triggers using Amazon CloudWatch alarms to automatically revert the stack update if errors are detected.
  3. Provision a second Auto Scaling group and a new ALB target group for the new application version. In the CloudFormation template, update the ALB listener rule to distribute traffic by assigning a weight of 1010 to the new target group and 9090 to the existing target group. After validating the deployment, update the CloudFormation template to set the weight of the new target group to 100100, and then terminate the old Auto Scaling group and target group.Answer
  4. D
    Configure AWS CodeDeploy to perform an in-place deployment to the existing Auto Scaling group using the CodeDeployDefault.OneAtATime deployment configuration. Attach CloudWatch alarms to the deployment group to trigger an automatic rollback to the previous application version if errors are detected.

Answer

Provision a second Auto Scaling group and a new Application Load Balancer target group, then use AWS CloudFormation to shift traffic weights on the listener rule from 90/10 to 0/100.
The correct strategy uses Application Load Balancer (ALB) weighted target groups. This allows the system to direct exactly 10%10\% of the live user traffic to the new Auto Scaling group and target group. Because the traffic shift happens at the load balancer layer, rollbacks can be performed instantaneously by updating the listener rule weights back to 100%100\% for the old target group. Once the deployment is verified, the old Auto Scaling group and target group can be deleted, ensuring that duplicate costs are minimized.

Step-by-Step Solution

1
Provision a second Auto Scaling group and target group for the new version of the application using AWS CloudFormation.
A separate environment with the new version is created without impacting the existing production environment.
This allows testing the new version in isolation before routing live traffic to it.
2
Update the Application Load Balancer listener rule in CloudFormation to assign a weight of 1010 to the new target group and 9090 to the original target group.
Exactly 10%10\% of incoming live traffic is immediately routed to the new version.
This establishes the requested canary testing configuration at the load balancer layer.
3
Monitor the deployment. If errors occur, revert the weights to route 100%100\% of traffic to the original target group. If successful, set the weight of the new target group to 100%100\%.
Traffic is either immediately rolled back or fully shifted to the new version, and the old Auto Scaling group and target group are terminated.
Shifting traffic at the Application Load Balancer level ensures instantaneous rollback or cutover, and terminating old resources minimizes ongoing costs.

Key Concept

Canary deployments using Application Load Balancer weighted target groups in AWS CloudFormation.
Estimated Time:2m 0s
Rate this question