Q98 — AWS DOP-C02 Ch.2
Question 98 of 100 | ← Chapter 2
An AWS CodePipeline pipeline has been implemented to automate the code release process. The pipeline integrates with AWS CodeDeploy to deploy versions of the application to multiple Amazon EC2 instances for each CodePipeline stage. During a recent deployment, the pipeline failed due to a CodeDeploy issue. The DevOps team wants enhanced monitoring and notifications during deployments to reduce resolution time. How should a DevOps engineer configure notifications when issues occur?
- A. Implement Amazon CloudWatch Logs for CodePipeline and CodeDeploy, create AWS Config rules to evaluate code deployment issues, and create an Amazon SNS topic to notify stakeholders of deployment issues.
- B. Implement Amazon CloudWatch Events for CodePipeline and CodeDeploy, create an AWS Lambda function to evaluate code deployment issues, and create an Amazon SNS topic to notify stakeholders of deployment issues. ✓
- C. Implement AWS CloudTrail to log CodePipeline and CodeDeploy API calls, create an AWS Lambda function to evaluate code deployment issues, and create an Amazon SNS topic to notify stakeholders of deployment issues.
- D. Implement Amazon CloudWatch Events for CodePipeline and CodeDeploy, create an Amazon Inspector assessment target to evaluate code deployment issues, and create an Amazon SNS topic to notify stakeholders of deployment issues.
Correct Answer: B. Implement Amazon CloudWatch Events for CodePipeline and CodeDeploy, create an AWS Lambda function to evaluate code deployment issues, and create an Amazon SNS topic to notify stakeholders of deployment issues.
Explanation
Option B is the best choice. Reasoning: (1) Real-time monitoring — Amazon CloudWatch Events captures state changes in CodePipeline and CodeDeploy, enabling immediate detection of failures. (2) Automated response — An AWS Lambda function can automatically assess and act on deployment issues, accelerating remediation. (3) Notification — Integration with Amazon SNS ensures timely alerts to stakeholders. Option A lacks real-time event capture (CloudWatch Logs are not event-triggered), leading to delayed responses. Option C relies on CloudTrail, which records API calls for auditing but does not provide real-time failure notifications or automatic remediation. Option D misuses Amazon Inspector, which is designed for security assessments—not deployment status monitoring—and is inefficient for this use case.