From 0188db79b8adc33df4df99ecee6380c79a2f5cea Mon Sep 17 00:00:00 2001 From: Al Harris Date: Mon, 28 Aug 2023 09:17:57 -0700 Subject: [PATCH] chore: bump nodejs lambda runtimes to 18.x --- .../sync-conflict-handler-template.json.ejs | 2 +- ...hql-predictions-transformer-override.test.ts.snap | 4 ++-- .../__snapshots__/ecs-apigw-stack.test.ts.snap | 12 ++++++------ .../awscloudformation/pipeline-with-awaiter.ts | 2 +- .../src/field-mapping-lambda.ts | 2 +- ...lify-graphql-predictions-transformer.test.ts.snap | 2 +- .../src/graphql-predictions-transformer.ts | 2 +- .../src/PredictionsResourceIDs.ts | 2 +- .../resources/jsonServer/src/index.ts | 2 +- .../src/LambdaHelper.ts | 2 +- 10 files changed, 16 insertions(+), 16 deletions(-) diff --git a/packages/amplify-category-api/resources/awscloudformation/sync-conflict-handler/sync-conflict-handler-template.json.ejs b/packages/amplify-category-api/resources/awscloudformation/sync-conflict-handler/sync-conflict-handler-template.json.ejs index f898077cbd..a98ecae384 100644 --- a/packages/amplify-category-api/resources/awscloudformation/sync-conflict-handler/sync-conflict-handler-template.json.ejs +++ b/packages/amplify-category-api/resources/awscloudformation/sync-conflict-handler/sync-conflict-handler-template.json.ejs @@ -66,7 +66,7 @@ } }, "Role": { "Fn::GetAtt" : ["LambdaExecutionRole", "Arn"] }, - "Runtime": "nodejs14.x", + "Runtime": "nodejs18.x", "Timeout": 25 } }, diff --git a/packages/amplify-category-api/src/__tests__/graphql-transformer/override/__snapshots__/amplify-graphql-predictions-transformer-override.test.ts.snap b/packages/amplify-category-api/src/__tests__/graphql-transformer/override/__snapshots__/amplify-graphql-predictions-transformer-override.test.ts.snap index 633d4ac8f5..d176583f43 100644 --- a/packages/amplify-category-api/src/__tests__/graphql-transformer/override/__snapshots__/amplify-graphql-predictions-transformer-override.test.ts.snap +++ b/packages/amplify-category-api/src/__tests__/graphql-transformer/override/__snapshots__/amplify-graphql-predictions-transformer-override.test.ts.snap @@ -704,7 +704,7 @@ $utils.error($ctx.result.body) "Arn", ], }, - "Runtime": "nodejs16.x", + "Runtime": "nodejs18.x", "Timeout": 60, }, "Type": "AWS::Lambda::Function", @@ -1609,7 +1609,7 @@ $utils.error($ctx.result.body) "Arn", ], }, - "Runtime": "nodejs16.x", + "Runtime": "nodejs18.x", "Timeout": 60, }, "Type": "AWS::Lambda::Function", diff --git a/packages/amplify-category-api/src/__tests__/provider-utils/awscloudformation/__snapshots__/ecs-apigw-stack.test.ts.snap b/packages/amplify-category-api/src/__tests__/provider-utils/awscloudformation/__snapshots__/ecs-apigw-stack.test.ts.snap index f66905cb27..db581c380d 100644 --- a/packages/amplify-category-api/src/__tests__/provider-utils/awscloudformation/__snapshots__/ecs-apigw-stack.test.ts.snap +++ b/packages/amplify-category-api/src/__tests__/provider-utils/awscloudformation/__snapshots__/ecs-apigw-stack.test.ts.snap @@ -1373,7 +1373,7 @@ exports.handler = async function({ RequestType, ResourceProperties, StackId }) { "Arn", ], }, - "Runtime": "nodejs16.x", + "Runtime": "nodejs18.x", "Timeout": 15, }, "Type": "AWS::Lambda::Function", @@ -1492,7 +1492,7 @@ exports.handler = async function({ RequestType, ResourceProperties, StackId }) { "Arn", ], }, - "Runtime": "nodejs16.x", + "Runtime": "nodejs18.x", "Timeout": 15, }, "Type": "AWS::Lambda::Function", @@ -1566,7 +1566,7 @@ exports.handler = async function({ RequestType, ResourceProperties, StackId }) { "Arn", ], }, - "Runtime": "nodejs14.x", + "Runtime": "nodejs18.x", "Timeout": 900, }, "Type": "AWS::Lambda::Function", @@ -1711,7 +1711,7 @@ exports.handler = async function({ RequestType, ResourceProperties, StackId }) { "Arn", ], }, - "Runtime": "nodejs14.x", + "Runtime": "nodejs18.x", "Timeout": 900, }, "Type": "AWS::Lambda::Function", @@ -1860,7 +1860,7 @@ exports.handler = async function({ RequestType, ResourceProperties, StackId }) { "Arn", ], }, - "Runtime": "nodejs14.x", + "Runtime": "nodejs18.x", "Timeout": 900, }, "Type": "AWS::Lambda::Function", @@ -2236,7 +2236,7 @@ exports.handler = async function({ 'CodePipeline.job': { id: jobId } }) { "Arn", ], }, - "Runtime": "nodejs16.x", + "Runtime": "nodejs18.x", "Timeout": 15, }, "Type": "AWS::Lambda::Function", diff --git a/packages/amplify-category-api/src/provider-utils/awscloudformation/pipeline-with-awaiter.ts b/packages/amplify-category-api/src/provider-utils/awscloudformation/pipeline-with-awaiter.ts index 3b5e513842..6535b14f4e 100644 --- a/packages/amplify-category-api/src/provider-utils/awscloudformation/pipeline-with-awaiter.ts +++ b/packages/amplify-category-api/src/provider-utils/awscloudformation/pipeline-with-awaiter.ts @@ -26,7 +26,7 @@ export type GitHubSourceActionInfo = { tokenSecretArn: string; }; -const lambdaRuntimeNodeVersion = lambda.Runtime.NODEJS_16_X; +const lambdaRuntimeNodeVersion = lambda.Runtime.NODEJS_18_X; const lambdasDir = path.resolve(__dirname, '../../../resources/awscloudformation/lambdas'); diff --git a/packages/amplify-graphql-maps-to-transformer/src/field-mapping-lambda.ts b/packages/amplify-graphql-maps-to-transformer/src/field-mapping-lambda.ts index 0f7fc80575..7f0d28cca2 100644 --- a/packages/amplify-graphql-maps-to-transformer/src/field-mapping-lambda.ts +++ b/packages/amplify-graphql-maps-to-transformer/src/field-mapping-lambda.ts @@ -33,7 +33,7 @@ export const createMappingLambda = (host: TransformHostProvider, stackManager: S `functions/${funcLogicalId}.zip`, // function key 'index.handler', // function handler path.join(__dirname, 'assets', 'mapping-lambda.zip'), - lambda.Runtime.NODEJS_14_X, + lambda.Runtime.NODEJS_18_X, undefined, // layers role, // execution role, undefined, // env vars diff --git a/packages/amplify-graphql-predictions-transformer/src/__tests__/__snapshots__/amplify-graphql-predictions-transformer.test.ts.snap b/packages/amplify-graphql-predictions-transformer/src/__tests__/__snapshots__/amplify-graphql-predictions-transformer.test.ts.snap index 87a6c08178..0170e5e672 100644 --- a/packages/amplify-graphql-predictions-transformer/src/__tests__/__snapshots__/amplify-graphql-predictions-transformer.test.ts.snap +++ b/packages/amplify-graphql-predictions-transformer/src/__tests__/__snapshots__/amplify-graphql-predictions-transformer.test.ts.snap @@ -1302,7 +1302,7 @@ $utils.error($ctx.result.body) "Arn", ], }, - "Runtime": "nodejs16.x", + "Runtime": "nodejs18.x", "Timeout": 60, }, "Type": "AWS::Lambda::Function", diff --git a/packages/amplify-graphql-predictions-transformer/src/graphql-predictions-transformer.ts b/packages/amplify-graphql-predictions-transformer/src/graphql-predictions-transformer.ts index 0ddffe65bf..0dc0053a37 100644 --- a/packages/amplify-graphql-predictions-transformer/src/graphql-predictions-transformer.ts +++ b/packages/amplify-graphql-predictions-transformer/src/graphql-predictions-transformer.ts @@ -398,7 +398,7 @@ function createPredictionsLambda(context: TransformerContextProvider, stack: cdk `functions/${functionId}.zip`, PredictionsResourceIDs.lambdaHandlerName, path.join(__dirname, '..', 'lib', 'predictionsLambdaFunction.zip'), - lambda.Runtime.NODEJS_16_X, + lambda.Runtime.NODEJS_18_X, [], role, {}, diff --git a/packages/graphql-transformer-common/src/PredictionsResourceIDs.ts b/packages/graphql-transformer-common/src/PredictionsResourceIDs.ts index e1383ce31a..848be39899 100644 --- a/packages/graphql-transformer-common/src/PredictionsResourceIDs.ts +++ b/packages/graphql-transformer-common/src/PredictionsResourceIDs.ts @@ -11,7 +11,7 @@ export class PredictionsResourceIDs { static lambdaHandlerName = 'predictionsLambda.handler'; - static lambdaRuntime = 'nodejs14.x'; + static lambdaRuntime = 'nodejs18.x'; static lambdaTimeout = 60; diff --git a/packages/graphql-transformers-e2e-tests/resources/jsonServer/src/index.ts b/packages/graphql-transformers-e2e-tests/resources/jsonServer/src/index.ts index 764215ca3c..4332d9ebed 100644 --- a/packages/graphql-transformers-e2e-tests/resources/jsonServer/src/index.ts +++ b/packages/graphql-transformers-e2e-tests/resources/jsonServer/src/index.ts @@ -9,7 +9,7 @@ export class JsonMockStack extends cdk.Stack { const jsonLambda = new lambda.Function(this, 'jsonServerFunction', { code: new lambda.AssetCode('src-server'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_18_X, }); const api = new apigateway.LambdaRestApi(this, 'jsonMockApi', { diff --git a/packages/graphql-transformers-e2e-tests/src/LambdaHelper.ts b/packages/graphql-transformers-e2e-tests/src/LambdaHelper.ts index 598132f57c..f35da2f0a2 100644 --- a/packages/graphql-transformers-e2e-tests/src/LambdaHelper.ts +++ b/packages/graphql-transformers-e2e-tests/src/LambdaHelper.ts @@ -24,7 +24,7 @@ export class LambdaHelper { Code: { ZipFile: zipContents, }, - Runtime: 'nodejs14.x', + Runtime: 'nodejs18.x', Handler: `${filePrefix}.handler`, Role: roleArn, })