Roll the green Auto Scaling group to the new version first, then switch the ALB to the green target group

Answer Correct answer: A — roll the green Auto Scaling group to the new version first, then switch the ALB to the green target group.

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?

  1. 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. Correct Answer
  2. 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.
  3. 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.
  4. 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.

Community Votes

A
100%

100% of anonymous learners picked answer A. Votes are pick records left by other test-takers — they are not the verified answer.

Community Insight

Because the target group configuration determines which version each Auto Scaling group loads, the green fleet must be fully updated before it receives traffic (A). Option A follows exactly that order: rolling restart of the green group first, then the ALB target group update (A). Option B reverses the order, switching traffic to green before the new version is deployed, which would route requests to unprepared instances. Option C deploys the new version to the blue group, so traffic would never move to green and no blue/green shift occurs. Option D points Route 53 at a green endpoint on the ALB, but the Route 53 record resolves to the ALB, not to a per-environment endpoint, so that change does not perform the target group switch.

The blue and green environments are represented by separate Auto Scaling groups and ALB target groups, and the deployment must shift traffic all at once from blue to green. The correct order is to first roll out the new application version onto the green environment's instances with a rolling restart of the green Auto Scaling group, and only once that rollout has completed switch the load balancer to send traffic to the green environment's target group. Updating the load balancer before the green fleet is ready would send traffic to instances that are not yet running the new version.

Updating the ALB to send traffic to the green target group before rolling the green Auto Scaling group (B) — this sends production traffic to instances that have not yet received the new application version, so the cutover happens against an unprepared fleet. Updating the launch template to deploy the green version to the blue instances (C) — this leaves both target groups and Auto Scaling groups untouched, so no traffic shift to green ever occurs and the change is deployed to the environment being replaced. Pointing Route 53 at the green environment's endpoint on the ALB (D) — eugene2owl described the correct mechanism as first updating the new cluster with the new version and then shifting ALB traffic between target groups; the Route 53 record points at the ALB itself rather than at a per-environment endpoint, so changing it does not select the green target group.

Community Discussion (4 comments)

koo_kai 👍 5
it's A Q.120
youonebe 👍 2 Selected: A
Should be A
eugene2owl 👍 2 Selected: A
For sure, it's "A". First we update new (meaning "green") cluster with a new version. And after that we shift traffic of ALB from first target group to the second.
fnameni 👍 2 Selected: A
A it's correct

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

Expert Analysis

Why the Answer Is Correct

The architecture has a separate Auto Scaling group and target group for each environment, and the target group is what determines which application version the instances behind it serve. A traffic shift that happens before the green fleet is updated would therefore send production traffic to instances still running the old version, defeating the purpose and risking an outage. The correct sequence is to first roll out the new application version onto the green environment's instances by starting a rolling restart of the green Auto Scaling group, wait for that rollout to complete so every green instance is serving the new version, and only then update the ALB to send traffic to the green environment's target group (A). Because the ALB target group update is a single action, the shift is all at once as required. A is the correct answer.

Why the Other Options Are Wrong

B updates the ALB to send traffic to the green target group and then starts the rolling restart of the green Auto Scaling group. This reverses the required order: traffic reaches the green environment before its instances have been updated to the new application version, so the all-at-once cutover would be performed against a fleet that is not yet ready. C updates the launch template to deploy the green version to the blue environment's instances and performs a rolling restart of the blue group, deliberately leaving the target groups and Auto Scaling groups unchanged. This updates the environment that is being replaced rather than the new one, so traffic never shifts to green and the blue/green requirement is not met at all. D starts the rolling restart of the green Auto Scaling group and then updates Route 53 to point to the green environment's endpoint on the ALB. The Route 53 record for the application resolves to the ALB itself rather than to a per-environment endpoint, so changing that record does not switch which target group the load balancer uses; as eugene2owl explained, the traffic shift is performed by shifting the ALB between target groups after the new cluster is updated. A is correct.

Community Comment Notes

Community voted A unanimously. eugene2owl gave the decisive reasoning, that the new green cluster must first be updated with the new version and only afterwards is ALB traffic shifted from the first target group to the second. koo_kai, youonebe, and fnameni all selected A without further qualification, and no commenter proposed an alternative.

Official Reference

Related Analysis

Practice All DOP-C02 Questions

Access 85 questions with complete answers and detailed explanations.

View Full DOP-C02 Practice Test →

← Back to DOP-C02 Study Guide