-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
[lambda] Grant invoke on imported lambda fails #9883
Labels
@aws-cdk/aws-iam
Related to AWS Identity and Access Management
@aws-cdk/aws-lambda
Related to AWS Lambda
bug
This issue is a bug.
p1
Comments
tbartley
added
bug
This issue is a bug.
needs-triage
This issue or PR still needs to be triaged.
labels
Aug 21, 2020
nija-at
added
p1
and removed
needs-triage
This issue or PR still needs to be triaged.
labels
Aug 24, 2020
Ack that this is a regression introduced in
Previously, the code behaviour was to add Ran @skinny85 - can you take a look at this and prepare a fix? |
rix0rrr
added a commit
that referenced
this issue
Aug 25, 2020
We used to erroneously assume that IAM identities imported into the same Stack object (imported Roles specifically) would always belong to the same account as the resources in the stack, and so try to add `Invoke` permissions to the identity policy, which would silently fail. In a recent change, we started recognizing the account of the Role properly and so now we detect that we must actually ALSO add permission to the Lambda itself (resource policies). Unfortunately the Lambda IAM-to-Lambda-Permissions translator had a list of special recognized classes that did not include imported Roles, and so this would fail. Add another case where we try a more generic fallback by parsing the policy principal. This should catch most simple principals that Lambda Permissions supports. Fixes #9883.
mergify bot
pushed a commit
that referenced
this issue
Aug 28, 2020
We used to erroneously assume that IAM identities imported into the same Stack object (imported Roles specifically) would always belong to the same account as the resources in the stack, and so try to add `Invoke` permissions to the identity policy, which would silently fail. In a recent change, we started recognizing the account of the Role properly and so now we detect that we must actually ALSO add permission to the Lambda itself (resource policies). Unfortunately the Lambda IAM-to-Lambda-Permissions translator had a list of special recognized classes that did not include imported Roles, and so this would fail. Add another case where we try a more generic fallback by parsing the policy principal. This should catch most simple principals that Lambda Permissions supports. Fixes #9883. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
@aws-cdk/aws-iam
Related to AWS Identity and Access Management
@aws-cdk/aws-lambda
Related to AWS Lambda
bug
This issue is a bug.
p1
Imported lambda's can no longer be granted permission to invoke a lambda within a stack.
Reproduction Steps
What did you expect to happen?
In 1.59.0 and earlier it succeeded.
What actually happened?
Since 1.60.0 this now fails with error:
Error: Invalid principal type for Lambda permission statement: Import. Supported: AccountPrincipal, ArnPrincipal, ServicePrincipal
.Environment
Other
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: