Skip to content

Commit

Permalink
chore: downgrade custom resources to Node 12 (#16818)
Browse files Browse the repository at this point in the history
Some AWS regions do not yet support the Node 14.x runtime for Lambda, which
makes it challenging to use anything that involves a vended custom resource that
uses it.

Downgrading all those resources to use Node 12.x instead, which is available in
all regions where Lambda is, and hence provides better coverage and usability.

Fixes cdklabs/cdk-ops#1686


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
Romain Marcadier authored Oct 6, 2021
1 parent fc4e7fa commit deb0d4d
Show file tree
Hide file tree
Showing 19 changed files with 953 additions and 409 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@
"Properties": {
"Code": {
"S3Bucket": {
"Ref": "AssetParametersc02a0f4f3094701fe7fc414690fc416909b3a1f04dcba086e366807a15f2b0b4S3Bucket52DB41A7"
"Ref": "AssetParameters1cd4a64795df8938c7ff3d71caa4b3fd27d3d5caa222517813b08ae2a6494d3eS3Bucket1AECFCFD"
},
"S3Key": {
"Fn::Join": [
Expand All @@ -727,7 +727,7 @@
"Fn::Split": [
"||",
{
"Ref": "AssetParametersc02a0f4f3094701fe7fc414690fc416909b3a1f04dcba086e366807a15f2b0b4S3VersionKey0F583551"
"Ref": "AssetParameters1cd4a64795df8938c7ff3d71caa4b3fd27d3d5caa222517813b08ae2a6494d3eS3VersionKey2ACFB47F"
}
]
}
Expand All @@ -740,7 +740,7 @@
"Fn::Split": [
"||",
{
"Ref": "AssetParametersc02a0f4f3094701fe7fc414690fc416909b3a1f04dcba086e366807a15f2b0b4S3VersionKey0F583551"
"Ref": "AssetParameters1cd4a64795df8938c7ff3d71caa4b3fd27d3d5caa222517813b08ae2a6494d3eS3VersionKey2ACFB47F"
}
]
}
Expand Down Expand Up @@ -877,7 +877,7 @@
"Properties": {
"Code": {
"S3Bucket": {
"Ref": "AssetParametersc02a0f4f3094701fe7fc414690fc416909b3a1f04dcba086e366807a15f2b0b4S3Bucket52DB41A7"
"Ref": "AssetParameters1cd4a64795df8938c7ff3d71caa4b3fd27d3d5caa222517813b08ae2a6494d3eS3Bucket1AECFCFD"
},
"S3Key": {
"Fn::Join": [
Expand All @@ -890,7 +890,7 @@
"Fn::Split": [
"||",
{
"Ref": "AssetParametersc02a0f4f3094701fe7fc414690fc416909b3a1f04dcba086e366807a15f2b0b4S3VersionKey0F583551"
"Ref": "AssetParameters1cd4a64795df8938c7ff3d71caa4b3fd27d3d5caa222517813b08ae2a6494d3eS3VersionKey2ACFB47F"
}
]
}
Expand All @@ -903,7 +903,7 @@
"Fn::Split": [
"||",
{
"Ref": "AssetParametersc02a0f4f3094701fe7fc414690fc416909b3a1f04dcba086e366807a15f2b0b4S3VersionKey0F583551"
"Ref": "AssetParameters1cd4a64795df8938c7ff3d71caa4b3fd27d3d5caa222517813b08ae2a6494d3eS3VersionKey2ACFB47F"
}
]
}
Expand Down Expand Up @@ -1044,7 +1044,7 @@
}
},
"Handler": "framework.onEvent",
"Runtime": "nodejs14.x",
"Runtime": "nodejs12.x",
"Timeout": 900
},
"DependsOn": [
Expand Down Expand Up @@ -1190,7 +1190,7 @@
"Properties": {
"Code": {
"S3Bucket": {
"Ref": "AssetParameters4600faecd25ab407ff0a9d16f935c93062aaea5d415e97046bb8befe6c8ec02cS3BucketD609D0D9"
"Ref": "AssetParameters1c4eb88f5a8270f387281dcff6e3493840634113c4d57044f4aff74e3ef94c2dS3Bucket4C71F166"
},
"S3Key": {
"Fn::Join": [
Expand All @@ -1203,7 +1203,7 @@
"Fn::Split": [
"||",
{
"Ref": "AssetParameters4600faecd25ab407ff0a9d16f935c93062aaea5d415e97046bb8befe6c8ec02cS3VersionKey77CF589B"
"Ref": "AssetParameters1c4eb88f5a8270f387281dcff6e3493840634113c4d57044f4aff74e3ef94c2dS3VersionKey0124EFC4"
}
]
}
Expand All @@ -1216,7 +1216,7 @@
"Fn::Split": [
"||",
{
"Ref": "AssetParameters4600faecd25ab407ff0a9d16f935c93062aaea5d415e97046bb8befe6c8ec02cS3VersionKey77CF589B"
"Ref": "AssetParameters1c4eb88f5a8270f387281dcff6e3493840634113c4d57044f4aff74e3ef94c2dS3VersionKey0124EFC4"
}
]
}
Expand All @@ -1242,17 +1242,17 @@
}
},
"Parameters": {
"AssetParametersc02a0f4f3094701fe7fc414690fc416909b3a1f04dcba086e366807a15f2b0b4S3Bucket52DB41A7": {
"AssetParameters1cd4a64795df8938c7ff3d71caa4b3fd27d3d5caa222517813b08ae2a6494d3eS3Bucket1AECFCFD": {
"Type": "String",
"Description": "S3 bucket for asset \"c02a0f4f3094701fe7fc414690fc416909b3a1f04dcba086e366807a15f2b0b4\""
"Description": "S3 bucket for asset \"1cd4a64795df8938c7ff3d71caa4b3fd27d3d5caa222517813b08ae2a6494d3e\""
},
"AssetParametersc02a0f4f3094701fe7fc414690fc416909b3a1f04dcba086e366807a15f2b0b4S3VersionKey0F583551": {
"AssetParameters1cd4a64795df8938c7ff3d71caa4b3fd27d3d5caa222517813b08ae2a6494d3eS3VersionKey2ACFB47F": {
"Type": "String",
"Description": "S3 key for asset version \"c02a0f4f3094701fe7fc414690fc416909b3a1f04dcba086e366807a15f2b0b4\""
"Description": "S3 key for asset version \"1cd4a64795df8938c7ff3d71caa4b3fd27d3d5caa222517813b08ae2a6494d3e\""
},
"AssetParametersc02a0f4f3094701fe7fc414690fc416909b3a1f04dcba086e366807a15f2b0b4ArtifactHash85B8E84D": {
"AssetParameters1cd4a64795df8938c7ff3d71caa4b3fd27d3d5caa222517813b08ae2a6494d3eArtifactHashC1CF90D5": {
"Type": "String",
"Description": "Artifact hash for asset \"c02a0f4f3094701fe7fc414690fc416909b3a1f04dcba086e366807a15f2b0b4\""
"Description": "Artifact hash for asset \"1cd4a64795df8938c7ff3d71caa4b3fd27d3d5caa222517813b08ae2a6494d3e\""
},
"AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3BucketDC4B98B1": {
"Type": "String",
Expand All @@ -1266,17 +1266,17 @@
"Type": "String",
"Description": "Artifact hash for asset \"daeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1\""
},
"AssetParameters4600faecd25ab407ff0a9d16f935c93062aaea5d415e97046bb8befe6c8ec02cS3BucketD609D0D9": {
"AssetParameters1c4eb88f5a8270f387281dcff6e3493840634113c4d57044f4aff74e3ef94c2dS3Bucket4C71F166": {
"Type": "String",
"Description": "S3 bucket for asset \"4600faecd25ab407ff0a9d16f935c93062aaea5d415e97046bb8befe6c8ec02c\""
"Description": "S3 bucket for asset \"1c4eb88f5a8270f387281dcff6e3493840634113c4d57044f4aff74e3ef94c2d\""
},
"AssetParameters4600faecd25ab407ff0a9d16f935c93062aaea5d415e97046bb8befe6c8ec02cS3VersionKey77CF589B": {
"AssetParameters1c4eb88f5a8270f387281dcff6e3493840634113c4d57044f4aff74e3ef94c2dS3VersionKey0124EFC4": {
"Type": "String",
"Description": "S3 key for asset version \"4600faecd25ab407ff0a9d16f935c93062aaea5d415e97046bb8befe6c8ec02c\""
"Description": "S3 key for asset version \"1c4eb88f5a8270f387281dcff6e3493840634113c4d57044f4aff74e3ef94c2d\""
},
"AssetParameters4600faecd25ab407ff0a9d16f935c93062aaea5d415e97046bb8befe6c8ec02cArtifactHash86CFA15D": {
"AssetParameters1c4eb88f5a8270f387281dcff6e3493840634113c4d57044f4aff74e3ef94c2dArtifactHash6350D824": {
"Type": "String",
"Description": "Artifact hash for asset \"4600faecd25ab407ff0a9d16f935c93062aaea5d415e97046bb8befe6c8ec02c\""
"Description": "Artifact hash for asset \"1c4eb88f5a8270f387281dcff6e3493840634113c4d57044f4aff74e3ef94c2d\""
}
},
"Outputs": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export class DnsValidatedCertificate extends CertificateBase implements ICertifi
const requestorFunction = new lambda.Function(this, 'CertificateRequestorFunction', {
code: lambda.Code.fromAsset(path.resolve(__dirname, '..', 'lambda-packages', 'dns_validated_certificate_handler', 'lib')),
handler: 'index.certificateRequestHandler',
runtime: lambda.Runtime.NODEJS_14_X,
runtime: lambda.Runtime.NODEJS_12_X,
timeout: cdk.Duration.minutes(15),
role: props.customResourceRole,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ test('creates CloudFormation Custom Resource', () => {
});
expect(stack).toHaveResource('AWS::Lambda::Function', {
Handler: 'index.certificateRequestHandler',
Runtime: 'nodejs14.x',
Runtime: 'nodejs12.x',
Timeout: 900,
});
expect(stack).toHaveResource('AWS::IAM::Policy', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class GlobalTableCoordinator extends cdk.Stack {
code: lambda.Code.fromAsset(path.resolve(__dirname, '../', 'lambda-packages', 'aws-global-table-coordinator', 'lib')),
description: 'Lambda to make DynamoDB a global table',
handler: 'index.handler',
runtime: lambda.Runtime.NODEJS_14_X,
runtime: lambda.Runtime.NODEJS_12_X,
timeout: cdk.Duration.minutes(5),
uuid: 'D38B65A6-6B54-4FB6-9BAD-9CD40A6DAC12',
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,9 @@
"Arn"
]
},
"Runtime": "nodejs14.x",
"Description": "Lambda to make DynamoDB a global table",
"Handler": "index.handler",
"Runtime": "nodejs14.x",
"Runtime": "nodejs12.x",
"Timeout": 300
},
"DependsOn": [
Expand Down
Loading

0 comments on commit deb0d4d

Please sign in to comment.