CodeDeploy deployment failures must be diagnosed using deployment-specific logs and related application logs. CodeDeploy writes detailed logs on the target EC2 instances under /opt/codedeploy-agent/deployment-root/ (for example in logs and deployment-logs subdirectories). These logs include information about lifecycle events (BeforeInstall, AfterInstall, ApplicationStart, etc.), script execution failures, permissions issues, and any exit codes returned by deployment hooks.
Option C correctly points to CodeDeploy agent logs on the EC2 instances as the primary source for root cause analysis. Additionally, application-level logs streamed to Amazon CloudWatch Logs help validate whether the application itself is working correctly after deployment. For complex, multi-tier applications, AWS X-Ray can trace requests end to end, helping determine if issues are caused by downstream dependencies instead of the deployment process.
Options A, B, and D focus on network flow, generic performance, or high-level checks, none of which provide sufficient, deployment-level detail for CodeDeploy. Trusted Advisor and AWS Health do not surface step-by-step deployment log data. Therefore, the combination of CodeDeploy logs on the instances, CloudWatch Logs, and (optionally) X-Ray is the correct troubleshooting approach.
Submit