Question 862 of 1,740
Configuration Management and IaCmediumMultiple ChoiceObjective-mapped

Quick Answer

The correct choice is to configure the CloudFormation deployment action in CodePipeline with 'ActionMode' set to 'CREATE_UPDATE' and check the 'Rollback on failure' option. This works because when 'Rollback on failure' is enabled, CloudFormation automatically reverts the stack to its last known good state—the previously deployed stack—if an update fails, such as from a deprecated AMI reference. On the AWS Certified DevOps Engineer Professional DOP-C02 exam, this scenario tests your understanding of how CodePipeline integrates with CloudFormation’s stack lifecycle, specifically the distinction between 'CREATE_UPDATE' and 'REPLACE_ON_FAILURE' modes; a common trap is assuming you need a separate rollback action or a change set. Remember that 'Rollback on failure' is a checkbox within the action configuration, not a separate pipeline stage. A helpful memory tip: think of it as "update and auto-revert" to recall that the stack is updated first, then automatically rolled back if the update fails.

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 DevOps team uses AWS CodePipeline to automate deployments. The pipeline has a Deploy stage that uses AWS CloudFormation to create or update a stack. Recently, a stack update failed because the template referenced an AMI that was deprecated. The team wants to automatically roll back the stack to the last known good state if a deployment fails. What should they do?

Question 1mediummultiple choice
Full question →

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 CloudFormation deployment action in CodePipeline with 'ActionMode' set to 'CREATE_UPDATE' and check the 'Rollback on failure' option.

Option A is correct because the CloudFormation deployment action in CodePipeline supports a 'Rollback on failure' option when 'ActionMode' is set to 'CREATE_UPDATE'. When enabled, if the stack update fails, CloudFormation automatically rolls back the stack to the last known good state (the previously deployed stack). This directly addresses the team's requirement to revert to a stable state after a failed deployment due to a deprecated AMI.

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.

  • Configure the CloudFormation deployment action in CodePipeline with 'ActionMode' set to 'CREATE_UPDATE' and check the 'Rollback on failure' option.

    Why this is correct

    CodePipeline's CloudFormation action supports automatic rollback on failure.

    Related concept

    Read the scenario before looking for a memorised answer.

  • Use the CodePipeline console to enable 'Automatic rollback' for the Deploy stage.

    Why it's wrong here

    CodePipeline does not have an automatic rollback for stage failures; it has 'Stage transition' settings.

  • Set the stack's 'DisableRollback' parameter to 'true' in the template.

    Why it's wrong here

    Disabling rollback would cause the stack to remain in a failed state, not roll back.

  • Add a stack policy to the CloudFormation stack that denies updates to the AMI parameter.

    Why it's wrong here

    A stack policy prevents updates to specific resources, but does not trigger rollback.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates confuse the CloudFormation stack-level 'DisableRollback' parameter (which controls rollback during stack creation) with the CodePipeline action-level 'Rollback on failure' option, leading them to incorrectly select Option C.

Detailed technical explanation

How to think about this question

Under the hood, when 'Rollback on failure' is enabled in the CodePipeline CloudFormation action, the pipeline invokes the CloudFormation UpdateStack API with the 'RollbackConfiguration' parameter set to monitor the stack creation or update. If the stack enters a 'ROLLBACK_IN_PROGRESS' state due to a failure, CloudFormation reverts to the previous stack template and parameters. A real-world scenario where this matters is when a pipeline deploys multiple stacks in sequence; a failed rollback on one stack could leave dependent stacks in an inconsistent state, so the team should also consider using change sets or stack policies to prevent destructive updates.

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.

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.

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 CloudFormation deployment action in CodePipeline with 'ActionMode' set to 'CREATE_UPDATE' and check the 'Rollback on failure' option. — Option A is correct because the CloudFormation deployment action in CodePipeline supports a 'Rollback on failure' option when 'ActionMode' is set to 'CREATE_UPDATE'. When enabled, if the stack update fails, CloudFormation automatically rolls back the stack to the last known good state (the previously deployed stack). This directly addresses the team's requirement to revert to a stable state after a failed deployment due to a deprecated AMI.

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 →

How Courseiva writes practice questions · Editorial policy

Keep practising

More DOP-C02 practice questions

Last reviewed: Jun 11, 2026

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.

Loading comments…

Sign in to join the discussion.

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.