Courseiva
Configuration Management and IaCeasyMultiple ChoiceObjective-mapped

DOP-C02 Configuration Management and IaC Practice Question

A company uses AWS CodeDeploy to deploy applications to an Auto Scaling group. The deployment fails because the new version of the application crashes the instances. The DevOps engineer needs the Auto Scaling group to automatically replace the unhealthy instances with the previous working version. Which deployment configuration should the engineer use?

⚠ Common exam trap

A common mix-up: candidates confuse deployment strategies (in-place, canary, linear) with rollback mechanisms, assuming that any traffic-shifting method automatically replaces unhealthy instances with the previous version, when in fact only blue/green deployments inherently isolate the new environment and allow a clean revert without affecting the old instances.

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

Blue/Green deployment with a load balancer to switch traffic only after health checks pass.

A blue/green deployment with a load balancer health check ensures that the new (green) instances are validated before any traffic is routed to them. If the new version crashes, the health checks fail, the load balancer keeps traffic on the old (blue) instances, and the Auto Scaling group can automatically terminate the unhealthy green instances and replace them with the previous working version by reverting to the original launch configuration or template.

Answer analysis

Option-by-option breakdown

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

  • In-place deployment with a deployment group that has a failure threshold of 0.

    Why it's wrong here

    In-place deployments update each instance in the deployment group sequentially, and setting a failure threshold of 0 means the deployment stops as soon as any instance fails to update. However, it does not roll back the instances that were already updated, and the remaining instances remain at the original version, leaving the fleet in a mixed state. CodeDeploy would need an explicit rollback configuration to redeploy a previous revision, but that still is not an automatic traffic switch. Because the requirement is to roll back to a fully healthy environment, in-place with a failure threshold alone is insufficient.

  • Blue/Green deployment with a load balancer to switch traffic only after health checks pass.

    Why this is correct

    Blue/Green deployment creates a completely separate green environment and reroutes traffic only after the new instances pass health checks. The load balancer is the key component: it keeps traffic anchored to the blue environment until the green is verified healthy, and if health checks fail, you simply do not cut over or you can switch back to blue instantly. This gives an automatic, low-risk rollback path because the original environment remains intact and available. Thus, it satisfies the need to revert to the original version when issues are detected.

  • Canary deployment that shifts 10% of traffic to the new version, then 100% after 10 minutes.

    Why it's wrong here

    A canary deployment is typically implemented as a load balancer traffic shift where 10% of traffic is sent to the new version, and after a 10-minute observation window the remaining 90% is shifted over. This is a gradual rollout, but it does not automatically roll back if the new version starts failing during the 10-minute window or even after the full shift; the traffic shift proceeds on a fixed schedule. Without an explicit rollback trigger, you must manually reroute traffic, and the window is too short to fully identify issues. The specification requires a deployment method that supports automatic rollback, which a simple canary does not provide.

  • Linear deployment that shifts 10% of traffic every 10 minutes.

    Why it's wrong here

    A linear deployment gradually shifts traffic in equal increments, such as 10% every 10 minutes, independently of the actual health status of the new version. This means traffic continues to be routed to the new environment even if instances are failing or unhealthy, because the shift policy does not pause or reverse based on health checks. To roll back, you would need to manually redeploy or reconfigure the load balancer, which is not an automatic process. Thus, while linear deployment offers controlled exposure, it lacks the rollback-on-failure guarantee required by the scenario.

About these practice questions

Courseiva writes every DOP-C02 question from scratch — 251 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

2 more ways this is tested on DOP-C02

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. A company uses AWS CodeDeploy to deploy applications to an Auto Scaling group. During a deployment, the new instances fail the health check and are terminated. The deployment fails. The team wants to automatically roll back to the previous working version. What should they do?

hard
  • A.Set up an Auto Scaling lifecycle hook to terminate instances and trigger a rollback.
  • B.Configure the deployment group to automatically roll back when a deployment fails.
  • C.Manually redeploy the last successful deployment revision after investigating the failure.
  • D.Configure the deployment group to automatically redeploy the same revision on failure.

Why B: AWS CodeDeploy provides a built-in rollback configuration that can be triggered automatically when a deployment fails. By enabling automatic rollback in the deployment group settings, CodeDeploy will redeploy the last successful revision when the current deployment fails health checks, without requiring manual intervention or additional infrastructure.

Variation 2. A DevOps engineer is designing a CI/CD pipeline for a microservices architecture on AWS. They want to use AWS CodeDeploy to deploy applications to an Auto Scaling group. The pipeline must ensure that only a small percentage of instances are updated at a time, and if health checks fail, the deployment is automatically rolled back. Which deployment configuration should be used?

hard
  • A.Blue/green deployment with a fixed number of instances.
  • B.In-place deployment with 'CodeDeployDefault.AllAtOnce' configuration.
  • C.In-place deployment with 'CodeDeployDefault.HalfAtATime' configuration.
  • D.In-place deployment with 'CodeDeployDefault.OneAtATime' configuration and automatic rollback enabled.

Why D: The 'CodeDeployDefault.OneAtATime' configuration deploys to one instance at a time, ensuring only a small percentage of instances are updated simultaneously. Enabling automatic rollback triggers a rollback if health checks fail, meeting the requirement. Option D is correct. Option A (blue/green) is not in-place and typically updates all instances at once, not a small percentage. Option B (AllAtOnce) updates all instances simultaneously. Option C (HalfAtATime) updates half the instances, which is not as granular as OneAtATime and may not satisfy the 'small percentage' constraint.

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.