-
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
Generated permissions insufficient to deploy to Lambda #5183
Comments
Hey @lennartcl , thanks for opening the issue. What version of the CDK you got this problem with? Thanks, |
@skinny85 I've seen this with versions 16.1 through 17.1. Haven't tried with older versions. |
Can you show the |
The issue seems to be that |
You're correct, I've managed to reproduce the problem. I'll be working on a fix. |
…e bucket and key permissions Previously, we only explicitly granted the CloudFormation CodePipeline action deployment role access to the pipeline bucket (and, by extension, its KMS key) when the action was deploying into a different account. However, that meant in the single account case, if the pipeline had a key defined, the role would never be added to the key's policy, and any deployment requiring access to the artifacts bucket (like a Lambda function) would fail. This fixes the bug by always granting the deployment role permissions to the pipeline bucket (and thus the key as well). Fixes aws#5183
…e bucket and key permissions (#5190) Previously, we only explicitly granted the CloudFormation CodePipeline action deployment role access to the pipeline bucket (and, by extension, its KMS key) when the action was deploying into a different account. However, that meant in the single account case, if the pipeline had a key defined, the role would never be added to the key's policy, and any deployment requiring access to the artifacts bucket (like a Lambda function) would fail. This fixes the bug by always granting the deployment role permissions to the pipeline bucket (and thus the key as well). Fixes #5183
I am running into this issue too. I have a pipeline that manages objects via CloudFormation across multiple accounts in AWS Organizations. When a CloudFormation in subordinate account tries accessing S3 bucket with artifacts, I see the following CloudWatch Log entry.
I had to grant the following S3 bucket permission for cross-account access. I don't like to do it, but that is a solution. Is there another way to permit it? 🤔 I don't like using "Principal": "*" in the statement. {
"Sid": "Allow Access By Anyone in AWS Organization",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": [
"arn:aws:s3:::MYBUCKETNAME/*",
"arn:aws:s3:::MYBUCKETNAME/*/*"
],
"Condition": {
"StringEquals": {
"aws:PrincipalOrgID": "o-MYORGID"
}
}
} |
I'm trying to deploy stack within same account with Version 1.19.0 (build 5597bbe) |
Yep, this fix will be part of version |
Looking very much forward. |
Any news here? |
We have a release happening as we speak, please be patient a little while longer! |
When I try to deploy to Lambda from a pipeline with a
CloudFormationCreateUpdateStackAction
action, the deployment fails due to insufficient permissions.Reproduction Steps
Workaround
Using the following class instead of
CloudFormationCreateUpdateStackAction
will grant the required permissions:Suggested fix
Review adding
grantRead()
toCloudFormationCreateUpdateStackAction
as appropriate.The text was updated successfully, but these errors were encountered: