A developer is configuring a continuous delivery pipeline using AWS CodePipeline in Account A. The pipeline needs to deploy a serverless application to Account B using AWS CloudFormation. The developer has created a deployment IAM role in Account B with the required permissions to create and manage the application resources. However, when the pipeline runs, the CloudFormation deployment stage fails with an Access Denied error. Which of the following configurations will resolve this issue?
- Update the trust policy of the deployment IAM role in Account B to allow the CodePipeline service role in Account A to assume it, and configure the CloudFormation action in Account A's pipeline to use this cross-account role.Cevap
- BAdd the permissions policy from the deployment IAM role in Account B directly to the CodePipeline service role in Account A, and configure the CloudFormation action to run without specifying a role.
- CGenerate long-lived access keys for an IAM user in Account B, store them as a SecureString parameter in Systems Manager Parameter Store in Account A, and configure the CloudFormation action to retrieve these keys for authentication.
- DManually deploy the CloudFormation stack in Account B's console first to establish resource ownership, and configure the pipeline in Account A to update the existing stack directly.
Cevap
Update the trust policy of the deployment IAM role in Account B to allow the CodePipeline service role in Account A to assume it, and configure the CloudFormation action in Account A's pipeline to use this cross-account role.
The correct option correctly configures cross-account authorization. AWS CodePipeline supports executing actions in another account by assuming a role created in that account. The role in the target account must trust the CodePipeline service role to perform the 'sts:AssumeRole' action, and the pipeline action configuration must specify the target role ARN.
Adım Adım Çözüm
Anahtar Kavram
Cross-account deployments in AWS CodePipeline require configuring IAM trust policies that allow the pipeline service role to assume a target deployment role in the destination account.
Tahmini Süre:1m 30s