Courseiva
Question 36 of 1,511
Configuration Management and IaCmediumMultiple ChoiceObjective-mapped

DOP-C02 Configuration Management and IaC Practice Question

A team is using AWS CodeDeploy to deploy an application to EC2 instances. They want to ensure that if a deployment fails, the instances are automatically rolled back to the previous version. What should they configure?

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

Enable automatic rollback in the deployment group settings.

CodeDeploy supports automatic rollback configuration. When enabled, if a deployment fails, CodeDeploy automatically redeploys the last successful revision. Option A is wrong because a hook is a lifecycle event, not a rollback mechanism. Option B is wrong because a deployment group contains instances but does not have a rollback setting. Option C is wrong because a deployment configuration specifies traffic routing and failure thresholds, not automatic rollback.

Answer analysis

Option-by-option breakdown

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

  • Add a BeforeBlockTraffic hook to the AppSpec file to run a rollback script.

    Why it's wrong here

    Hooks are for lifecycle events, not automatic rollback.

  • Set the deployment configuration to 'CodeDeployDefault.OneAtATime' for a gradual deployment.

    Why it's wrong here

    This controls traffic shifting, not rollback.

  • Configure the deployment group to use the same Auto Scaling group for rollback.

    Why it's wrong here

    This does not provide automatic rollback.

  • Enable automatic rollback in the deployment group settings.

    Why this is correct

    Automatic rollback redeploys the previous revision on failure.

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

Last reviewed: Jun 20, 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.