fix(apigatewayv2-integrations): in case of multiple routes, only one execute permission is created#18716
Conversation
…execute permission is created
|
Will this work for |
No, this is specific to |
kaizencc
left a comment
There was a problem hiding this comment.
Looks good. I think it is a good call out that we should check and at least test for similar behavior in websocket integrations as well
|
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). |
…execute permission is created (aws#18716) When multiple routes are defined for a single lambda integration, only one of the routes gets permission to execute the function. This is because the permissions are added when the integration is bound to the route, which happens only once per integration. Split the `_bindToRoute` workflow into two parts: 1. The actual bind, followed by the creation of an `HttpIntegration`. We keep doing this only once per integration. 2. A post-bind step, that happens for every route. In the case of `HttpLambdaIntegration`, adding the permission has been moved to the post bind step. All other integrations remain the same. Fixes aws#18201. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
When multiple routes are defined for a single lambda integration, only one of
the routes gets permission to execute the function. This is because the
permissions are added when the integration is bound to the route, which happens
only once per integration.
Split the
_bindToRouteworkflow into two parts:HttpIntegration. We keepdoing this only once per integration.
In the case of
HttpLambdaIntegration, adding the permission has been moved tothe post bind step. All other integrations remain the same.
Fixes #18201.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license