Skip to content
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

Merged
merged 7 commits into from
Oct 12, 2020

Conversation

njlynch
Copy link
Contributor

@njlynch njlynch commented Oct 1, 2020

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


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@njlynch njlynch requested a review from a team October 1, 2020 11:30
@njlynch njlynch self-assigned this Oct 1, 2020
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Oct 1, 2020
@njlynch njlynch requested a review from nija-at October 5, 2020 14:06
@njlynch njlynch requested a review from rix0rrr October 5, 2020 14:26
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
@njlynch njlynch force-pushed the njlynch/lambda-grant-invoke-imported branch from 15f2877 to cff3888 Compare October 7, 2020 17:54
@nija-at nija-at added the pr/do-not-merge This PR should not be merged at this time. label Oct 8, 2020
njlynch and others added 2 commits October 8, 2020 14:56
Co-authored-by: Niranjan Jayakar <nija@amazon.com>
@njlynch njlynch removed the pr/do-not-merge This PR should not be merged at this time. label Oct 12, 2020
@mergify
Copy link
Contributor

mergify bot commented Oct 12, 2020

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-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-qxepHUsryhcu
  • Commit ID: 02373a2
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify
Copy link
Contributor

mergify bot commented Oct 12, 2020

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[elasticloadbalancingv2] Can't use imported lambda with ELBv2
4 participants