Skip to content

Commit 6f7c4b5

Browse files
feat: upgrade default CR runtime version (#24916)
Adds a regional fact for the default custom resource NodeJS runtime version. Currently for 'aws' and 'aws-cn' partitions uses NodeJS 16.x and NodeJS 14.x for all other partitions. This should allow continued usage of our custom resources in gov cloud and other non-commercial regions while avoiding usage of Node14 which is EOL for others. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent d82c6c9 commit 6f7c4b5

File tree

826 files changed

+43900
-29718
lines changed

Some content is hidden

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

826 files changed

+43900
-29718
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-appsync/test/integ.js-resolver.js.snapshot/AppSyncJsResolverTestStack.assets.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
{
2-
"version": "22.0.0",
2+
"version": "31.0.0",
33
"files": {
4-
"d01c24641c7d8cb6488393ffceaefff282370a9a522bf9d77b21da73fa257347": {
4+
"0f8a80f5f2310ea7e3295258fdbb79c43a1e8c0a11e863e63dc82832599412ed": {
55
"source": {
6-
"path": "asset.d01c24641c7d8cb6488393ffceaefff282370a9a522bf9d77b21da73fa257347",
6+
"path": "asset.0f8a80f5f2310ea7e3295258fdbb79c43a1e8c0a11e863e63dc82832599412ed",
77
"packaging": "zip"
88
},
99
"destinations": {
1010
"current_account-current_region": {
1111
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
12-
"objectKey": "d01c24641c7d8cb6488393ffceaefff282370a9a522bf9d77b21da73fa257347.zip",
12+
"objectKey": "0f8a80f5f2310ea7e3295258fdbb79c43a1e8c0a11e863e63dc82832599412ed.zip",
1313
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
1414
}
1515
}
@@ -53,15 +53,15 @@
5353
}
5454
}
5555
},
56-
"e8854d9a08f981fd59e6f71b86e4266fb80f578b9f7edd5cce794f4f302404e7": {
56+
"adfc8884e4696d3a232b75a5ab048eabde442e5d8423bfdce883546a8b969111": {
5757
"source": {
5858
"path": "AppSyncJsResolverTestStack.template.json",
5959
"packaging": "file"
6060
},
6161
"destinations": {
6262
"current_account-current_region": {
6363
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
64-
"objectKey": "e8854d9a08f981fd59e6f71b86e4266fb80f578b9f7edd5cce794f4f302404e7.json",
64+
"objectKey": "adfc8884e4696d3a232b75a5ab048eabde442e5d8423bfdce883546a8b969111.json",
6565
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
6666
}
6767
}

packages/@aws-cdk-testing/framework-integ/test/aws-appsync/test/integ.js-resolver.js.snapshot/AppSyncJsResolverTestStack.template.json

+113-2
Original file line numberDiff line numberDiff line change
@@ -271,12 +271,20 @@
271271
"Type": "AWS::Lambda::Function",
272272
"Properties": {
273273
"Handler": "index.handler",
274-
"Runtime": "nodejs14.x",
274+
"Runtime": {
275+
"Fn::FindInMap": [
276+
"DefaultCrNodeVersionMap",
277+
{
278+
"Ref": "AWS::Region"
279+
},
280+
"value"
281+
]
282+
},
275283
"Code": {
276284
"S3Bucket": {
277285
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
278286
},
279-
"S3Key": "d01c24641c7d8cb6488393ffceaefff282370a9a522bf9d77b21da73fa257347.zip"
287+
"S3Key": "0f8a80f5f2310ea7e3295258fdbb79c43a1e8c0a11e863e63dc82832599412ed.zip"
280288
},
281289
"Role": {
282290
"Fn::GetAtt": [
@@ -401,6 +409,109 @@
401409
]
402410
}
403411
},
412+
"Mappings": {
413+
"DefaultCrNodeVersionMap": {
414+
"af-south-1": {
415+
"value": "nodejs16.x"
416+
},
417+
"ap-east-1": {
418+
"value": "nodejs16.x"
419+
},
420+
"ap-northeast-1": {
421+
"value": "nodejs16.x"
422+
},
423+
"ap-northeast-2": {
424+
"value": "nodejs16.x"
425+
},
426+
"ap-northeast-3": {
427+
"value": "nodejs16.x"
428+
},
429+
"ap-south-1": {
430+
"value": "nodejs16.x"
431+
},
432+
"ap-south-2": {
433+
"value": "nodejs16.x"
434+
},
435+
"ap-southeast-1": {
436+
"value": "nodejs16.x"
437+
},
438+
"ap-southeast-2": {
439+
"value": "nodejs16.x"
440+
},
441+
"ap-southeast-3": {
442+
"value": "nodejs16.x"
443+
},
444+
"ca-central-1": {
445+
"value": "nodejs16.x"
446+
},
447+
"cn-north-1": {
448+
"value": "nodejs16.x"
449+
},
450+
"cn-northwest-1": {
451+
"value": "nodejs16.x"
452+
},
453+
"eu-central-1": {
454+
"value": "nodejs16.x"
455+
},
456+
"eu-central-2": {
457+
"value": "nodejs16.x"
458+
},
459+
"eu-north-1": {
460+
"value": "nodejs16.x"
461+
},
462+
"eu-south-1": {
463+
"value": "nodejs16.x"
464+
},
465+
"eu-south-2": {
466+
"value": "nodejs16.x"
467+
},
468+
"eu-west-1": {
469+
"value": "nodejs16.x"
470+
},
471+
"eu-west-2": {
472+
"value": "nodejs16.x"
473+
},
474+
"eu-west-3": {
475+
"value": "nodejs16.x"
476+
},
477+
"me-central-1": {
478+
"value": "nodejs16.x"
479+
},
480+
"me-south-1": {
481+
"value": "nodejs16.x"
482+
},
483+
"sa-east-1": {
484+
"value": "nodejs16.x"
485+
},
486+
"us-east-1": {
487+
"value": "nodejs16.x"
488+
},
489+
"us-east-2": {
490+
"value": "nodejs16.x"
491+
},
492+
"us-gov-east-1": {
493+
"value": "nodejs16.x"
494+
},
495+
"us-gov-west-1": {
496+
"value": "nodejs16.x"
497+
},
498+
"us-iso-east-1": {
499+
"value": "nodejs14.x"
500+
},
501+
"us-iso-west-1": {
502+
"value": "nodejs14.x"
503+
},
504+
"us-isob-east-1": {
505+
"value": "nodejs14.x"
506+
},
507+
"us-west-1": {
508+
"value": "nodejs16.x"
509+
},
510+
"us-west-2": {
511+
"value": "nodejs16.x"
512+
}
513+
}
514+
},
404515
"Outputs": {
405516
"ExportsOutputRefInvokeApi313C8B4949AC2AFC": {
406517
"Value": {

packages/@aws-cdk-testing/framework-integ/test/aws-appsync/test/integ.js-resolver.js.snapshot/JsResolverIntegTestDefaultTestDeployAssert57AD8D20.assets.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
{
2-
"version": "22.0.0",
2+
"version": "31.0.0",
33
"files": {
4-
"278d42fa865f60954d898636503d0ee86a6689d73dc50eb912fac62def0ef6a4": {
4+
"ae370e1010629b78f494346f49ceef3ab2875718f20e6c808114e6aa770c7bf3": {
55
"source": {
6-
"path": "asset.278d42fa865f60954d898636503d0ee86a6689d73dc50eb912fac62def0ef6a4.bundle",
6+
"path": "asset.ae370e1010629b78f494346f49ceef3ab2875718f20e6c808114e6aa770c7bf3.bundle",
77
"packaging": "zip"
88
},
99
"destinations": {
1010
"current_account-current_region": {
1111
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
12-
"objectKey": "278d42fa865f60954d898636503d0ee86a6689d73dc50eb912fac62def0ef6a4.zip",
12+
"objectKey": "ae370e1010629b78f494346f49ceef3ab2875718f20e6c808114e6aa770c7bf3.zip",
1313
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
1414
}
1515
}
1616
},
17-
"c9a130d7c2610c9af13d14efb06865c2d07c3a490c0a67ad7fd335b68dabe3e3": {
17+
"daf12686caaab929a8b80cea94594eae0b51e35083cbf2fb72fd74197b9afd81": {
1818
"source": {
1919
"path": "JsResolverIntegTestDefaultTestDeployAssert57AD8D20.template.json",
2020
"packaging": "file"
2121
},
2222
"destinations": {
2323
"current_account-current_region": {
2424
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
25-
"objectKey": "c9a130d7c2610c9af13d14efb06865c2d07c3a490c0a67ad7fd335b68dabe3e3.json",
25+
"objectKey": "daf12686caaab929a8b80cea94594eae0b51e35083cbf2fb72fd74197b9afd81.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-appsync/test/integ.js-resolver.js.snapshot/JsResolverIntegTestDefaultTestDeployAssert57AD8D20.template.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"outputPaths": [
3939
"Payload.data.addTest.id"
4040
],
41-
"salt": "1672953452085"
41+
"salt": "1682378119561"
4242
},
4343
"UpdateReplacePolicy": "Delete",
4444
"DeletionPolicy": "Delete"
@@ -147,7 +147,7 @@
147147
"S3Bucket": {
148148
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
149149
},
150-
"S3Key": "278d42fa865f60954d898636503d0ee86a6689d73dc50eb912fac62def0ef6a4.zip"
150+
"S3Key": "ae370e1010629b78f494346f49ceef3ab2875718f20e6c808114e6aa770c7bf3.zip"
151151
},
152152
"Timeout": 120,
153153
"Handler": "index.handler",
@@ -201,7 +201,7 @@
201201
}
202202
},
203203
"flattenResponse": "false",
204-
"salt": "1672953452086"
204+
"salt": "1682378119561"
205205
},
206206
"UpdateReplacePolicy": "Delete",
207207
"DeletionPolicy": "Delete"
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,10 @@ export async function handler(event: AWSLambda.CloudFormationCustomResourceEvent
188188
hostname: parsedUrl.hostname,
189189
path: parsedUrl.path,
190190
method: 'PUT',
191-
headers: { 'content-type': '', 'content-length': responseBody.length },
191+
headers: {
192+
'content-type': '',
193+
'content-length': Buffer.byteLength(responseBody, 'utf8'),
194+
},
192195
};
193196

194197
return new Promise((resolve, reject) => {

0 commit comments

Comments
 (0)