DVA-C02 Question 289
Single answerYou are developing a CI/CD pipeline using AWS CodePipeline for your application. The pipeline must include an approval step before deploying to the production environment. The approval process should notify the designated team members via email and allow them to approve or reject the deployment manually. Which of the following options best meets your requirements?
- A
Use an AWS Lambda function to send email notifications and manually trigger the next step in the pipeline via the AWS Management Console.
- B
Add a manual approval action in CodePipeline and configure an Amazon SNS topic to send email notifications to the team.
- C
Include an Amazon SQS queue in the pipeline to collect approvals and trigger the next stage upon receiving an approval message.
- D
Use CloudWatch Events to notify the team and automatically approve the deployment based on predefined conditions.
Show answer and explanation
Correct answer: B
Explanation
Manual approvals in AWS CodePipeline are best implemented using the built-in manual approval action. This action allows you to pause the pipeline and wait for an approval or rejection. By integrating with Amazon SNS, you can notify stakeholders via email about the approval request and provide them with the ability to approve or reject the deployment. This method leverages AWS services effectively and aligns with best practices for CI/CD pipelines.
- A. Incorrect.
This approach requires a lot of custom coding and manual intervention to trigger the next step. While it could work, it is not the best practice for implementing an approval step in CodePipeline.
- B. Correct.
This is the correct answer. CodePipeline provides a native manual approval action that integrates seamlessly with other AWS services like Amazon SNS to send notifications. Team members can approve or reject the deployment from the CodePipeline console or via the email notification.
- C. Incorrect.
Amazon SQS is not designed for approval workflows in CodePipeline. Using SQS would require additional custom logic and is not a standard or recommended approach for this use case.
- D. Incorrect.
CloudWatch Events can notify the team, but it does not provide functionality for manual approvals. Additionally, automatically approving a deployment defeats the purpose of having a manual approval step.