AWS Certified DevOps Engineer – Professional (DOP-C02) — Question 276
A DevOps engineer 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 in an Auto Scaling group.
The DevOps engineer has created launch templates, Auto Scaling groups, and ALB target groups for the blue environment and the green environment. Each target group specifies which application version, blue or green, will be loaded on the EC2 instances. An Amazon Route 53 record for www.example.com points to the ALB.
The deployment must shift traffic all at once from the blue environment to the green environment.
Which solution will meet these requirements?
Answer options
- A. Starta rolling restart of the Auto Scaling group for the green environment to deploy the new application version to the green environment's EC2 instances. When the rolling restart is complete, use an AWS CLI command to update the ALB to send traffic to the green environment's target group.
- B. Use an AWS CLI command to update the ALB to send traffic to the green environments target group. Start a rolling restart of the Auto Scaling group for the green environment to deploy the new application version to the green environment's EC2 instances.
- C. Update the launch template to deploy the green environment's application version to the blue environment's EC2 instances. Do not change the target groups or the Auto Scaling groups in either environment. Perform a rolling restart of the blue environments EC2 instances.
- D. Starta rolling restart of the Auto Scaling group for the green environment to deploy the new application version to the green environment's EC2 instances. When the rolling restart is complete, update Route 53 to point to the green environment's endpoint on the ALB.
Correct answer: A
Explanation
Option A is correct because performing a rolling restart of the green Auto Scaling group ensures that the new application version is fully deployed and healthy before any traffic is routed to it. Once the green instances are ready, updating the ALB listener to point to the green target group shifts 100% of the traffic instantaneously. Option B is incorrect as it shifts traffic to the green environment before the instances are updated. Option C describes an in-place deployment rather than a blue/green deployment, and Option D is incorrect because the single ALB is shared between both environments, meaning Route 53 cannot distinguish between blue and green endpoints at the DNS level.