Q11 — AWS DOP-C02 Ch.3
Question 11 of 100 | ← Chapter 3
A solutions architect needs to configure a blue/green deployment for an existing three-tier application. The application runs on Amazon EC2 instances and uses an Amazon RDS database. The EC2 instances run behind an Application Load Balancer (ALB) and are part of an Auto Scaling group. A DevOps engineer has created CloudFormation templates, Auto Scaling groups, and ALB target groups for both blue and green environments. Each target group specifies which application version (blue or green) will be loaded on the EC2 instances. Route 53 records point to the ALB endpoint. During deployment, traffic must be switched from the blue environment to the green environment immediately. Which solution satisfies these requirements?
- A. Restart the Auto Scaling group for the green environment to deploy the new application version to green EC2 instances. After the rolling restart completes, use the AWS CLI command to update the ALB to route traffic to the green target group.
- B. Use the AWS CLI command to update the ALB to route traffic to the green target group. Then initiate a rolling restart of the green Auto Scaling group to deploy the new application version to green EC2 instances. ✓
- C. Update the CloudFormation template to deploy the green application version to blue EC2 instances. Do not change target groups or Auto Scaling groups in either environment. Perform a rolling restart of blue EC2 instances.
- D. Restart the Auto Scaling group for the green environment to deploy the new application version to green EC2 instances. After the rolling restart completes, update Route 53 to point to the green ALB endpoint.
Correct Answer: B. Use the AWS CLI command to update the ALB to route traffic to the green target group. Then initiate a rolling restart of the green Auto Scaling group to deploy the new application version to green EC2 instances.
Explanation
The core of AWS blue/green deployment is traffic switching via load balancer target groups. The scenario requires immediate traffic shift, meaning ALB routing must be updated first before updating instances. Option B uses the AWS CLI to directly update ALB routing to the green target group, ensuring zero-delay traffic switch. Subsequently, it initiates a rolling restart of the green Auto Scaling group to gradually deploy the new version to EC2 instances. Other options introduce delays (e.g., A, D) or fail to properly isolate environments (e.g., C), violating the 'immediate' requirement. Per AWS best practices, ALB target group switching—not DNS or mixed-environment instance updates—is the standard method for traffic redirection.