Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use NodeJS 14 for all packaged custom resources #13488

Merged
merged 7 commits into from
Mar 15, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class DnsValidatedCertificate extends cdk.Resource implements ICertificat
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_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
timeout: cdk.Duration.minutes(15),
role: props.customResourceRole,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@
]
}
},
"Handler": "index.handler",
"Role": {
"Fn::GetAtt": [
"SingletonLambdaD38B65A66B544FB69BAD9CD40A6DAC12ServiceRoleD9686810",
Expand All @@ -205,6 +204,8 @@
},
"Runtime": "nodejs14.x",
"Description": "Lambda to make DynamoDB a global table",
"Handler": "index.handler",
"Runtime": "nodejs14.x",
"Timeout": 300
},
"DependsOn": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,22 @@ function createEvalFn(runtime: lambda.Runtime, scope: Construct) {
lambdaPurpose,
code: lambda.Code.fromAsset(path.join(__dirname, 'eval-nodejs-handler')),
});
case lambda.Runtime.NODEJS_12_X:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❗ The case statement above means these sections will never run.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

goto fail. Thanks!

return new lambda.SingletonFunction(scope, 'EvalFunction', {
runtime,
handler: 'index.handler',
uuid: '2b81e383-aad2-44db-8aaf-b4809ae0e3b4',
lambdaPurpose,
code: lambda.Code.fromAsset(path.join(__dirname, 'eval-nodejs-handler')),
});
case lambda.Runtime.NODEJS_14_X:
return new lambda.SingletonFunction(scope, 'EvalFunction', {
runtime,
handler: 'index.handler',
uuid: 'da2d1181-604e-4a45-8694-1a6abd7fe42d',
lambdaPurpose,
code: lambda.Code.fromAsset(path.join(__dirname, 'eval-nodejs-handler')),
});
// TODO: implement other runtimes
default:
throw new Error(`The runtime ${runtime.name} is currently not supported.`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export class Provider extends CoreConstruct implements cfn.ICustomResourceProvid
const fn = new lambda.Function(this, `framework-${entrypoint}`, {
code: lambda.Code.fromAsset(RUNTIME_HANDLER_PATH),
description: `AWS CDK resource provider framework - ${entrypoint} (${this.node.path})`.slice(0, 256),
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
handler: `framework.${entrypoint}`,
timeout: FRAMEWORK_HANDLER_TIMEOUT,
logRetention: this.logRetention,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"Properties": {
"Code": {
"S3Bucket": {
"Ref": "AssetParametersfd43c0b4c0b961743009872f92ea51e922be342a344c19b9a8dd693f494d8da2S3BucketD831F708"
"Ref": "AssetParameters192597c3e09c72bcb5fca6899fca0b42745cb003a702e275a7f96123a9baf590S3BucketF43FE553"
},
"S3Key": {
"Fn::Join": [
Expand All @@ -101,7 +101,7 @@
"Fn::Split": [
"||",
{
"Ref": "AssetParametersfd43c0b4c0b961743009872f92ea51e922be342a344c19b9a8dd693f494d8da2S3VersionKeyEAC17D61"
"Ref": "AssetParameters192597c3e09c72bcb5fca6899fca0b42745cb003a702e275a7f96123a9baf590S3VersionKey1CA1DD38"
}
]
}
Expand All @@ -114,7 +114,7 @@
"Fn::Split": [
"||",
{
"Ref": "AssetParametersfd43c0b4c0b961743009872f92ea51e922be342a344c19b9a8dd693f494d8da2S3VersionKeyEAC17D61"
"Ref": "AssetParameters192597c3e09c72bcb5fca6899fca0b42745cb003a702e275a7f96123a9baf590S3VersionKey1CA1DD38"
}
]
}
Expand All @@ -124,13 +124,13 @@
]
}
},
"Handler": "index.onEvent",
"Role": {
"Fn::GetAtt": [
"comamazonawscdkcustomresourcess3fileproviders3fileoneventServiceRole999CEEB6",
"Arn"
]
},
"Handler": "index.onEvent",
"Runtime": "nodejs10.x"
},
"DependsOn": [
Expand Down Expand Up @@ -200,7 +200,7 @@
"Properties": {
"Code": {
"S3Bucket": {
"Ref": "AssetParameters956c2f92ddbde06f551fdf914445c679dcadb21c6e8d1ee9c9632144ef5a2ad3S3Bucket0EEA1C2E"
"Ref": "AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3BucketDC4B98B1"
},
"S3Key": {
"Fn::Join": [
Expand All @@ -213,7 +213,7 @@
"Fn::Split": [
"||",
{
"Ref": "AssetParameters956c2f92ddbde06f551fdf914445c679dcadb21c6e8d1ee9c9632144ef5a2ad3S3VersionKey7BCE18C9"
"Ref": "AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3VersionKeyA495226F"
}
]
}
Expand All @@ -226,7 +226,7 @@
"Fn::Split": [
"||",
{
"Ref": "AssetParameters956c2f92ddbde06f551fdf914445c679dcadb21c6e8d1ee9c9632144ef5a2ad3S3VersionKey7BCE18C9"
"Ref": "AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3VersionKeyA495226F"
}
]
}
Expand All @@ -236,14 +236,12 @@
]
}
},
"Handler": "framework.onEvent",
"Role": {
"Fn::GetAtt": [
"comamazonawscdkcustomresourcess3fileproviderframeworkonEventServiceRoleABFCDA11",
"Arn"
]
},
"Runtime": "nodejs10.x",
"Description": "AWS CDK resource provider framework - onEvent (integ-provider-framework/com.amazonaws.cdk.custom-resources.s3file-provider/s3file-provider)",
"Environment": {
"Variables": {
Expand All @@ -255,6 +253,8 @@
}
}
},
"Handler": "framework.onEvent",
"Runtime": "nodejs14.x",
"Timeout": 900
},
"DependsOn": [
Expand Down Expand Up @@ -377,13 +377,13 @@
]
}
},
"Handler": "index.on_event",
"Role": {
"Fn::GetAtt": [
"comamazonawscdkcustomresourcess3assertproviders3assertoneventServiceRole012C0033",
"Arn"
]
},
"Handler": "index.on_event",
"Runtime": "python3.7"
},
"DependsOn": [
Expand Down Expand Up @@ -487,13 +487,13 @@
]
}
},
"Handler": "index.is_complete",
"Role": {
"Fn::GetAtt": [
"comamazonawscdkcustomresourcess3assertproviders3assertiscompleteServiceRoleACAA755A",
"Arn"
]
},
"Handler": "index.is_complete",
"Runtime": "python3.7"
},
"DependsOn": [
Expand Down Expand Up @@ -580,7 +580,7 @@
"Properties": {
"Code": {
"S3Bucket": {
"Ref": "AssetParameters956c2f92ddbde06f551fdf914445c679dcadb21c6e8d1ee9c9632144ef5a2ad3S3Bucket0EEA1C2E"
"Ref": "AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3BucketDC4B98B1"
},
"S3Key": {
"Fn::Join": [
Expand All @@ -593,7 +593,7 @@
"Fn::Split": [
"||",
{
"Ref": "AssetParameters956c2f92ddbde06f551fdf914445c679dcadb21c6e8d1ee9c9632144ef5a2ad3S3VersionKey7BCE18C9"
"Ref": "AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3VersionKeyA495226F"
}
]
}
Expand All @@ -606,7 +606,7 @@
"Fn::Split": [
"||",
{
"Ref": "AssetParameters956c2f92ddbde06f551fdf914445c679dcadb21c6e8d1ee9c9632144ef5a2ad3S3VersionKey7BCE18C9"
"Ref": "AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3VersionKeyA495226F"
}
]
}
Expand All @@ -616,14 +616,12 @@
]
}
},
"Handler": "framework.onEvent",
"Role": {
"Fn::GetAtt": [
"comamazonawscdkcustomresourcess3assertproviderframeworkonEventServiceRole34070F2C",
"Arn"
]
},
"Runtime": "nodejs10.x",
"Description": "AWS CDK resource provider framework - onEvent (integ-provider-framework/com.amazonaws.cdk.custom-resources.s3assert-provider/s3assert-provider)",
"Environment": {
"Variables": {
Expand All @@ -644,6 +642,8 @@
}
}
},
"Handler": "framework.onEvent",
"Runtime": "nodejs14.x",
"Timeout": 900
},
"DependsOn": [
Expand Down Expand Up @@ -723,7 +723,7 @@
"Properties": {
"Code": {
"S3Bucket": {
"Ref": "AssetParameters956c2f92ddbde06f551fdf914445c679dcadb21c6e8d1ee9c9632144ef5a2ad3S3Bucket0EEA1C2E"
"Ref": "AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3BucketDC4B98B1"
},
"S3Key": {
"Fn::Join": [
Expand All @@ -736,7 +736,7 @@
"Fn::Split": [
"||",
{
"Ref": "AssetParameters956c2f92ddbde06f551fdf914445c679dcadb21c6e8d1ee9c9632144ef5a2ad3S3VersionKey7BCE18C9"
"Ref": "AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3VersionKeyA495226F"
}
]
}
Expand All @@ -749,7 +749,7 @@
"Fn::Split": [
"||",
{
"Ref": "AssetParameters956c2f92ddbde06f551fdf914445c679dcadb21c6e8d1ee9c9632144ef5a2ad3S3VersionKey7BCE18C9"
"Ref": "AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3VersionKeyA495226F"
}
]
}
Expand All @@ -759,14 +759,12 @@
]
}
},
"Handler": "framework.isComplete",
"Role": {
"Fn::GetAtt": [
"comamazonawscdkcustomresourcess3assertproviderframeworkisCompleteServiceRole2C8C7983",
"Arn"
]
},
"Runtime": "nodejs10.x",
"Description": "AWS CDK resource provider framework - isComplete (integ-provider-framework/com.amazonaws.cdk.custom-resources.s3assert-provider/s3assert-provider)",
"Environment": {
"Variables": {
Expand All @@ -784,6 +782,8 @@
}
}
},
"Handler": "framework.isComplete",
"Runtime": "nodejs14.x",
"Timeout": 900
},
"DependsOn": [
Expand Down Expand Up @@ -863,7 +863,7 @@
"Properties": {
"Code": {
"S3Bucket": {
"Ref": "AssetParameters956c2f92ddbde06f551fdf914445c679dcadb21c6e8d1ee9c9632144ef5a2ad3S3Bucket0EEA1C2E"
"Ref": "AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3BucketDC4B98B1"
},
"S3Key": {
"Fn::Join": [
Expand All @@ -876,7 +876,7 @@
"Fn::Split": [
"||",
{
"Ref": "AssetParameters956c2f92ddbde06f551fdf914445c679dcadb21c6e8d1ee9c9632144ef5a2ad3S3VersionKey7BCE18C9"
"Ref": "AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3VersionKeyA495226F"
}
]
}
Expand All @@ -889,7 +889,7 @@
"Fn::Split": [
"||",
{
"Ref": "AssetParameters956c2f92ddbde06f551fdf914445c679dcadb21c6e8d1ee9c9632144ef5a2ad3S3VersionKey7BCE18C9"
"Ref": "AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3VersionKeyA495226F"
}
]
}
Expand All @@ -899,14 +899,12 @@
]
}
},
"Handler": "framework.onTimeout",
"Role": {
"Fn::GetAtt": [
"comamazonawscdkcustomresourcess3assertproviderframeworkonTimeoutServiceRole15F6DFA2",
"Arn"
]
},
"Runtime": "nodejs10.x",
"Description": "AWS CDK resource provider framework - onTimeout (integ-provider-framework/com.amazonaws.cdk.custom-resources.s3assert-provider/s3assert-provider)",
"Environment": {
"Variables": {
Expand All @@ -924,6 +922,8 @@
}
}
},
"Handler": "framework.onTimeout",
"Runtime": "nodejs14.x",
"Timeout": 900
},
"DependsOn": [
Expand Down Expand Up @@ -1034,29 +1034,29 @@
}
},
"Parameters": {
"AssetParametersfd43c0b4c0b961743009872f92ea51e922be342a344c19b9a8dd693f494d8da2S3BucketD831F708": {
"AssetParameters192597c3e09c72bcb5fca6899fca0b42745cb003a702e275a7f96123a9baf590S3BucketF43FE553": {
"Type": "String",
"Description": "S3 bucket for asset \"fd43c0b4c0b961743009872f92ea51e922be342a344c19b9a8dd693f494d8da2\""
"Description": "S3 bucket for asset \"192597c3e09c72bcb5fca6899fca0b42745cb003a702e275a7f96123a9baf590\""
},
"AssetParametersfd43c0b4c0b961743009872f92ea51e922be342a344c19b9a8dd693f494d8da2S3VersionKeyEAC17D61": {
"AssetParameters192597c3e09c72bcb5fca6899fca0b42745cb003a702e275a7f96123a9baf590S3VersionKey1CA1DD38": {
"Type": "String",
"Description": "S3 key for asset version \"fd43c0b4c0b961743009872f92ea51e922be342a344c19b9a8dd693f494d8da2\""
"Description": "S3 key for asset version \"192597c3e09c72bcb5fca6899fca0b42745cb003a702e275a7f96123a9baf590\""
},
"AssetParametersfd43c0b4c0b961743009872f92ea51e922be342a344c19b9a8dd693f494d8da2ArtifactHashDD841113": {
"AssetParameters192597c3e09c72bcb5fca6899fca0b42745cb003a702e275a7f96123a9baf590ArtifactHashBBCB8F76": {
"Type": "String",
"Description": "Artifact hash for asset \"fd43c0b4c0b961743009872f92ea51e922be342a344c19b9a8dd693f494d8da2\""
"Description": "Artifact hash for asset \"192597c3e09c72bcb5fca6899fca0b42745cb003a702e275a7f96123a9baf590\""
},
"AssetParameters956c2f92ddbde06f551fdf914445c679dcadb21c6e8d1ee9c9632144ef5a2ad3S3Bucket0EEA1C2E": {
"AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3BucketDC4B98B1": {
"Type": "String",
"Description": "S3 bucket for asset \"956c2f92ddbde06f551fdf914445c679dcadb21c6e8d1ee9c9632144ef5a2ad3\""
"Description": "S3 bucket for asset \"daeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1\""
},
"AssetParameters956c2f92ddbde06f551fdf914445c679dcadb21c6e8d1ee9c9632144ef5a2ad3S3VersionKey7BCE18C9": {
"AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1S3VersionKeyA495226F": {
"Type": "String",
"Description": "S3 key for asset version \"956c2f92ddbde06f551fdf914445c679dcadb21c6e8d1ee9c9632144ef5a2ad3\""
"Description": "S3 key for asset version \"daeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1\""
},
"AssetParameters956c2f92ddbde06f551fdf914445c679dcadb21c6e8d1ee9c9632144ef5a2ad3ArtifactHash2CBB11D2": {
"AssetParametersdaeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1ArtifactHashA521A16F": {
"Type": "String",
"Description": "Artifact hash for asset \"956c2f92ddbde06f551fdf914445c679dcadb21c6e8d1ee9c9632144ef5a2ad3\""
"Description": "Artifact hash for asset \"daeb79e3cee39c9b902dc0d5c780223e227ed573ea60976252947adab5fb2be1\""
},
"AssetParameters4bafad8d010ba693e235b77d2c6decfc2ac79a8208d4477cbb36d31caf7189e8S3Bucket0DB889DF": {
"Type": "String",
Expand Down