Course menuDOP-C02

Exams / DOP-C02 / Multi-account pipelines and deployments / Question 2

DOP-C02 practice question: Multi-account pipelines and deployments (2 of 2)

SDLC Automation A free question from our original DOP-C02 practice exam. Try it, then open the answer to see why each option is right or wrong.

Last verified against current AWS documentation ·How we write our questions

A university runs its student-information system in three accounts: development, test and production. A central tooling account holds the AWS CodePipeline pipeline, and the team deploys CloudFormation stacks into each target account.

The current pipeline uses one service role that has administrator access in every target account, and the security office has rejected it. Each deployment should run under a role that exists only in the account it deploys to, carrying only the permissions that the stack needs.

The team also wants a single pipeline with one approval gate before production, and no copies of the pipeline definition for each account.

Which change meets these requirements?

Choose one answer.

  1. A. Create a deployment role in each target account that trusts the tooling account's pipeline role, and set the role ARN of each cross-account deploy action to the matching target account role.
  2. B. Give the tooling account's pipeline role the AdministratorAccess managed policy, and add that role to a trust list in each target account, so that one role can deploy everywhere with fewer roles to manage.
  3. C. Create three pipelines, one per account, each with its own copy of the template and its own approval gate, and run them in sequence with a Lambda function that starts the next pipeline.
  4. D. Attach a deployment policy to each target account as a service control policy, so that the tooling account's role gains deploy rights in that account without any role being created.
Show the answer and explanation

Answer: A

  • A. Right: Correct. A CodePipeline action can assume a role in another account through its role ARN, and the target role's trust policy names the tooling account. Each target role holds only the permissions its stack needs, and one pipeline keeps the approval gate. Learn more: Create a pipeline in CodePipeline that uses resources from another AWS account (opens in a new tab)
  • B. Wrong: Administrator access is the problem the security office rejected. A shared administrator role also lets any pipeline stage change any account.
  • C. Wrong: This separates the roles, but the team would maintain three definitions and a Lambda chain. The request was for a single pipeline with one approval gate.
  • D. Wrong: Service control policies restrict permissions and do not grant them, so they cannot give the pipeline access. Access still needs a role in the target account that trusts the tooling account. Learn more: Service control policies (SCPs) (opens in a new tab)

Explanation

A cross-account CodePipeline action assumes a role in the target account, so each account keeps its own deployment role. The role's trust policy names only the tooling account, and its permissions cover only what the stack needs. Shared administrator roles and copied pipelines break the security rule or add upkeep, and service control policies restrict access without granting any.

Study

Keep practicing

Answer questions with a score at the end, or practice just this topic with the explanation after each one. No sign-up needed.

Want more on Multi-account pipelines and deployments? The 5 full-length practice sets have 9 more Multi-account pipelines and deployments questions, 375 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets