-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(lambda): grantInvoke fails for imported IAM identities (#9957)
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*
- Loading branch information
Showing
2 changed files
with
87 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters