DOP-C02 SDLC Automation Practice Question
A company uses AWS CloudFormation to manage infrastructure. The DevOps team wants to deploy a stack across multiple accounts using AWS CodePipeline. Which approach is BEST for automating cross-account deployments?
⚠ Common exam trap
A common mix-up: candidates confuse AWS CloudFormation StackSets (Option A) as the best automation tool for CI/CD pipelines, but StackSets lack the sequential orchestration, approval gates, and source stage integration that CodePipeline provides for cross-account deployments.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Use a single pipeline in the management account with IAM roles that assume cross-account roles.
AWS CodePipeline can assume an IAM role in the target account (via a cross-account role) to perform CloudFormation deployments. This allows a single pipeline in the management account to automate deployments across multiple accounts without manual triggers or separate pipelines, adhering to the principle of least privilege and centralized control.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use AWS CloudFormation StackSets to deploy the stack across accounts.
Why it's wrong here
AWS CloudFormation StackSets manage stack resources across multiple accounts and Regions, but they are not integrated as a native CodePipeline deployment action. A pipeline can invoke StackSets via a custom action or Lambda, but the question requires a simple single-pipeline pattern; StackSets add complexity and don't natively operate as a deployment stage triggered by the pipeline. They also lack pipeline-level change approval and rollback semantics.
- ✗
Create a separate pipeline in each account and trigger them manually.
Why it's wrong here
Creating a separate pipeline per account and triggering it manually fails the automation requirement and creates duplicated pipeline infrastructure to maintain. Without a central pipeline, you lose consistent delivery logic and introduce per-account drift; manual triggers are also error-prone because a deployment could be missed. A single pipeline in the management account with cross-account role assumption is the standard, repeatable pattern.
- ✓
Use a single pipeline in the management account with IAM roles that assume cross-account roles.
Why this is correct
A single pipeline in the management account leverages CodePipeline's native cross-account support by assuming an IAM role in the target account for the deployment action. The pipeline uses KMS customer-managed keys to encrypt artifacts, and each target account's role restricts the pipeline to deploy only the intended stack. This centralizes visibility and approval while keeping every account's permissions scoped, making it the recommended pattern for multi-account infrastructure delivery.
- ✗
Use an S3 bucket with cross-account access and Lambda to invoke CloudFormation.
Why it's wrong here
The S3-and-Lambda approach is an over-engineered workaround because CodePipeline already provides built-in cross-account deployment via dynamic IAM role assumption. This custom solution requires maintaining Lambda functions, additional S3 bucket policies, and manual KMS/artifact handling, and it bypasses CodePipeline's native stage status and approval tracking. It also introduces more failure modes and doesn't scale as predictably as the first-class pipeline role mechanism.
Go deeper
Related to this question
About these practice questions
This DOP-C02 question is part of Courseiva's 1,298-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This DOP-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DOP-C02 exam.