An enterprise utilizes a multi-account AWS environment managed via AWS Organizations. A central DevOps team maintains a continuous delivery pipeline in a Tooling account using AWS CodePipeline. The pipeline orchestrates the deployment of a microservices application to Amazon ECS (Fargate) in a separate Production account. The pipeline packages deployment artifacts and writes them to an Amazon S3 bucket in the Tooling account, encrypted using the default AWS-managed KMS key (aws/s3).
During a release, the CodePipeline execution fails at the CodeDeploy stage in the Production account with an Access Denied error when trying to retrieve the deployment package from the Tooling account's S3 bucket. A solutions architect must resolve this issue while maintaining the automated deployment process and enforcing the principle of least privilege.
Which of the following actions should the solutions architect take to resolve the deployment failure?
- Create a customer managed key (CMK) in the Tooling account. Configure the S3 bucket to use this CMK for encryption. Update the CMK key policy in the Tooling account to grant kms:Decrypt and kms:GenerateDataKey permissions to the IAM role assumed by CodeDeploy in the Production account. Configure the S3 bucket policy to allow read access from the Production account's CodeDeploy role.Answer
- BModify the key policy of the existing AWS-managed KMS key (aws/s3) in the Tooling account to grant cross-account kms:Decrypt and kms:GenerateDataKey permissions to the IAM role assumed by CodeDeploy in the Production account. Attach an IAM policy to the CodeDeploy role in the Production account permitting read access to the S3 bucket.
- CAttach a Service Control Policy (SCP) to the Organizational Unit (OU) containing the Production account that explicitly permits kms:Decrypt and kms:GenerateDataKey on the Tooling account's S3 bucket and default AWS-managed key (aws/s3) for the CodeDeploy IAM role.
- DInstruct an operator to manually download the deployment artifacts from the Tooling account S3 bucket, upload them to a local S3 bucket in the Production account, and manually update the CloudFormation stack in the Production account. Then, modify the pipeline to bypass artifact retrieval by disabling CloudFormation drift detection.