- A
Set up an Auto Scaling lifecycle hook to terminate instances and trigger a rollback.
Why wrong: Auto Scaling hooks do not trigger rollbacks.
- B
Configure the deployment group to automatically roll back when a deployment fails.
CodeDeploy can automatically roll back to the last known good revision.
- C
Manually redeploy the last successful deployment revision after investigating the failure.
Why wrong: Manual rollback is not automatic.
- D
Configure the deployment group to automatically redeploy the same revision on failure.
Why wrong: Redeploying the same revision will likely fail again.
Quick Answer
The answer is to configure the deployment group to automatically roll back when a deployment fails. This is correct because AWS CodeDeploy’s built-in rollback mechanism monitors deployment events—such as failed health checks on new instances in an Auto Scaling group—and automatically redeploys the last known good revision, eliminating the need for manual intervention or custom scripts. On the AWS Certified DevOps Engineer Professional DOP-C02 exam, this concept tests your understanding of deployment group settings versus manual rollback or lifecycle hook approaches; a common trap is confusing automatic rollback with simply terminating failed instances, which does not restore the previous version. Remember the key distinction: automatic rollback is a deployment group configuration, not an instance-level action. A useful memory tip is “rollback is a group decision”—if the deployment fails, the group decides to revert, not the individual instance.
DOP-C02 Configuration Management and IaC Practice Question
This DOP-C02 practice question tests your understanding of configuration management and iac. The scenario asks you to isolate a root cause — eliminate options that address a different problem before choosing. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.
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?
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.
Option B is correct because 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.
Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Set up an Auto Scaling lifecycle hook to terminate instances and trigger a rollback.
Why it's wrong here
Auto Scaling hooks do not trigger rollbacks.
- ✓
Configure the deployment group to automatically roll back when a deployment fails.
Why this is correct
CodeDeploy can automatically roll back to the last known good revision.
Related concept
Read the scenario before looking for a memorised answer.
- ✗
Manually redeploy the last successful deployment revision after investigating the failure.
Why it's wrong here
Manual rollback is not automatic.
- ✗
Configure the deployment group to automatically redeploy the same revision on failure.
Why it's wrong here
Redeploying the same revision will likely fail again.
Common exam traps
Common exam trap: answer the scenario, not the keyword
The trap here is that candidates may confuse Auto Scaling lifecycle hooks with CodeDeploy rollback mechanisms, or think that redeploying the same revision (option D) would fix the issue, when in fact it would just repeat the failure.
Detailed technical explanation
How to think about this question
Under the hood, CodeDeploy automatic rollback works by tracking the last successful deployment revision for each deployment group. When a deployment fails (e.g., due to health check failures), CodeDeploy automatically initiates a new deployment using that last successful revision, and it can also be configured to fail the rollback if the rollback itself fails. This feature is critical in production environments where downtime must be minimized, and it integrates with CloudWatch alarms or deployment failure events to trigger the rollback without manual intervention.
KKey Concepts to Remember
- Read the scenario before looking for a memorised answer.
- Find the constraint that changes the correct option.
- Eliminate answers that are true in general but not in this case.
TExam Day Tips
- Watch for words such as best, first, most likely and least administrative effort.
- Review why wrong options are wrong, not only why the correct option is correct.
Key takeaway
Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Real-world example
How this comes up in practice
A cloud solutions architect for a retail company is evaluating services for a new workload. The correct answer here reflects best practice for the specific scenario described — not a general cloud recommendation. Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option. Cloud exam questions reward reading the constraint carefully: the same technology can be right or wrong depending on the use case.
What to study next
Got this wrong? Here's your next step.
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
- →
Configuration Management and IaC — study guide chapter
Learn the concepts, then practise the questions
- →
Configuration Management and IaC practice questions
Targeted practice on this topic area only
- →
All DOP-C02 questions
1,740 questions across all exam domains
- →
AWS Certified DevOps Engineer Professional DOP-C02 study guide
Full concept coverage aligned to exam objectives
- →
DOP-C02 practice test guide
How to use practice tests most effectively before exam day
Related practice questions
Related DOP-C02 practice-question pages
Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.
Configuration Management and IaC practice questions
Practise DOP-C02 questions linked to Configuration Management and IaC.
Resilient Cloud Solutions practice questions
Practise DOP-C02 questions linked to Resilient Cloud Solutions.
Monitoring and Logging practice questions
Practise DOP-C02 questions linked to Monitoring and Logging.
Incident and Event Response practice questions
Practise DOP-C02 questions linked to Incident and Event Response.
Security and Compliance practice questions
Practise DOP-C02 questions linked to Security and Compliance.
SDLC Automation practice questions
Practise DOP-C02 questions linked to SDLC Automation.
DOP-C02 fundamentals practice questions
Practise DOP-C02 questions linked to DOP-C02 fundamentals.
DOP-C02 scenario practice questions
Practise DOP-C02 questions linked to DOP-C02 scenario.
DOP-C02 troubleshooting practice questions
Practise DOP-C02 questions linked to DOP-C02 troubleshooting.
Practice this exam
Start a free DOP-C02 practice session
Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.
FAQ
Questions learners often ask
What does this DOP-C02 question test?
Configuration Management and IaC — This question tests Configuration Management and IaC — Read the scenario before looking for a memorised answer..
What is the correct answer to this question?
The correct answer is: Configure the deployment group to automatically roll back when a deployment fails. — Option B is correct because 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.
What should I do if I get this DOP-C02 question wrong?
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
What is the key concept behind this question?
Read the scenario before looking for a memorised answer.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Same concept, more angles
3 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 deployment fails because the target instances are not passing the health checks. The DevOps engineer notices that the CodeDeploy agent logs show 'The overall deployment failed because too many individual instances failed deployment, too few healthy instances are available for deployment, or some instances in your deployment group are experiencing problems.' Which step should the engineer take to diagnose the issue?
medium- A.Increase the size of the Auto Scaling group to ensure more instances are available.
- ✓ B.Review the CodeDeploy deployment logs on a failed instance to identify script errors.
- C.Create a CloudWatch alarm to monitor the deployment health.
- D.Check AWS CloudTrail logs for the CodeDeploy API calls to see if permissions are missing.
Why B: Option B is correct because reviewing the deployment logs on a failed instance provides details on why the application installation failed. Option A is wrong because CloudTrail logs API calls, not deployment scripts. Option C is wrong because scaling policies do not cause deployment failures. Option D is wrong because CloudWatch alarms may not capture script-level errors.
Variation 2. 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?
easy- A.In-place deployment with a deployment group that has a failure threshold of 0.
- ✓ B.Blue/Green deployment with a load balancer to switch traffic only after health checks pass.
- C.Canary deployment that shifts 10% of traffic to the new version, then 100% after 10 minutes.
- D.Linear deployment that shifts 10% of traffic every 10 minutes.
Why B: Option B (Blue/Green deployment) is correct because it keeps the old environment (blue) running while the new environment (green) is tested; if the green environment fails, traffic can be redirected back to blue. Option A is wrong because in-place deployments replace instances gradually and do not automatically revert. Option C is wrong because canary deployments are for gradual traffic shifting, not full rollback. Option D is wrong because linear deployments incrementally shift traffic and do not automatically roll back.
Variation 3. 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, minimizing impact. Combined with automatic rollback on health check failure, this meets the requirement. Option C is correct. Options A, B, and D either deploy too many instances at once or do not provide rollback.
Last reviewed: Jun 24, 2026
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.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.