DOP-C02 SDLC Automation Practice Question
A company is using AWS CodeDeploy with a blue/green deployment strategy for an Amazon ECS service. After a deployment, the new task set fails health checks, and CodeDeploy automatically rolls back to the original task set. However, the rollback fails because the original task set's desired count is set to 0. What is the most likely cause?
⚠ Common exam trap
Watch out — candidates often assume the rollback fails because the original task set is unhealthy or deregistered from the target group, when in reality the root cause is the deletion of the original task definition, which CodeDeploy needs to recreate the task set during 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
✓
The original task set's desired count was set to 0 during the blue/green deployment and the rollback is unable to restore it because the original task definition is no longer available.
During a blue/green deployment on ECS, CodeDeploy sets the original (blue) task set's desired count to 0 after the new (green) task set is created and begins serving traffic. If the green task set fails health checks and triggers an automatic rollback, CodeDeploy attempts to restore the original task set's desired count to its previous value. However, if the original task definition has been deregistered or deleted (e.g., due to lifecycle policies or manual cleanup), the rollback cannot scale the original task set back up, causing the rollback to fail.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
The original task set's desired count was set to 0 during the blue/green deployment and the rollback is unable to restore it because the original task definition is no longer available.
Why this is correct
In a blue/green ECS deployment, CodeDeploy shifts traffic to the replacement task set and sets the original task set's desired count to zero. When a rollback triggers, CodeDeploy attempts to restore that original task set, but if its task definition revision was deregistered or replaced, ECS cannot recreate the task set. The missing task definition makes it impossible to satisfy the service's desired count, leaving the service at zero. This is why keeping the original task definition revision available is critical for successful rollbacks.
- ✗
The original task set's health checks are failing.
Why it's wrong here
Health checks failing on the original task set would not be the cause, because CodeDeploy's deployment health checking is focused on the new, green task set, not the blue one. The original task set was already scaled to zero as part of the completed traffic shift, regardless of its health status. A rollback failure rooted in missing task definitions is independent of health check outcomes, and health checks themselves do not modify the desired count of the original task set.
- ✗
The original task set's CloudFormation stack was deleted during the deployment.
Why it's wrong here
CodeDeploy's blue/green deployment for ECS directly manages the ECS service, task sets, and target groups; it does not create or delete CloudFormation stacks. A CloudFormation stack being deleted would only matter if the entire application stack was removed, which is outside the scope of a CodeDeploy deployment and would not specifically leave the original task definition unavailable. The actual condition behind the rollback failure is the deletion or deregistration of the original task definition revision, not a CloudFormation stack deletion.
- ✗
The original task set was deregistered from the target group.
Why it's wrong here
The original task set being deregistered from the target group is expected behavior: after the green task set passes health checks, CodeDeploy transfers all traffic to it and removes the blue task set from the target group. This deregistration is reversible during a rollback by simply updating the target group's registration. The key issue is that the original task set's desired count is zero and the original task definition is no longer available, so ECS cannot recreate the task set to match that desired count. Target group deregistration does not prevent CodeDeploy from managing the ECS service; the missing task definition is what blocks the rollback.
Go deeper
Related to this question
About these practice questions
One of 251 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 →
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.