DOP-C02 Configuration Management and IaC Practice Question
A DevOps engineer is using AWS CodeDeploy to deploy an application to an Auto Scaling group. The deployment fails with the error: 'The overall deployment failed because too many individual instances failed deployment'. The engineer checks the logs and finds that the application installation script exits with a non-zero exit code. What should the engineer do to troubleshoot?
⚠ Common exam trap
A common mix-up: candidates assume increasing MinHealthyHosts or re-uploading the revision will fix the issue, when in fact the problem is a script-level error that requires direct investigation on a failed instance.
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
✓
SSH into one of the failed instances and run the install script manually to identify the error
The deployment failure is caused by the application installation script exiting with a non-zero exit code, which indicates a specific error in the script or its environment. SSHing into a failed instance and running the install script manually allows the engineer to see the exact error output, debug the script logic, and identify missing dependencies or configuration issues directly on the target host.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Configure CloudWatch Logs to capture the script output
Why it's wrong here
Configuring CloudWatch Logs to capture script output is useful for auditing and post-incident analysis, but it does not resolve the current deployment failure. The CodeDeploy lifecycle script has already executed and exited with a non-zero code on the target instances, so you still need to inspect the actual error message and exit code to implement a fix. This action only adds observability; it cannot change the script's behavior or the failed lifecycle event.
- ✗
Increase the deployment's MinHealthyHosts percentage
Why it's wrong here
Adjusting MinHealthyHosts only changes CodeDeploy's tolerance for how many instances can be unavailable while a deployment is in progress; it does not address why the install script is failing. Raising the percentage tightens the requirement for healthy hosts, which can actually cause the deployment to fail faster rather than recover from the error. This tuning masks the underlying issue and risks allowing a broken application to persist across the fleet.
- ✗
Re-upload the application revision to S3
Why it's wrong here
Re-uploading the application revision to S3 is unnecessary because the existing revision has already been downloaded successfully and its install script was executed; the failure occurred during the script's runtime, not during artifact retrieval. A fresh upload of the same code will produce the identical error unless the script itself is corrected first. This action is only relevant if the bundle was corrupted or missing, which is not the case here.
- ✓
SSH into one of the failed instances and run the install script manually to identify the error
Why this is correct
SSHing into a failed instance and manually running the install script is the most direct way to diagnose the failure, because you can reproduce the exact command and see the script's stderr, exit code, missing dependencies, permission errors, or incorrect path assumptions. CodeDeploy lifecycle scripts run under the instance's configured user environment, so executing the same script from the deployment archive directory (for example, /opt/codedeploy-agent/deployment-root/<deployment-id>/.../deployment-archive) exposes the root cause and lets you test a fix locally. This is the standard first step in troubleshooting a failed lifecycle hook.
Go deeper
Related to this question
About these practice questions
This DOP-C02 question is part of Courseiva's 1,298-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.