DVA-C02 Deployment Practice Question
A company uses AWS CodeDeploy to deploy a web application to an Auto Scaling group. The deployment fails during the 'Install' lifecycle event. The developer checks the logs and finds that the scripts in the 'appspec.yml' file are not being executed because the instances are not in a healthy state. What could be the reason for the instances being unhealthy?
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 health check grace period on the Auto Scaling group is too short.
If the health check grace period is too short, instances may be marked unhealthy by the Auto Scaling group before the CodeDeploy installation scripts complete. This causes the deployment to fail during the 'Install' lifecycle event. Option B is incorrect because even if the ELB is not configured to route traffic, it would not directly cause instance health check failures during deployment; it would affect traffic routing. Option C is incorrect because an outdated CodeDeploy agent might cause script execution failures, but the logs indicate scripts are not executed because instances are unhealthy, not because of agent issues. Option D is incorrect because IAM permissions affect access to artifacts, but the error is about instance health, not access denied.
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 health check grace period on the Auto Scaling group is too short.
Why this is correct
During an AWS CodeDeploy deployment, new instances launched by an Auto Scaling group or existing instances undergoing a blue/green deployment need adequate time to initialize and for the application to start successfully. If the Auto Scaling group's health check grace period is too short, instances might be prematurely marked unhealthy by the Auto Scaling group before the CodeDeploy agent has finished installing dependencies, starting services, or even completing its deployment lifecycle events. This premature marking can lead to instances being terminated or removed from service before they are fully operational, disrupting the deployment and causing application instability.
- ✗
The Elastic Load Balancer is not configured to route traffic to the Auto Scaling group.
Why it's wrong here
If the Elastic Load Balancer (ELB) is not correctly configured to route traffic to the Auto Scaling group, it would indeed prevent users from accessing the web application, leading to a service outage. However, this specific misconfiguration does not inherently affect the health status of the EC2 instances themselves as reported by the Auto Scaling group or the CodeDeploy agent. Instances could still be fully operational, passing their internal health checks, and ready to serve traffic, even if no external traffic is reaching them through the misconfigured load balancer.
- ✗
The CodeDeploy agent on the instances is outdated.
Why it's wrong here
An outdated AWS CodeDeploy agent on the instances would primarily manifest as deployment failures, where the agent might be unable to process the latest deployment commands, download application artifacts, or execute lifecycle hooks correctly. While this would certainly prevent the application from deploying successfully, it would not directly cause the underlying EC2 instances to be marked as unhealthy by the Auto Scaling group's health checks. The instance itself could still be running and responsive from an infrastructure perspective, just unable to complete the application deployment.
- ✗
The IAM instance profile does not have permissions to access the S3 bucket where the artifacts are stored.
Why it's wrong here
If the IAM instance profile attached to the EC2 instances lacks the necessary permissions to access the S3 bucket containing the CodeDeploy application revision artifacts, the deployment would fail with an access denied error during the "DownloadBundle" lifecycle event. This permission issue would prevent the application from being deployed onto the instances, but it would not cause the EC2 instances themselves to be reported as unhealthy by the Auto Scaling group's health checks. The instances would remain healthy from an infrastructure perspective, just without the successfully deployed application.
Go deeper
Related to this question
About these practice questions
One of 1,135 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 →
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.