Courseiva
Question 550 of 1,511
Configuration Management and IaCmediumMultiple SelectObjective-mapped

DOP-C02 Configuration Management and IaC Practice Question

A team is using AWS CodeDeploy to deploy a web application to EC2 instances. They want to ensure that rollbacks occur automatically if the deployment fails. Which THREE configurations are necessary?

⚠ Common exam trap

Candidates often confuse lifecycle event hooks (which only stop a deployment) with automatic rollback mechanisms, or they mistakenly think an ALB is required for rollbacks, when in fact automatic rollback is a separate setting in the deployment group configuration.

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 a CloudWatch Events rule to trigger a rollback on deployment failure.

You can configure an Amazon CloudWatch Events rule to detect a deployment failure event and automatically trigger a rollback. This is a common pattern for automating rollbacks when you need custom logic or additional actions beyond the built-in automatic rollback feature. The CloudWatch Events rule listens for the CodeDeploy Deployment State Change event with a status of 'FAILURE' and invokes a rollback via a Lambda function or by calling the CodeDeploy API.

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 lifecycle event hooks to stop the deployment if a script fails.

    Why it's wrong here

    Lifecycle hooks do not trigger rollback automatically.

  • Configure a CloudWatch Events rule to trigger a rollback on deployment failure.

    Why this is correct

    Events can invoke rollback.

  • Configure Amazon CloudWatch alarms on the deployment group.

    Why this is correct

    Alarms can trigger rollback.

  • Enable automatic rollback in the deployment group settings.

    Why this is correct

    This is the primary configuration.

  • Associate an Application Load Balancer with the deployment group.

    Why it's wrong here

    Not required for rollback.

Quick reference

Cloud Service Model Comparison

ModelYou ManageProvider ManagesExamples
IaaSOS, runtime, apps, dataHardware, hypervisor, networkingEC2, Azure VMs, GCP Compute Engine
PaaSApps and dataOS, runtime, middleware, hardwareElastic Beanstalk, Azure App Service
SaaSData and settings onlyEverything elseMicrosoft 365, Salesforce, Workday
FaaS / ServerlessFunction code onlyInfra, scaling, runtimeLambda, Azure Functions, Cloud Run
CaaSContainers and appsKubernetes, OS, hardwareEKS, AKS, GKE

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: Jul 4, 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.