DOP-C02 练习题

DOP-C02 题目讲解:跨账号基础设施用 StackSets 管理

DOP-C02 练习题讲解。答案 A。同一模板要进入 15 个账号并随中央变更更新,问题是部署编排,而不是如何写 VPC。

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

题目

A DevOps engineer needs to deploy identical infrastructure across 15 AWS accounts in an organization. The infrastructure includes VPCs, subnets, security groups, and IAM roles. Changes to the infrastructure must be deployed centrally and propagated to all accounts automatically. Which solution meets these requirements with the LEAST operational overhead?

A. Use AWS CloudFormation StackSets with service-managed permissions. Deploy the stack set from the management account and target the organizational units (OUs) that contain the 15 accounts.
B. Create a CodePipeline that runs 15 parallel deploy stages, each assuming a cross-account IAM role to deploy the CloudFormation template in each account.
C. Use AWS CDK with a multi-account deployment pipeline. Write CDK code that synthesizes templates for each account and deploys using cdk deploy with account-specific profiles.
D. Store the CloudFormation template in an S3 bucket. Create an AWS Lambda function that iterates through each account, assumes a role, and creates or updates the stack.

答案

答案 A。同一模板要进入 15 个账号并随中央变更更新,问题是部署编排,而不是如何写 VPC。

拆题

  • 同一模板要进入 15 个账号并随中央变更更新,问题是部署编排,而不是如何写 VPC。
  • Service-managed permissions 与 Organizations 整合,减少逐账号角色和脚本管理。
  • OU 自动部署需明确启用,区域、排除账号、并发和失败容忍度仍需配置。

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

  • A(正确):StackSets 正是多账号、多区域的模板部署管理器,服务管理权限减少手工角色维护。
  • B:15 个平行流水线能实现,但账号增减、角色与失败重试都要自己维护。
  • C:CDK 便于编写模板,却不自动消除多账号编排成本;逐 profile 部署仍需额外管理。
  • D:Lambda 循环部署要自建状态、重试、并发和回滚,运营工作最多。

放到具体场景里

教学例子:网络基线 StackSet 目标为 Engineering OU 两个 Region。模板更新安全组规则后,服务按配置并发更新各 stack instance;失败账号单独记录。新账号加入 OU 时,只有自动部署已启用且条件满足,才会创建对应栈。

检查对象本例条件或动作结果与边界
模板一个网络基线版本中央审查
目标OU × Region形成 stack instances
执行并发与失败阈值需监控每个实例结果

遇到同类题的判断顺序

  1. 发布模板:审核公共基线变更。
  2. 选择目标:指定 OU、Region 和排除项。
  3. 传播更新:StackSets 受控并发执行。
  4. 核对结果:逐账号确认成功及漂移。
结论:集中提交不等于所有账号已成功,部署状态必须按 stack instance 核对。

参考资料

继续练这门考试

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