‹ All DOP-C02 questions

DOP-C02 Practice Question 2: Cross Account Pipeline Artifacts

AWS Certified DevOps Engineer – Professional (DOP-C02) · Test 1 · question 2 of 10

SDLC Automationhard

A central Tooling account hosts an AWS CodePipeline pipeline that must deploy into separate Dev, Staging, and Production accounts in the same AWS Organization. An engineer adds a CodeDeploy deploy action pointing at the Production account's application and sets the action's roleArn to a role in that account. The action fails immediately, and the CodeDeploy service in Production reports that it cannot read the input artifact from the pipeline's Amazon S3 artifact bucket.

Which combination of changes will make the cross-account action work?

Select one answer
Show answer and explanation

Answer:

  • B. Encrypt the artifact bucket with a customer managed AWS KMS key in the Tooling account, grant the Production account and its roles usage of that key, add a bucket policy allowing the Production account to read the artifacts, and let the pipeline service role assume the Production cross-account role

Cross-account CodePipeline actions have a specific and non-obvious prerequisite: the artifact bucket must be encrypted with a customer managed AWS KMS key rather than the default AWS managed key for S3. An AWS managed key's policy cannot be edited, so a principal in another account can never be granted kms:Decrypt on it; the artifact download fails at decryption even if the S3 bucket policy is perfect. The complete working set is exactly the four pieces in option B: a customer managed key whose key policy grants the pipeline service role and the target account usage; a bucket policy granting the target account s3:GetObject/s3:ListBucket (and s3:PutObject if that account produces output artifacts); an sts:AssumeRole permission on the pipeline service role for the target account's role; and a trust policy on that target role that trusts the pipeline service role. The action then declares the target role in its roleArn.

Option A does not help. Relocating the bucket does not change the fact that the default S3 managed key cannot be shared across accounts, and CodePipeline expects its artifact store in the pipeline's own account and Region. It also breaks Dev and Staging, which read from the same store.

Option C is a permissions non-answer. AWSCodePipelineFullAccess grants CodePipeline API permissions in the *Production* account, not access to the Tooling account's bucket or key; resource policies in the owning account still gate that. Cross-Region Replication copies objects to a different bucket, so the pipeline action would still be reading the original artifact location, and the copies would arrive too late to be useful mid-execution.

Option D confuses artifact stores with image registries. CodePipeline's artifact store is always S3; there is no ECR-backed artifact store, and RAM does not share ECR repositories in the way described. Container images are a payload the pipeline may reference, not a replacement for the artifact bucket.

Reference: Create a pipeline in CodePipeline that uses resources from another AWS account

Practice Test 1 ›

Study guides for DOP-C02

AWS Service Control Policies Explained: SCPs and DenialsAWS service control policies explained: how SCPs cap permissions, why admins still get access denied, inheritance, deny vs allow lists and the exam traps.
How AI Is Changing Software Jobs: Where to PrepareHow AI is changing software jobs: what history shows, the evidence on junior developers, what Klarna learned, new AI roles and five domains to prepare for.
How AWS Certification Exams Work: Scoring and RenewalHow AWS certification exams work: levels, booking, question types, unscored questions, scaled scores, pass marks, validity and how recertification works.
What Is Amazon RDS? Multi-AZ, Read Replicas and BackupsWhat is Amazon RDS? Engines, Multi-AZ, read replicas, backups, RDS Proxy, Aurora and pricing explained, with the traps that AWS exams set around each one.
Best DevOps certification: AWS, Azure, Google or CKAThe best DevOps certification for your stack: AWS DOP-C02, Azure AZ-400, Google Cloud DevOps Engineer and CKA compared on cost, level and prerequisites.
What Is AWS Lambda? Triggers, Concurrency and Cold StartsWhat is AWS Lambda? How functions run, cold starts, triggers vs event source mappings, concurrency, layers, aliases, pricing and the exam traps.
AWS CloudOps Engineer Associate (SOA-C03) exam guideAWS Certified CloudOps Engineer – Associate (SOA-C03) replaced SysOps Administrator. Format, cost, the five domains, what changed and how to prepare.
Which AWS certification should you get? 2026 roadmapWhich AWS certification to get first, by role and experience, with each exam's status in October 2026, what is changing, and prices in USD and INR.
What Is Amazon EC2? Instances, AMIs, EBS and Auto ScalingAmazon EC2 explained: instances, AMIs, instance types, security groups, EBS, Auto Scaling groups and pricing options, with the traps AWS exams set.
SQS vs SNS vs EventBridge on AWSWhen to use an SQS queue, an SNS topic or an EventBridge bus, plus fan-out, FIFO ordering, visibility timeouts and dead-letter queues for AWS exams.