-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to push to ContainerAssetsRepository when using a trusted account to deploy #30400
Comments
If you bootstrap account A with trust on account B, this means:
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"ecr:PutImage",
"ecr:InitiateLayerUpload",
"ecr:UploadLayerPart",
"ecr:CompleteLayerUpload",
"ecr:BatchCheckLayerAvailability",
"ecr:DescribeRepositories",
"ecr:DescribeImages",
"ecr:BatchGetImage",
"ecr:GetDownloadUrlForLayer"
],
"Resource": "arn:aws:ecr:us-east-1:ACCOUNT_A:repository/cdk-hnb659fds-container-assets-ACCOUNT_A-us-east-1",
"Effect": "Allow"
},
{
"Action": [
"ecr:GetAuthorizationToken"
],
"Resource": "*",
"Effect": "Allow"
}
]
} Can you verify above and see if there's anything missing? |
Looking at your error message, looks like you are trying to push to the staging ecr repo with your current iam principal, instead of the |
In my use case i was doing a cdk deploy on account A, from account B. The DockerImageAsset being build has in the Dockerfile a from clause from account C
I had to add some docker config settings to get it to build the docker image locally:
Does this maybe make the cdk think that it's logged in with the wrong credentials, and using the wrong credentials to push? |
I can confirm that the role with the permission you showed is there in account A, and it has a trust relationship with the root account of account B. So the bootstrap step 1 through 5 is executed as you showed. |
Describe the bug
I've boostrapped my account with the following settings:
I get this error when i'm logged in with my trusted account to deploy a stack
Expected Behavior
I should be able to push an docker image asset to the ContainerAssetsRepository from a trusted account.
Current Behavior
Not supported, error shown
Reproduction Steps
Possible Solution
Can be fixed by adding the trusted account(s) to the ContainerAssetsRepository policy
Additional Information/Context
No response
CDK CLI Version
2.143.0
Framework Version
No response
Node.js Version
20
OS
macos
Language
TypeScript
Language Version
TypeScript (5.4.5)
Other information
No response
The text was updated successfully, but these errors were encountered: