Courseiva
SDLC AutomationmediumMultiple ChoiceObjective-mapped

DOP-C02 SDLC Automation Practice Question

A development team uses AWS CodeCommit for source control and AWS CodePipeline for CI/CD. The pipeline has a source stage that pulls from a CodeCommit repository, a build stage using AWS CodeBuild, and a deploy stage that uses AWS CodeDeploy to deploy to an EC2 Auto Scaling group. The team notices that the pipeline frequently fails at the deploy stage with the error 'The deployment failed because the deployment group's deployment configuration specifies a minimum healthy host count of 1, but 0 healthy hosts are available.' What is the MOST likely cause of this issue?

⚠ Common exam trap

Many candidates confuse deployment failures caused by missing agents with network or load balancer issues, but the specific error about '0 healthy hosts' directly points to the agent not running or not reporting health, not to load balancer registration or pipeline permissions.

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

The CodeDeploy agent is not installed or is not running on the EC2 instances.

The error message indicates that the CodeDeploy deployment is failing because zero healthy hosts are available in the deployment group. The most common cause is that the CodeDeploy agent is not installed or not running on the EC2 instances, preventing them from reporting their health status to the CodeDeploy service. Without a healthy agent, the instances cannot execute the deployment lifecycle hooks, and CodeDeploy considers them unhealthy, leading to the failure.

Answer analysis

Option-by-option breakdown

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

  • The IAM role for CodePipeline does not have sufficient permissions to access the CodeCommit repository.

    Why it's wrong here

    CodePipeline's IAM role governs the source action that fetches the commit from CodeCommit; a permissions problem there would fail the pipeline at the Source stage, before any deployment action runs. The Deploy stage is executed by AWS CodeDeploy, which uses its own service role and the EC2 instance's instance profile, not CodePipeline's CodeCommit access. Since the error occurs during deployment and indicates an instance health issue, this option cannot explain the failure. In contrast, a missing CodeDeploy agent directly prevents instances from reporting healthy status.

  • The build artifacts are not being stored in an S3 bucket.

    Why it's wrong here

    Build artifacts are written to the configured S3 bucket by CodePipeline's build action; if they were absent, the pipeline would fail when transitioning from Build to Deploy because no artifact bundle exists to pass as input. That failure would occur at the build stage or the stage boundary, not during the deploy action itself after CodeDeploy has created a deployment. A 'no healthy instances' error happens after CodeDeploy receives the revision and begins distributing it to target instances, which is independent of artifact storage. Unhealthy instances specifically point to the on-instance agent rather than the storage location.

  • The EC2 instances are not registered with a Classic Load Balancer.

    Why it's wrong here

    Registering an instance with a Classic Load Balancer is only relevant if the deployment uses load-balancer-based traffic routing or blue/green lifecycle; CodeDeploy supports in-place deployments to instances in an Auto Scaling group or tag group with no load balancer at all. CodeDeploy's health check for 'healthy instances' relies on the agent sending status and heartbeat signals, not the health checks performed by an ELB. Therefore, an instance can be completely unregistered from any load balancer and still be deployed to successfully as long as the agent is running. The error is a signal that the agent is not reporting, not that the instance lacks LB membership.

  • The CodeDeploy agent is not installed or is not running on the EC2 instances.

    Why this is correct

    The CodeDeploy agent is a daemon installed on EC2 instances that handles deployment instructions, lifecycle events, and reporting instance status to the CodeDeploy service. Without a running agent, the service never receives a heartbeat or a success signal, so the instance is considered unhealthy and the deployment fails with an error like 'No healthy instances found'. This directly matches the symptom described, and verifying agent status with 'sudo service codedeploy-agent status' or checking /var/log/aws/codedeploy-agent/install.log is the first troubleshooting step. Installing or starting the agent on the tagged instances resolves the failure.

About these practice questions

This DOP-C02 question is part of Courseiva's 251-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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 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.