Courseiva
SDLC Automation →hardMultiple Choice

DOP-C02 SDLC Automation Practice Question

A company is using AWS CodeDeploy to deploy a web application to an Auto Scaling group of Amazon EC2 instances. The deployment strategy is Blue/Green. After a successful deployment, the team notices that the new instances are receiving traffic but the application returns errors. The old instances are still serving traffic correctly. The team wants to roll back immediately. What should be done?

⚠ Common exam trap

The trap is that candidates may think stopping a deployment or manually modifying Auto Scaling groups will revert traffic. However, the correct method is to use CodeDeploy's rollback feature for the deployment. Automatic rollback configuration is not required for manual rollback.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Configure the deployment group to automatically roll back when a deployment fails, then manually trigger a rollback.

To roll back a CodeDeploy Blue/Green deployment, you should initiate a rollback deployment with the previous application revision. This can be done via the AWS CLI (`aws deploy create-deployment` with the old revision) or via the CodeDeploy console. Configuring automatic rollback on deployment failure is a separate setting and is not a prerequisite for manual rollback. The explanation should be corrected to state that the rollback process creates a new replacement environment with the previous revision (or reuses the original if still available) and shifts traffic to it, not that automatic rollback must be configured first.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Stop the current deployment using the AWS CLI.

    Why it's wrong here

    Stopping the deployment with the AWS CLI using `stop-deployment` is only valid while the deployment is still in progress; once the deployment has completed and the green instances are serving traffic, the stop command has no effect on routing. Even if issued mid-deployment, stopping only halts any further traffic shift—it does not automatically reroute traffic back to the blue environment, leaving the partially or fully deployed green group active. Therefore, this action fails to undo the erroneous deployment.

  • ✗

    Manually update the Auto Scaling group to associate new instances with the old launch configuration.

    Why it's wrong here

    Manually updating the Auto Scaling group to associate new instances with the old launch configuration does not redirect existing traffic; it only affects instances launched during future scaling events, leaving the current erroneous instances serving traffic. This option is tempting because altering the launch configuration is a standard method to revert the instance template for new deployments, and it would be correct if the goal were to prevent *future* instances from using the faulty configuration rather than to roll back live traffic immediately.

  • ✓

    Configure the deployment group to automatically roll back when a deployment fails, then manually trigger a rollback.

    Why this is correct

    The correct approach is to leverage CodeDeploy's rollback capability: configure the deployment group to automatically roll back on deployment failure (or on a CloudWatch alarm), which causes CodeDeploy to track the last known good revision. Triggering the rollback—either through the console's rollback action or by redeploying the previous successful revision—makes CodeDeploy deploy that good revision to the green fleet and shift traffic back to the original blue environment, restoring the known-good service. This is the only option that actively reverses the faulty deployment and restores live traffic, rather than merely affecting future instances or repeating the defect.

  • ✗

    Redeploy the same application revision to the same Auto Scaling group.

    Why it's wrong here

    Redeploying the same application revision to the same Auto Scaling group repeats the exact same faulty code and lifecycle scripts, so the deployment will either fail again at the same point or, if allowed, re-apply the identical defect to the same instances. This option does not reference a prior successful revision, nor does it perform any traffic shifting back to the blue environment. CodeDeploy rollback specifically requires deploying the last known good revision, not re-running the revision already proven to be broken.

About these practice questions

One of 1,298 original DOP-C02 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This DOP-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DOP-C02 exam.