A developer is configuring a continuous delivery pipeline in AWS CodePipeline in Account A () to automate deployments to Account B () using AWS CloudFormation. The pipeline fails during the Deploy stage with an access denied error when attempting to assume the deployment IAM role in Account B. Additionally, the CloudFormation template must retrieve a database password that requires automatic rotation every days. Which combination of actions should the developer take to resolve the deployment failure and meet the security requirements?
- Update the trust policy of the deployment IAM role in Account B to allow the CodePipeline service role of Account A to perform the sts:AssumeRole action. Store the database password in AWS Secrets Manager and configure automatic rotation.Answer
- BUpdate the permissions policy of the deployment IAM role in Account B to allow the CodePipeline service principal to assume the role. Store the database password in Systems Manager Parameter Store and implement custom rotation logic.
- CUpdate the trust policy of the deployment IAM role in Account B to trust the global CodePipeline service principal (codepipeline.amazonaws.com). Store the database password in Systems Manager Parameter Store and enable the parameter rotation policy.
- DUpdate the permissions policy of the CodePipeline service role in Account A to allow trust from Account B. Store the database password in AWS Secrets Manager and configure automatic rotation.
Answer
Update the trust policy of the deployment IAM role in Account B to allow the CodePipeline service role of Account A to perform the sts:AssumeRole action. Store the database password in AWS Secrets Manager and configure automatic rotation.
The correct action is to update the trust policy of the target IAM role in Account B to allow Account A's CodePipeline service role to perform the sts:AssumeRole action, and to store the credentials in AWS Secrets Manager which natively handles automatic rotation. This properly satisfies both cross-account trust requirements and credential lifecycle security rules.
Step-by-Step Solution
Key Concept
Cross-account pipeline deployments and secret rotation management.