A developer is configuring a cross-account deployment pipeline in AWS CodePipeline. The pipeline is located in Account A (the tooling account) and must deploy a containerized application to Amazon ECS in Account B (the target account). The pipeline's artifact store is an Amazon S3 bucket in Account A, which is encrypted with an AWS KMS Customer Managed Key (CMK) also located in Account A.
To successfully configure and run this pipeline, the developer needs to set up the necessary cross-account IAM roles, resource policies, and pipeline action settings.
What is the correct chronological sequence of steps required to successfully configure and execute this cross-account deployment?
- 1Create the target deployment IAM role in Account B, specifying a trust policy that allows the CodePipeline service role in Account A to assume it.
- 2Update the KMS key policy and S3 bucket policy in Account A to grant the newly created Account B IAM role permission to retrieve and decrypt the pipeline artifacts.
- 3Modify the pipeline structure in Account A, setting the 'roleArn' parameter of the deploy action to the Account B IAM role ARN.
- 4Start the pipeline execution in Account A, prompting CodePipeline to assume the Account B IAM role and request the artifact from the S3 bucket.
- 5Decrypt the artifact using the Customer Managed Key (CMK) in Account A and update the Amazon ECS service in Account B using the assumed role's credentials.
Cevap
The correct sequence is: first, create the target deployment IAM role in Account B; second, update the KMS key policy and S3 bucket policy in Account A; third, configure the deploy action in the Account A pipeline; fourth, run the pipeline execution; and fifth, decrypt the artifact and deploy to Amazon ECS in Account B.
The correct sequence begins with creating the IAM role in Account B so that its ARN is valid. Then, policies in Account A (S3 and KMS) are updated to reference this ARN. Next, the pipeline deploy action is modified to use this role. Finally, the pipeline is executed, assuming the role, downloading, and decrypting the artifact to complete the deployment.
Adım Adım Çözüm
Anahtar Kavram
Cross-account pipeline deployments with AWS KMS-encrypted artifact stores require strict ordering of IAM role creation, resource policy configuration (KMS and S3), and pipeline definition updates.
Tahmini Süre:3m 0s