Skip to content

Commit 0fc33d9

Browse files
fix(custom-resources): incorrect sdkv3 fallback (#26693)
Fixes logic within the aws-sdk-v3-handler for AwsCustomResource to behave more like the v2 handler, in so much as if `installLatestSdk` fails, but it can still require the package it was attempting to install, it will continue. This makes the runtime more friendly to deploying your constructs across regions that may or may not have access to npm within the lambda runtime. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 42250f1 commit 0fc33d9

File tree

168 files changed

+42122
-45315
lines changed

Some content is hidden

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

168 files changed

+42122
-45315
lines changed
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"version":"31.0.0"}
1+
{"version":"33.0.0"}

packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.cors.js.snapshot/cors-twitch-test.assets.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "31.0.0",
2+
"version": "33.0.0",
33
"files": {
44
"c7bba0d9d477c86c6dc2adb0eb95842634a1c040dd3a66b42eec2bb604644d4f": {
55
"source": {
@@ -14,15 +14,15 @@
1414
}
1515
}
1616
},
17-
"eec545187c8ac2e517efd9fbf2f13eb327409c8aea5ab3f76dd09184a47a37f6": {
17+
"d6fea47c1f0462158dff41f11b88b1cc5a13df20fda1d39aa230bae47a50ae63": {
1818
"source": {
1919
"path": "cors-twitch-test.template.json",
2020
"packaging": "file"
2121
},
2222
"destinations": {
2323
"current_account-current_region": {
2424
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
25-
"objectKey": "eec545187c8ac2e517efd9fbf2f13eb327409c8aea5ab3f76dd09184a47a37f6.json",
25+
"objectKey": "d6fea47c1f0462158dff41f11b88b1cc5a13df20fda1d39aa230bae47a50ae63.json",
2626
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
2727
}
2828
}

packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.cors.js.snapshot/cors-twitch-test.template.json

+35-35
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@
5858
"corsapitestDeployment2BF1633Adc24ac182461aecc920a8724663ce2a1": {
5959
"Type": "AWS::ApiGateway::Deployment",
6060
"Properties": {
61+
"Description": "Automatically created by the RestApi construct",
6162
"RestApiId": {
6263
"Ref": "corsapitest8682546E"
63-
},
64-
"Description": "Automatically created by the RestApi construct"
64+
}
6565
},
6666
"DependsOn": [
6767
"corsapitesttwitchDELETEB4C94228",
@@ -74,12 +74,12 @@
7474
"corsapitestDeploymentStageprod8F31F2AB": {
7575
"Type": "AWS::ApiGateway::Stage",
7676
"Properties": {
77-
"RestApiId": {
78-
"Ref": "corsapitest8682546E"
79-
},
8077
"DeploymentId": {
8178
"Ref": "corsapitestDeployment2BF1633Adc24ac182461aecc920a8724663ce2a1"
8279
},
80+
"RestApiId": {
81+
"Ref": "corsapitest8682546E"
82+
},
8383
"StageName": "prod"
8484
},
8585
"DependsOn": [
@@ -182,14 +182,8 @@
182182
"corsapitesttwitchGET4270341B": {
183183
"Type": "AWS::ApiGateway::Method",
184184
"Properties": {
185-
"HttpMethod": "GET",
186-
"ResourceId": {
187-
"Ref": "corsapitesttwitch0E3D1559"
188-
},
189-
"RestApiId": {
190-
"Ref": "corsapitest8682546E"
191-
},
192185
"AuthorizationType": "NONE",
186+
"HttpMethod": "GET",
193187
"Integration": {
194188
"IntegrationHttpMethod": "POST",
195189
"Type": "AWS_PROXY",
@@ -216,6 +210,12 @@
216210
]
217211
]
218212
}
213+
},
214+
"ResourceId": {
215+
"Ref": "corsapitesttwitch0E3D1559"
216+
},
217+
"RestApiId": {
218+
"Ref": "corsapitest8682546E"
219219
}
220220
}
221221
},
@@ -300,14 +300,8 @@
300300
"corsapitesttwitchPOSTB52CFB02": {
301301
"Type": "AWS::ApiGateway::Method",
302302
"Properties": {
303-
"HttpMethod": "POST",
304-
"ResourceId": {
305-
"Ref": "corsapitesttwitch0E3D1559"
306-
},
307-
"RestApiId": {
308-
"Ref": "corsapitest8682546E"
309-
},
310303
"AuthorizationType": "NONE",
304+
"HttpMethod": "POST",
311305
"Integration": {
312306
"IntegrationHttpMethod": "POST",
313307
"Type": "AWS_PROXY",
@@ -334,6 +328,12 @@
334328
]
335329
]
336330
}
331+
},
332+
"ResourceId": {
333+
"Ref": "corsapitesttwitch0E3D1559"
334+
},
335+
"RestApiId": {
336+
"Ref": "corsapitest8682546E"
337337
}
338338
}
339339
},
@@ -418,14 +418,8 @@
418418
"corsapitesttwitchDELETEB4C94228": {
419419
"Type": "AWS::ApiGateway::Method",
420420
"Properties": {
421-
"HttpMethod": "DELETE",
422-
"ResourceId": {
423-
"Ref": "corsapitesttwitch0E3D1559"
424-
},
425-
"RestApiId": {
426-
"Ref": "corsapitest8682546E"
427-
},
428421
"AuthorizationType": "NONE",
422+
"HttpMethod": "DELETE",
429423
"Integration": {
430424
"IntegrationHttpMethod": "POST",
431425
"Type": "AWS_PROXY",
@@ -452,21 +446,21 @@
452446
]
453447
]
454448
}
449+
},
450+
"ResourceId": {
451+
"Ref": "corsapitesttwitch0E3D1559"
452+
},
453+
"RestApiId": {
454+
"Ref": "corsapitest8682546E"
455455
}
456456
}
457457
},
458458
"corsapitesttwitchOPTIONSE5EEB527": {
459459
"Type": "AWS::ApiGateway::Method",
460460
"Properties": {
461-
"HttpMethod": "OPTIONS",
462-
"ResourceId": {
463-
"Ref": "corsapitesttwitch0E3D1559"
464-
},
465-
"RestApiId": {
466-
"Ref": "corsapitest8682546E"
467-
},
468461
"ApiKeyRequired": false,
469462
"AuthorizationType": "NONE",
463+
"HttpMethod": "OPTIONS",
470464
"Integration": {
471465
"IntegrationResponses": [
472466
{
@@ -497,7 +491,13 @@
497491
},
498492
"StatusCode": "204"
499493
}
500-
]
494+
],
495+
"ResourceId": {
496+
"Ref": "corsapitesttwitch0E3D1559"
497+
},
498+
"RestApiId": {
499+
"Ref": "corsapitest8682546E"
500+
}
501501
}
502502
},
503503
"handlerServiceRole187D5A5A": {
@@ -540,13 +540,13 @@
540540
},
541541
"S3Key": "c7bba0d9d477c86c6dc2adb0eb95842634a1c040dd3a66b42eec2bb604644d4f.zip"
542542
},
543+
"Handler": "index.handler",
543544
"Role": {
544545
"Fn::GetAtt": [
545546
"handlerServiceRole187D5A5A",
546547
"Arn"
547548
]
548549
},
549-
"Handler": "index.handler",
550550
"Runtime": "nodejs14.x"
551551
},
552552
"DependsOn": [

packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.cors.js.snapshot/corsDefaultTestDeployAssert5CF8F851.assets.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "31.0.0",
2+
"version": "33.0.0",
33
"files": {
44
"21fbb51d7b23f6a6c262b46a9caee79d744a3ac019fd45422d988b96d44b2a22": {
55
"source": {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "31.0.0",
2+
"version": "33.0.0",
33
"testCases": {
44
"cors/DefaultTest": {
55
"stacks": [

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "31.0.0",
2+
"version": "33.0.0",
33
"artifacts": {
44
"cors-twitch-test.assets": {
55
"type": "cdk:asset-manifest",
@@ -17,7 +17,7 @@
1717
"validateOnSynth": false,
1818
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
1919
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
20-
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/eec545187c8ac2e517efd9fbf2f13eb327409c8aea5ab3f76dd09184a47a37f6.json",
20+
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/d6fea47c1f0462158dff41f11b88b1cc5a13df20fda1d39aa230bae47a50ae63.json",
2121
"requiresBootstrapStackVersion": 6,
2222
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
2323
"additionalDependencies": [
@@ -54,7 +54,7 @@
5454
"/cors-twitch-test/cors-api-test/Deployment/Resource": [
5555
{
5656
"type": "aws:cdk:logicalId",
57-
"data": "corsapitestDeployment2BF1633Aec735238f184cf252b8c47cd8212eacb"
57+
"data": "corsapitestDeployment2BF1633Adc24ac182461aecc920a8724663ce2a1"
5858
}
5959
],
6060
"/cors-twitch-test/cors-api-test/DeploymentStage.prod/Resource": [
@@ -159,10 +159,10 @@
159159
"data": "CheckBootstrapVersion"
160160
}
161161
],
162-
"corsapitestDeployment2BF1633A51392cbce1ac2785bd0e53063423e203": [
162+
"corsapitestDeployment2BF1633Aec735238f184cf252b8c47cd8212eacb": [
163163
{
164164
"type": "aws:cdk:logicalId",
165-
"data": "corsapitestDeployment2BF1633A51392cbce1ac2785bd0e53063423e203",
165+
"data": "corsapitestDeployment2BF1633Aec735238f184cf252b8c47cd8212eacb",
166166
"trace": [
167167
"!!DESTRUCTIVE_CHANGES: WILL_DESTROY"
168168
]

0 commit comments

Comments
 (0)