Courseiva
SDLC AutomationhardMultiple ChoiceObjective-mapped

DOP-C02 SDLC Automation Practice Question

A company has a multi-account AWS environment with separate accounts for development, staging, and production. They want to implement a CI/CD pipeline that deploys to each account sequentially after manual approvals. Which setup allows cross-account deployment with CodePipeline?

⚠ Common exam trap

A common mix-up: candidates confuse CodePipeline's cross-account support with a simple account ID parameter, when in reality it requires explicit IAM role assumption and trust policy configuration.

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

Create an IAM role in the target account with permissions for the pipeline service role to assume, and use that role in the deployment action.

CodePipeline supports cross-account deployments by having the pipeline service role in the source account assume an IAM role in the target account. This role must have a trust policy allowing the pipeline service role to assume it, and the deployment action (e.g., CloudFormation, CodeDeploy) references that target account role. This enables sequential deployment to development, staging, and production accounts with manual approval gates between stages.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Create an IAM role in the target account with permissions for the pipeline service role to assume, and use that role in the deployment action.

    Why this is correct

    Create an IAM role in the target account with a trust policy that allows the CodePipeline service role in the originating account to assume it via sts:AssumeRole. Then configure the deployment action (e.g., ECS, CloudFormation, S3) to use that role's ARN so the pipeline can perform resource operations in the target account without long-lived credentials. This follows least privilege and avoids hard-coding keys, and it is the canonical pattern documented by AWS for cross-account CodePipeline deployments.

  • Create separate pipelines in each account and trigger them via SNS from a master pipeline.

    Why it's wrong here

    Creating separate pipelines in each account and triggering them via SNS fails to provide a single, unified pipeline for sequential deployments and integrated manual approvals across multiple AWS accounts. CodePipeline natively supports cross-account deployments within a *single* pipeline definition, utilising IAM roles to assume permissions in target accounts for artefact deployment and actions. Triggering via SNS is suitable for orchestrating independent, decoupled workflows or fan-out scenarios where multiple pipelines need to start concurrently or asynchronously based on an event, rather than a linear, multi-stage deployment process.

  • Use CodePipeline with cross-account actions by specifying the target account ID and region.

    Why it's wrong here

    CodePipeline does not accept a bare target account ID and region as an action parameter to magically run an action in another account. Actions execute in the account where the pipeline is created, using the pipeline's service role, unless an action explicitly specifies a different IAM role ARN that was created in the target account and trusts the pipeline's role. Merely specifying an account ID would still have the pipeline's role trying to access target resources, which will fail IAM permission checks because the service role has no cross-account grants.

  • Use a single pipeline in the management account with different stages for each account.

    Why it's wrong here

    A single pipeline in the management account cannot deploy sequentially to multiple accounts simply by adding different stages, because every stage executes under the same service role and therefore has the same AWS account context. Stages define ordering and actions; they do not change the permission boundary or the target account for resource deployment. To deploy across accounts, you must either use cross-account roles in actions (as in the correct answer) or maintain separate pipelines per account; otherwise the management account pipeline's role lacks permissions to modify resources in other accounts.

About these practice questions

This DOP-C02 question is part of Courseiva's 251-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 →

How Courseiva writes practice questions · Editorial policy

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.