An organization has a deployment pipeline configured in AWS CodePipeline in Account A. The pipeline needs to deploy a containerized application to Amazon ECS in Account B. The developer creates a cross-account deployment IAM role in Account B. Which configuration must be implemented to allow the pipeline in Account A to assume this role and perform the deployment?
- AAttach an IAM permissions policy to the role in Account B that grants the sts:AssumeRole action to the CodePipeline service role in Account A, while keeping the trust policy of the role restricted to local services in Account B.
- BStore the AWS access keys of an IAM user from Account B as a SecureString parameter in AWS Systems Manager Parameter Store in Account A, and configure CodePipeline to retrieve these credentials at runtime.
- Configure the trust policy of the IAM role in Account B to allow the CodePipeline service role in Account A to perform the sts:AssumeRole action, and configure the deployment action in Account A to use this role ARN.Cevap
- DConfigure the Amazon ECS Task Execution Role in Account B to trust the CodePipeline service role in Account A, enabling the container agent to pull the deployment artifacts directly.
Cevap
Configure the trust policy of the IAM role in Account B to allow the CodePipeline service role in Account A to perform the sts:AssumeRole action, and configure the deployment action in Account A to use this role ARN.
For cross-account deployments, the deployment action in Account A's pipeline must assume an IAM role in Account B. This is achieved by adding a trust policy to the role in Account B that allows the pipeline's service role in Account A to perform the sts:AssumeRole action. The deployment action in the pipeline is then configured to use the ARN of the role in Account B.
Adım Adım Çözüm
Anahtar Kavram
AWS CodePipeline cross-account resource deployment using IAM roles and trust policies.