Skip to content

Commit

Permalink
fix(apigatewayv2-integrations): integrations of imported lambda funct…
Browse files Browse the repository at this point in the history
…ions do not get configured (#27861)

Closes #18965 

`HTTPLambdaIntegration` using imported lambda functions are currently not being configured. This is due to the fact that the `canCreatePermissions` property is set to false in imported lambdas, so the lambda permissions are never created.

This PR fixes this issue by:
- Setting the `sameEnvironment` property to `true` for lambdas imported using `fromFunctionName()`
- Adding clarification in documentation about imported lambdas needing to belong to the same stack account and region as that of the lambda being imported from be able to add permissions
- Adding a new warning to be thrown when the `addPermissions()` function is called on a lambda with `canCreatePermissions` set to false.

The new integ test file tests that imported lambdas using `fromFunctionName()` and `fromFunctionAttributes()` (with `sameEnvironment` set to `true`) work as expected, including on sub-route integrations.

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
sumupitchayan authored Nov 20, 2023
1 parent 15c3955 commit 2c21ea0
Show file tree
Hide file tree
Showing 13 changed files with 36,447 additions and 6 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2c21ea0

Please sign in to comment.