You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cross-account pipeline deploy actions fail with error:
Replication of artifact '<ARTIFACT>' failed: Failed replicating artifact from <BUCKET_A> in <REGION_A> to <BUCKET_B> in <REGION_B>: Check source and destination artifact buckets exist and <PIPELINE_SERVICE_ROLE> has permission to access it.
In Define Key Usage Permissions, under This Account, select the name of the service role for the pipeline (for example, CodePipeline_Service_Role). Under Other AWS accounts, choose Add another AWS account. Enter the account ID for AccountB to complete the ARN, and then choose Next.
This step will generate the following statement in the key's policy:
{
"Sid": "Allow use of the key",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::<CROSS_ACCOUNT>:root"
},
"Action": [
"kms:Encrypt",
"kms:Decrypt",
"kms:ReEncrypt*",
"kms:GenerateDataKey*",
"kms:DescribeKey"
],
"Resource": "*"
}
Is there an existing issue for this?
Describe the bug
Cross-account pipeline deploy actions fail with an error due to missing KMS key resource-based policy permissions for non-admin principals.
Expected Behavior
Cross-region + cross-account deployment actions succeed.
Current Behavior
Cross-account pipeline deploy actions fail with error:
Steps To Reproduce
No response
Possible Solution
After troubleshooting, narrowed down issue to the removal of the following permissions from
DeploymentFrameworkRegionalKMSKey
's "Allow use of the key" statement:CodePipeline cross-account actions need to allow these permissions on the artifact bucket's KMS key resource based policy for general usage. From Create a pipeline in CodePipeline that uses resources from another AWS account - Prerequisite: Create an AWS KMS encryption key, step 6 walks through creating the KMS key using the console:
This step will generate the following statement in the key's policy:
And later under subheading "Configure policies and roles in the account that owns the AWS resource (AccountB)", these permissions are added to the cross-account role. So for key usage, we need the
kms:Encrypt
,kms:GenerateDataKey*
, andkms:ReEncrypt*
added back.Additional Information/Context
No response
ADF Version
4.0.0
Contributing a fix?
Tasks
The text was updated successfully, but these errors were encountered: