Skip to content

Commit 1062ca3

Browse files
committed
fix(apigateway): consolidate lambda permissions when reused for multiple operations
The maximum Lambda permission policy size could be exceeded for APIs which reused the same Lambda function for multiple operations, as the integration added a new permission for each operation, scoped down to the specific operation. This change updates both the REST and HTTP API lambda integrations to consolidate permissions when more than 10 permissions would be added for the same handler, creating a permission scoped to the entire API rather than the operation. The behaviour remains the same where individual lambdas are used for operations. Fixes #9327 Fixes #19535
1 parent effa46d commit 1062ca3

File tree

189 files changed

+107350
-33927
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

189 files changed

+107350
-33927
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/authorizers/integ.api-with-authorizer-and-proxy.js.snapshot/apigatewaywithauthorizerandproxyDefaultTestDeployAssertDBEA1774.assets.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/authorizers/integ.api-with-authorizer-and-proxy.js.snapshot/cdk.out

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/authorizers/integ.api-with-authorizer-and-proxy.js.snapshot/integ.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/authorizers/integ.api-with-authorizer-and-proxy.js.snapshot/integtest-restapi-with-authorizer-and-proxy.assets.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/authorizers/integ.api-with-authorizer-and-proxy.js.snapshot/integtest-restapi-with-authorizer-and-proxy.template.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@
251251
}
252252
}
253253
},
254-
"ActionsApiGatewayInitiateActionproxyANYApiPermissionintegtestrestapiwithauthorizerandproxyActionsApiGatewayB7F13065ANYInitiateActionproxy1FB876EB": {
254+
"ActionsApiGatewayInitiateActionproxyANYApiPermissionintegtestrestapiwithauthorizerandproxylambdas39072AD1BintegtestrestapiwithauthorizerandproxyActionsApiGatewayB7F13065ANYInitiateActionproxyFD3F1D84": {
255255
"Type": "AWS::Lambda::Permission",
256256
"Properties": {
257257
"Action": "lambda:InvokeFunction",
@@ -292,7 +292,7 @@
292292
}
293293
}
294294
},
295-
"ActionsApiGatewayInitiateActionproxyANYApiPermissionTestintegtestrestapiwithauthorizerandproxyActionsApiGatewayB7F13065ANYInitiateActionproxyD05DD0B4": {
295+
"ActionsApiGatewayInitiateActionproxyANYApiPermissionTestintegtestrestapiwithauthorizerandproxylambdas39072AD1BintegtestrestapiwithauthorizerandproxyActionsApiGatewayB7F13065ANYInitiateActionproxy6828870D": {
296296
"Type": "AWS::Lambda::Permission",
297297
"Properties": {
298298
"Action": "lambda:InvokeFunction",

packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/authorizers/integ.api-with-authorizer-and-proxy.js.snapshot/manifest.json

Lines changed: 503 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/authorizers/integ.api-with-authorizer-and-proxy.js.snapshot/tree.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.cors-allow-multiple-origins.js.snapshot/manifest.json

Lines changed: 23 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.cors-allow-multiple-origins.js.snapshot/stack-cors-allow-multiple-origins.assets.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.cors-allow-multiple-origins.js.snapshot/stack-cors-allow-multiple-origins.template.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@
144144
}
145145
}
146146
},
147-
"corsapitestmyresourceGETApiPermissionstackcorsallowmultipleoriginscorsapitestC473FAE8GETmyresourceB82B6C26": {
147+
"corsapitestmyresourceGETApiPermissionstackcorsallowmultipleoriginshandler2A0F4220stackcorsallowmultipleoriginscorsapitestC473FAE8GETmyresource4F8A5431": {
148148
"Type": "AWS::Lambda::Permission",
149149
"Properties": {
150150
"Action": "lambda:InvokeFunction",
@@ -185,7 +185,7 @@
185185
}
186186
}
187187
},
188-
"corsapitestmyresourceGETApiPermissionTeststackcorsallowmultipleoriginscorsapitestC473FAE8GETmyresource29B41ABB": {
188+
"corsapitestmyresourceGETApiPermissionTeststackcorsallowmultipleoriginshandler2A0F4220stackcorsallowmultipleoriginscorsapitestC473FAE8GETmyresourceC1EC759B": {
189189
"Type": "AWS::Lambda::Permission",
190190
"Properties": {
191191
"Action": "lambda:InvokeFunction",

0 commit comments

Comments
 (0)