Skip to content

Commit 2c21ea0

Browse files
fix(apigatewayv2-integrations): integrations of imported lambda functions 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*
1 parent 15c3955 commit 2c21ea0

File tree

13 files changed

+36447
-6
lines changed

13 files changed

+36447
-6
lines changed

packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/http/integ.add-subroute-integration.js.snapshot/IntegDefaultTestDeployAssert4E6713E1.assets.json

+32
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/http/integ.add-subroute-integration.js.snapshot/IntegDefaultTestDeployAssert4E6713E1.template.json

+298
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)