AWS › AWS CodePipeline, CodeBuild & CodeDeploy (CI/CD)
How can you design a multi account CI/CD pipeline using CodePipeline that deploys the exact same build to separate development, staging, and production AWS accounts?
AdvancedAnswer
A multi account pipeline typically builds the application artifact once in a central tooling account, then uses cross account IAM roles to grant CodePipeline and CodeDeploy permission to deploy that exact same artifact into separate development, staging, and production accounts, ensuring the identical, already tested build is what actually reaches production, rather than risking subtle differences from rebuilding the application separately for each environment.
aws sts assume-role --role-arn arn:aws:iam::PRODUCTION_ACCOUNT_ID:role/CrossAccountDeployRole --role-session-name pipeline-deployReal-world example A financial services company builds its application artifact once in a shared tooling account, then uses cross account roles configured in CodePipeline to deploy that identical artifact first to a staging account for validation and finally to a completely separate production account, guaranteeing consistency across environments.