DVA-C02 Deployment Practice Question
A company uses AWS CodeDeploy to deploy a web application to an Auto Scaling group of Amazon EC2 instances. The deployment fails with the error 'The overall deployment failed because too many individual instances failed deployment, too few healthy instances are available for deployment, or some instances in your deployment group are experiencing problems.' The developer needs to identify the root cause. Which AWS service should the developer use to view detailed error logs from the failed deployment?
⚠ Common exam trap
Watch out — candidates often assume the CodeDeploy console provides detailed error logs, but it only shows aggregated failure counts and high-level messages, while the actual root cause is buried in the agent logs on the EC2 instances or in CloudWatch Logs if configured.
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
✓
Amazon CloudWatch Logs (if configured) or the CodeDeploy agent log files on the EC2 instances
When a CodeDeploy deployment fails due to instance-level errors, the most direct way to investigate is to examine the CodeDeploy agent logs located on each EC2 instance at `/opt/codedeploy-agent/deployment-root/deployment-logs/codedeploy-agent.log`. If Amazon CloudWatch Logs has been configured to stream these logs, you can also view them centrally in the CloudWatch console. These logs contain detailed error messages from the `codedeploy-agent` process, including script failures, permission issues, or missing dependencies that caused the deployment to fail.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Amazon CloudWatch Logs (if configured) or the CodeDeploy agent log files on the EC2 instances
Why this is correct
The CodeDeploy agent, which runs on the target EC2 instances, generates detailed logs for every step of the deployment process, including lifecycle hook script execution and file transfers. These logs are stored locally on the instance (e.g., /var/log/aws/codedeploy-agent/codedeploy-agent.log on Linux) and provide the most granular information for troubleshooting. If configured, the agent can stream these logs to Amazon CloudWatch Logs, offering a centralized and easily accessible location for analysis without requiring direct SSH access to each instance.
- ✗
AWS X-Ray
Why it's wrong here
AWS X-Ray is a service designed for distributed tracing, enabling developers to analyze and debug production applications by visualizing requests as they flow through various components. It provides insights into application performance, latency, and service maps, but it does not capture or store the operational logs generated by the CodeDeploy agent during the deployment process itself. Therefore, X-Ray is not suitable for troubleshooting CodeDeploy agent-level errors or script failures.
- ✗
AWS CloudTrail
Why it's wrong here
AWS CloudTrail records API calls made to AWS services, providing a log of actions performed within your AWS account for governance, compliance, and auditing purposes. While CloudTrail will show API calls related to CodeDeploy (e.g., `CreateDeployment`, `GetDeployment`), it only logs the initiation or status changes of a deployment at the service level. It does not provide the detailed, agent-level logs that describe the execution of deployment scripts, file transfers, or specific errors encountered by the CodeDeploy agent on the target EC2 instances.
- ✗
AWS CodeDeploy console
Why it's wrong here
The AWS CodeDeploy console offers a high-level overview of deployment status, indicating whether a deployment succeeded or failed and which lifecycle events completed or encountered issues. While it provides a summary and aggregated status, it does not display the raw, detailed log output generated by the CodeDeploy agent on individual EC2 instances. To diagnose specific script failures, permission errors, or other agent-level problems, direct access to the agent's local log files or their centralized stream in CloudWatch Logs is essential.
Go deeper
Related to this question
About these practice questions
One of 724 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.