-
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(lambda): grantInvoke on imported function fails #10622
Conversation
PR #8828 added the ability to add permissions on imported functions, if the account on the stack and imported function matched. However, when this doesn't match, attempting to call `grantInvoke` on the imported function results in a `findChild` error. This change guards against calling `addPermission` when `canCreatePermissions` is false by checking if the `CfnPermission` was actually created, and adjusting the return from `addInvoke` appropriately. fixes #10607
15f2877
to
cff3888
Compare
…t-invoke-imported
Co-authored-by: Niranjan Jayakar <nija@amazon.com>
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
PR #8828 added the ability to add permissions on imported functions, if the
account on the stack and imported function matched. However, when this doesn't
match, attempting to call
grantInvoke
on the imported function results in afindChild
error.This change guards against calling
addPermission
whencanCreatePermissions
is false by checking if the
CfnPermission
was actually created, and adjustingthe return from
addInvoke
appropriately.fixes #10607
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license