Q81 — AWS DOP-C02 Ch.3
Question 81 of 100 | ← Chapter 3
A DevOps engineer needs to configure blue/green deployment for an existing three-tier application. The application runs on Amazon EC2 instances and uses an Amazon RDS database. EC2 instances run behind an Application Load Balancer (ALB) and belong to an Auto Scaling group. The DevOps engineer created a launch template and Auto Scaling group for the blue environment and another launch template and Auto Scaling group for the green environment. Each Auto Scaling group deploys to its corresponding blue or green target group. Target groups specify which software (blue or green) loads on the EC2 instances. The ALB routes traffic to either the blue or green target group. An Amazon Route 53 record for www.example.com points to the ALB. The deployment must shift all traffic from the blue environment’s EC2 instances to the green environment’s EC2 instances running the newly deployed software.
- A. Start a rolling restart of the green Auto Scaling group to deploy the new software to green EC2 instances. After the rolling restart completes, use the AWS CLI to update the ALB to route traffic to the green target group. ✓
- B. Use the AWS CLI to update the ALB to route traffic to the green target group. Then perform a rolling restart of the green Auto Scaling group to deploy the new software to green EC2 instances.
- C. Update the launch template to deploy green software onto blue EC2 instances. Keep target groups and Auto Scaling groups unchanged. Perform a rolling restart of blue EC2 instances.
- D. Start a rolling restart of the green Auto Scaling group to deploy the new software to green EC2 instances. After the rolling restart completes, update the Route 53 DNS record to point to the green endpoint on the ALB.
Correct Answer: A. Start a rolling restart of the green Auto Scaling group to deploy the new software to green EC2 instances. After the rolling restart completes, use the AWS CLI to update the ALB to route traffic to the green target group.
Explanation
Option A is correct. In a true blue/green deployment, the green environment must be fully provisioned and validated *before* traffic shift. Rolling restarting the green Auto Scaling group ensures all green instances are launched with the new software and pass health checks. Only then should traffic be switched—by updating the ALB listener to route to the green target group. This guarantees zero-downtime cutover and avoids sending traffic to unready instances. Option B reverses the order: routing traffic before green instances are ready causes failures. Option C violates blue/green isolation by overwriting blue instances—defeating the purpose. Option D incorrectly modifies Route 53; traffic is already routed via ALB—the ALB itself must switch target groups.