DOP-C02 SDLC Automation Practice Question
A DevOps team uses AWS CodeDeploy to deploy an application to an Auto Scaling group. The deployment fails with a 'HealthCheckFailed' error. The application is running, but the health check endpoint returns HTTP 500. What should the team do to resolve this issue?
⚠ Common exam trap
Many candidates confuse CodeDeploy's deployment health check with Auto Scaling's health check grace period, thinking that increasing the grace period will allow the application more time to become healthy, but CodeDeploy's health check is immediate and not governed by that setting.
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
✓
Modify the application to handle the health check endpoint correctly and return HTTP 200.
The health check endpoint returns HTTP 500, indicating the application is not functioning correctly despite running. CodeDeploy uses the health check endpoint to verify the application is healthy after deployment; returning HTTP 200 is required for the deployment to succeed. The team must fix the application code to properly handle the health check endpoint and return a successful status.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Change the deployment configuration to use AllAtOnce to avoid health checks.
Why it's wrong here
AllAtOnce changes the deployment strategy to target all instances simultaneously instead of gradually, but it does not disable or modify CodeDeploy's health-check validation. CodeDeploy still runs the ValidateService hook or ELB health check after install; if the endpoint returns HTTP 500, the deployment is marked failed and instances are flagged. Moreover, AllAtOnce actually increases risk by eliminating batch isolation, so it would turn a broken application into a full-site outage.
- ✗
Increase the health check grace period in the Auto Scaling group.
Why it's wrong here
The Auto Scaling group health check grace period only delays the start of ASG's own EC2 status/ELB health checks on newly launched instances; it has no effect on CodeDeploy's deployment validation. CodeDeploy performs its health check immediately after application start or through the load balancer's target group, independent of ASG grace settings. Even if the grace period postpones the check, the moment it runs the endpoint still returns 500 and the deployment fails.
- ✗
Disable the health check in the CodeDeploy deployment configuration.
Why it's wrong here
CodeDeploy deployment configurations control the minimum number of healthy hosts needed during a deployment, not a separate 'health check' toggle; health checks are implemented via the ValidateService hook or the load balancer's target group health checks. Skipping or disabling those checks would prevent CodeDeploy from detecting the broken endpoint and could allow traffic to be served by a failing application, which is exactly what the team needs to avoid. This option addresses the symptom by hiding the problem rather than fixing the application.
- ✓
Modify the application to handle the health check endpoint correctly and return HTTP 200.
Why this is correct
The only root-cause solution is to fix the application so the health check endpoint responds with HTTP 200 (or another configured success code) once the service is up. CodeDeploy and the associated load balancer rely on that HTTP status to determine whether an instance is healthy; a 500 response signals a failed deployment and triggers rollback. Once the endpoint returns 200, the health check passes, instances remain in service, and the deployment completes successfully.
Visual reference
Go deeper
Related to this question
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 →
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.