DOP-C02 练习题

DOP-C02 题目讲解:发邮件和暂停流水线不是一回事

DOP-C02 练习题讲解。答案 A。要求部署前人工确认,必须有阻塞流水线的审批动作。

DOP-C02 免费试练题 · 考证匠讲解

题目

A company uses AWS CodePipeline to deploy a web application. The pipeline has a source stage that pulls from AWS CodeCommit, a build stage using AWS CodeBuild, and a deploy stage using AWS CodeDeploy. The company wants to add an approval step before deploying to the production environment. The approval must notify the operations team via email and require manual confirmation before proceeding. Which solution meets these requirements?

A. Add a manual approval action in the pipeline stage before the deploy action. Configure an Amazon SNS topic as the notification target and subscribe the operations team's email addresses to the topic.
B. Create an AWS Lambda function that sends an email using Amazon SES. Add an invoke action in the pipeline to call the Lambda function before the deploy action.
C. Configure an Amazon EventBridge rule to detect pipeline state changes. Use the rule to trigger an Amazon SES email to the operations team.
D. Add a test action in the pipeline that uses AWS CodeBuild to run a script that sends an email notification and waits for a response.

答案

答案 A。要求部署前人工确认,必须有阻塞流水线的审批动作。

拆题

  • 要求部署前人工确认,必须有阻塞流水线的审批动作。
  • SNS 负责通知,manual approval action 负责等待批准,职责不同。
  • 订阅邮箱需要确认订阅;审批者还需相应 IAM 权限,收到邮件并不自动拥有批准权。

每个选项为什么对、为什么错

  • A(正确):部署动作之前添加原生人工审批,并连接 SNS 通知,满足通知和阻塞两项。
  • B:Lambda 发送邮件后可以结束,流水线继续前进;没有持久审批状态与批准闸门。
  • C:SES 通知状态变化只能让团队知情,并不让部署等待人工确认。
  • D:CodeBuild 脚本等待邮件需要自建回调、安全校验与超时处理,运营复杂且不如原生审批可靠。

放到具体场景里

教学例子:构建成功后进入 ApproveProduction。运维收到 SNS 邮件,查看 change set、测试结果和发布说明,然后批准。未批准时 DeployProduction 尚未执行;拒绝则流水线停止。本例没有发送真实邮件或执行部署。

检查对象本例条件或动作结果与边界
通知SNS 发送审批提示订阅需确认
闸门Manual approval 等待不能靠发邮件替代
权限审批者 IAM 授权收到通知不等于能批准

遇到同类题的判断顺序

  1. 完成构建:产物通过自动检查。
  2. 进入审批:流水线停在部署之前。
  3. 通知团队:SNS 提供审查入口。
  4. 明确决策:批准继续,拒绝停止。
结论:通知是信息,审批是状态控制。两者必须同时存在。

参考资料

继续练这门考试

同一门考试的免费试练题都附这样的完整讲解,做完再看讲解。