Courseiva
SDLC Automation →mediumMultiple Choice

DOP-C02 SDLC Automation Practice Question

A team uses AWS CodeDeploy to deploy a web application to an Auto Scaling group. The deployment fails with the error 'The overall deployment failed because too many individual instances failed deployment, too few healthy instances are available, or some instances in your deployment group are experiencing problems.' The team checks the logs and finds that the application installation script fails on some instances due to missing dependencies. What is the BEST long-term solution?

⚠ Common exam trap

Many exam-takers choose a retry mechanism or health check fix, thinking they can handle transient failures, but the question specifies 'missing dependencies'—a persistent issue that requires a proactive, image-based solution rather than reactive or permission-based fixes.

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

✓

Create a custom AMI that includes all dependencies and use it in the Auto Scaling group.

Creating a custom AMI that includes all dependencies ensures that every instance launched in the Auto Scaling group has the required software pre-installed. This eliminates the root cause of the deployment failure—missing dependencies—by baking them into the machine image, making deployments consistent and reliable. It is the best long-term solution because it avoids runtime dependency installation failures and reduces deployment time.

Answer analysis

Option-by-option breakdown

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

  • ✓

    Create a custom AMI that includes all dependencies and use it in the Auto Scaling group.

    Why this is correct

    Creating a custom Amazon Machine Image (AMI) that has all required runtime dependencies pre-installed and using it in the Auto Scaling group is the most robust fix. When instances launch from this golden AMI, the operating system and packages are already present, so the CodeDeploy deployment only needs to place and start the application code. This eliminates runtime failures caused by dependency installation errors and guarantees consistency across newly launched instances.

  • ✗

    Use an Elastic Load Balancer health check to automatically replace failed instances.

    Why it's wrong here

    An Elastic Load Balancer health check can detect unhealthy instances and trigger Auto Scaling to terminate and replace them, but this does not address the root cause of the deployment script failure. Every replacement instance will be launched from the same base AMI and will again run the same CodeDeploy script, which will fail because the dependencies are missing. Thus, the health check merely automates an endless cycle of failing instances instead of fixing the dependency issue.

  • ✗

    Modify the CodeDeploy AppSpec file to run the installation script as root.

    Why it's wrong here

    Modifying the AppSpec file to run the installation script as root only changes the user context under which the script executes. If the script fails because required packages or system libraries are absent from the operating system, running as root does not install those dependencies; the files are simply not present on the instance. Additionally, CodeDeploy installations commonly already run with sufficient privileges, so the root user change would have no observable effect on the dependency installation failure.

  • ✗

    Implement a retry mechanism in the deployment script to install dependencies again.

    Why it's wrong here

    Implementing a retry mechanism in the deployment script to attempt dependency installation again might help only if the original failure was transient, such as a temporary network outage or a package repository timeout. However, in this scenario the dependencies are absent by design from the base operating system, so retrying the same flawed installation script will typically repeat the same failure or may inconsistently succeed under particular timing that is not guaranteed. This approach does not provide a deterministic, repeatable solution and would unnecessarily prolong every deployment.

About these practice questions

One of 1,298 original DOP-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 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.