-
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
fix(iam): cannot grant lambda:InvokeFunction on ManagedPolicy or Policy via grantInvoke()
method
#32984
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #32984 +/- ##
=======================================
Coverage 82.20% 82.20%
=======================================
Files 119 119
Lines 6862 6862
Branches 1158 1158
=======================================
Hits 5641 5641
Misses 1118 1118
Partials 103 103
Flags with carried forward coverage won't be shown. Click here to find out more.
|
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
1 similar comment
This PR cannot be merged because it has conflicts. Please resolve them. The PR will be considered stale and closed if it remains in an unmergeable state. |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Issue # (if applicable)
Closes #32980.
Reason for this change
lambda.Function.grantInvoke()
throws an error when aManagedPolicy
or aPolicy
is passed.It should add a policy statement to grant
lambda:InvokeFunction
on the policy document.Description of changes
Implement
IPrincipal
directly onManagedPolicy
andPolicy
likeGroup
.policyFragment
returns a dummy policy fragment andPolicyStatment
throws an error when aManagedPolicy
or aPolicy
is specified asprincipal
ornotPrincipal
.Describe any new or updated permissions being added
N/A
Description of how you validated changes
Updated unit tests and integ tests to confirm
grantInvoke()
works.Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license