Courseiva
DeploymenthardMultiple SelectObjective-mapped

DVA-C02 Deployment Practice Question

A company is using AWS CodeDeploy to deploy an application to an Auto Scaling group. The deployment group has a deployment configuration of CodeDeployDefault.AllAtOnce. During a deployment, some instances fail the deployment. Which THREE actions should the developer take to improve the deployment health?

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

Change the deployment configuration to CodeDeployDefault.OneAtATime.

The correct options are B, C, and E. - Option A is incorrect: Increasing the minimum number of healthy instances in the Auto Scaling group does not affect CodeDeploy's deployment health checks; it only controls ASG scaling behavior. - Option B is correct: Changing the deployment configuration to CodeDeployDefault.OneAtATime reduces risk by deploying to one instance at a time, allowing you to detect and halt failures before affecting more instances. - Option C is correct: Configuring a lifecycle hook to run validation tests ensures that an instance is only marked healthy after passing critical checks, preventing unhealthy instances from receiving traffic. - Option D is incorrect: Using a larger instance type does not address the underlying cause of deployment failures (e.g., script errors, misconfigurations) and is not a direct mechanism to improve deployment health. - Option E is correct: Adding an Elastic Load Balancer health check to the deployment group allows CodeDeploy to verify that instances are healthy before completing the deployment, enabling automatic rollback if checks fail.

Answer analysis

Option-by-option breakdown

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

  • Increase the minimum number of healthy instances in the Auto Scaling group.

    Why it's wrong here

    Increasing the minimum healthy instance count in the Auto Scaling group only ensures a baseline number of running instances; it does not alter how CodeDeploy rolls out the new revision. This setting does not reduce the number of instances taken offline at once, nor does it add validation logic, so it cannot address the deployment risk. It may even increase cost without improving deployment safety.

  • Change the deployment configuration to CodeDeployDefault.OneAtATime.

    Why this is correct

    CodeDeployDefault.OneAtATime is a deployment configuration that deploys the application revision to a single instance at a time, pausing between instances to verify that the deployment succeeded. This minimizes the number of instances taken out of service concurrently, so if the new revision fails health checks, only a small fraction of traffic is affected. It also provides an automatic rollback or stop opportunity before the entire fleet is updated.

  • Configure a lifecycle hook to run validation tests before the instance is marked as healthy.

    Why this is correct

    A lifecycle hook suspends an instance's state transition until you run custom validation tests and send a CONTINUE or ABANDON result. In a CodeDeploy deployment, you can use a hook to run application-specific health checks before the instance is registered or marked healthy. This ensures that only instances passing validation receive traffic, directly improving the reliability of the deployment.

  • Use a larger instance type to handle the deployment load.

    Why it's wrong here

    The size of the instance type does not change how CodeDeploy sequences or validates the deployment. A larger instance can only help if the application itself is resource-constrained, but it does not reduce the risk of a bad revision being rolled out across the fleet. Deployment health is governed by the deployment configuration, hooks, and health checks, not by instance capacity.

  • Add an Elastic Load Balancer health check to the deployment group.

    Why this is correct

    Associating an Elastic Load Balancer with the CodeDeploy deployment group makes the deployment process deregister each instance from the target group before deployment, then re-register and wait for it to pass health checks. Only instances that pass the ELB health check are marked as healthy and receive traffic. This is an official best practice for blue/green or rolling deployments to prevent failed instances from serving requests.

About these practice questions

Courseiva writes every DVA-C02 question from scratch — 724 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. 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.