Courseiva
Development with AWS ServiceshardMultiple ChoiceObjective-mapped

DVA-C02 Development with AWS Services Practice Question

A developer is using AWS CodeDeploy to deploy a new version of an application to an Auto Scaling group. The deployment fails because the new instances do not pass the health check. The developer wants to automatically roll back the deployment if the health check fails. Which CodeDeploy setting should be configured?

⚠ Common exam trap

A common mix-up: candidates confuse deployment strategies (like blue/green or in-place) with rollback mechanisms, not realizing that rollback is a separate configuration setting that must be explicitly enabled regardless of the deployment strategy.

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 configuration.

AWS CodeDeploy provides a built-in automatic rollback feature that can be configured at the deployment group level. When enabled, if a deployment fails (e.g., due to health check failures), CodeDeploy automatically reverts to the last known successful deployment, ensuring minimal downtime and manual intervention.

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 the deployment configuration to AllAtOnce to speed up the process.

    Why it's wrong here

    While the AllAtOnce deployment configuration deploys to all instances simultaneously, potentially speeding up the initial deployment phase, it fundamentally lacks any built-in mechanism for automatic rollback. If the new application version introduces issues, all instances will be affected, and manual intervention would be required to revert to a previous working state. This configuration prioritizes deployment speed over automated recovery and resilience.

  • Configure a lifecycle hook to terminate failing instances.

    Why it's wrong here

    AWS CodeDeploy lifecycle hooks allow developers to run custom scripts or pause a deployment at specific stages, such as before installing an application or after traffic is shifted. While a hook could potentially identify a failing instance or trigger a notification, its primary function is not to automatically initiate a full deployment rollback across the entire deployment group. Terminating a single failing instance via a hook would remove it from the group but would not revert the application version on other instances or trigger a comprehensive rollback.

  • Use a blue/green deployment strategy instead of in-place.

    Why it's wrong here

    A blue/green deployment strategy creates an entirely new environment (green) for the new application version, keeping the old environment (blue) operational. This approach significantly minimizes downtime and simplifies manual rollback by merely shifting traffic back to the stable blue environment. However, the blue/green strategy itself does not inherently provide *automatic* rollback; explicit configuration within the CodeDeploy deployment group is still required to define conditions (e.g., CloudWatch alarms) that will trigger an automatic traffic shift back to the original blue environment upon detecting a failure.

  • Enable automatic rollback in the deployment group configuration.

    Why this is correct

    Enabling automatic rollback within the CodeDeploy deployment group configuration is the most direct and effective solution for ensuring recovery from problematic deployments. This feature allows CodeDeploy to monitor the health of a new deployment using specified CloudWatch alarms or other health checks. Upon detecting a failure, it automatically reverts all instances in the deployment group to the last known good application revision, minimizing downtime and operational overhead by providing a self-healing mechanism.

About these practice questions

One of 724 original DVA-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 →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This DVA-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 DVA-C02 exam.