From 7157a9c1d4be9e8d81a60780046501611867d0f8 Mon Sep 17 00:00:00 2001 From: Elena Naum Date: Wed, 1 Jun 2022 13:51:34 +0200 Subject: [PATCH 1/2] feat(lambda): Migrate NODEJS_10_X to NODEJS_14_X --- INTEGRATION_TESTS.md | 2 +- .../test/authorizers/lambda.test.ts | 6 +- .../@aws-cdk/aws-apigateway/test/cors.test.ts | 2 +- .../aws-apigateway/test/deployment.test.ts | 4 +- .../test/integrations/lambda.test.ts | 14 +-- .../aws-apigateway/test/lambda-api.test.ts | 12 +-- .../aws-apigateway/test/method.test.ts | 2 +- .../test/hooks.test.ts | 6 +- .../test/web-distribution.test.ts | 8 +- .../aws-cloudtrail/test/cloudtrail.test.ts | 2 +- .../lambda/custom-deployment-config.test.ts | 2 +- .../test/lambda/deployment-group.test.ts | 2 +- .../test/lambda/lambda-invoke-action.test.ts | 2 +- .../test/pipeline.test.ts | 2 +- .../@aws-cdk/aws-config/test/rule.test.ts | 8 +- .../test/destinations.test.ts | 2 +- .../@aws-cdk/aws-lambda/test/alias.test.ts | 42 ++++----- .../@aws-cdk/aws-lambda/test/code.test.ts | 18 ++-- .../aws-lambda/test/function-hash.test.ts | 4 +- .../aws-lambda/test/function-url.test.ts | 10 +-- .../@aws-cdk/aws-lambda/test/function.test.ts | 90 +++++++++---------- .../aws-lambda/test/lambda-insights.test.ts | 2 +- .../aws-lambda/test/lambda-version.test.ts | 10 +-- .../@aws-cdk/aws-lambda/test/layers.test.ts | 4 +- .../aws-lambda/test/vpc-lambda.test.ts | 18 ++-- .../aws-logs-destinations/test/lambda.test.ts | 2 +- .../@aws-cdk/aws-rds/test/instance.test.ts | 2 +- .../test/lambda/lambda.test.ts | 12 +-- .../test/rotation-schedule.test.ts | 10 +-- .../aws-secretsmanager/test/secret.test.ts | 2 +- .../aws-ses-actions/test/actions.test.ts | 2 +- .../aws-sns-subscriptions/test/subs.test.ts | 14 +-- .../lib/evaluate-expression.ts | 4 +- .../test/provider-framework/provider.test.ts | 24 ++--- 34 files changed, 173 insertions(+), 173 deletions(-) diff --git a/INTEGRATION_TESTS.md b/INTEGRATION_TESTS.md index f6c95623d1093..d29c8526ddc7f 100644 --- a/INTEGRATION_TESTS.md +++ b/INTEGRATION_TESTS.md @@ -93,7 +93,7 @@ const stack = new cdk.Stack(app, 'aws-cdk-lambda-1'); const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); app.synth(); diff --git a/packages/@aws-cdk/aws-apigateway/test/authorizers/lambda.test.ts b/packages/@aws-cdk/aws-apigateway/test/authorizers/lambda.test.ts index f215a5143b54b..83569e63e1489 100644 --- a/packages/@aws-cdk/aws-apigateway/test/authorizers/lambda.test.ts +++ b/packages/@aws-cdk/aws-apigateway/test/authorizers/lambda.test.ts @@ -11,7 +11,7 @@ describe('lambda authorizer', () => { const func = new lambda.Function(stack, 'myfunction', { handler: 'handler', code: lambda.Code.fromInline('foo'), - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const auth = new TokenAuthorizer(stack, 'myauthorizer', { @@ -176,7 +176,7 @@ describe('lambda authorizer', () => { const func = new lambda.Function(stack, 'myfunction', { handler: 'handler', code: lambda.Code.fromInline('foo'), - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const auth = new TokenAuthorizer(stack, 'myauthorizer', { @@ -320,7 +320,7 @@ describe('lambda authorizer', () => { const func = new lambda.Function(stack, 'myfunction', { handler: 'handler', code: lambda.Code.fromInline('foo'), - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const role = new iam.Role(stack, 'authorizerassumerole', { diff --git a/packages/@aws-cdk/aws-apigateway/test/cors.test.ts b/packages/@aws-cdk/aws-apigateway/test/cors.test.ts index c573e6302589e..0712a76bb2471 100644 --- a/packages/@aws-cdk/aws-apigateway/test/cors.test.ts +++ b/packages/@aws-cdk/aws-apigateway/test/cors.test.ts @@ -634,7 +634,7 @@ describe('cors', () => { const handler = new lambda.Function(stack, 'handler', { handler: 'index.handler', code: lambda.Code.fromInline('boom'), - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // WHEN diff --git a/packages/@aws-cdk/aws-apigateway/test/deployment.test.ts b/packages/@aws-cdk/aws-apigateway/test/deployment.test.ts index ef537a848c070..ae74fd4080f62 100644 --- a/packages/@aws-cdk/aws-apigateway/test/deployment.test.ts +++ b/packages/@aws-cdk/aws-apigateway/test/deployment.test.ts @@ -199,12 +199,12 @@ describe('deployment', () => { const stack2 = new Stack(); const handler1 = new lambda.Function(stack1, 'handler1', { code: lambda.Code.fromAsset(path.join(__dirname, 'lambda')), - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', }); const handler2 = new lambda.Function(stack2, 'handler2', { code: lambda.Code.fromAsset(path.join(__dirname, 'lambda')), - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', }); diff --git a/packages/@aws-cdk/aws-apigateway/test/integrations/lambda.test.ts b/packages/@aws-cdk/aws-apigateway/test/integrations/lambda.test.ts index 187e15e2b09cf..7d2221c0ddb92 100644 --- a/packages/@aws-cdk/aws-apigateway/test/integrations/lambda.test.ts +++ b/packages/@aws-cdk/aws-apigateway/test/integrations/lambda.test.ts @@ -54,7 +54,7 @@ describe('lambda', () => { // GIVEN const stack = new cdk.Stack(); const fn = new lambda.Function(stack, 'Handler', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromInline('foo'), handler: 'index.handler', }); @@ -102,7 +102,7 @@ describe('lambda', () => { // GIVEN const stack = new cdk.Stack(); const fn = new lambda.Function(stack, 'Handler', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromInline('foo'), handler: 'index.handler', }); @@ -138,7 +138,7 @@ describe('lambda', () => { // GIVEN const stack = new cdk.Stack(); const fn = new lambda.Function(stack, 'Handler', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromInline('foo'), handler: 'index.handler', }); @@ -162,7 +162,7 @@ describe('lambda', () => { const api = new apigateway.RestApi(stack, 'test-api'); const handler = new lambda.Function(stack, 'MyFunc', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('loo'), }); @@ -228,7 +228,7 @@ describe('lambda', () => { }); const handler = new lambda.Function(stack, 'MyFunc', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('loo'), }); @@ -249,7 +249,7 @@ describe('lambda', () => { const method = restapi.root.addMethod('ANY'); const handler = new lambda.Function(stack, 'MyFunc', { functionName: 'ThisFunction', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('loo'), }); @@ -269,7 +269,7 @@ describe('lambda', () => { const restapi = new apigateway.RestApi(stack, 'RestApi'); const method = restapi.root.addMethod('ANY'); const handler = new lambda.Function(stack, 'MyFunc', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('loo'), }); diff --git a/packages/@aws-cdk/aws-apigateway/test/lambda-api.test.ts b/packages/@aws-cdk/aws-apigateway/test/lambda-api.test.ts index f7c47afe85d2b..e58a615112219 100644 --- a/packages/@aws-cdk/aws-apigateway/test/lambda-api.test.ts +++ b/packages/@aws-cdk/aws-apigateway/test/lambda-api.test.ts @@ -11,7 +11,7 @@ describe('lambda api', () => { const handler = new lambda.Function(stack, 'handler', { handler: 'index.handler', code: lambda.Code.fromInline('boom'), - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // WHEN @@ -73,7 +73,7 @@ describe('lambda api', () => { const handler = new lambda.Function(stack, 'handler', { handler: 'index.handler', code: lambda.Code.fromInline('boom'), - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const alias = new lambda.Alias(stack, 'alias', { aliasName: 'my-alias', @@ -138,7 +138,7 @@ describe('lambda api', () => { const handler = new lambda.Function(stack, 'handler', { handler: 'index.handler', code: lambda.Code.fromInline('boom'), - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // WHEN @@ -175,7 +175,7 @@ describe('lambda api', () => { const handler = new lambda.Function(stack, 'handler', { handler: 'index.handler', code: lambda.Code.fromInline('boom'), - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); expect(() => new apigw.LambdaRestApi(stack, 'lambda-rest-api', { @@ -196,7 +196,7 @@ describe('lambda api', () => { const handler = new lambda.Function(stack, 'handler', { handler: 'index.handler', code: lambda.Code.fromInline('boom'), - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // WHEN @@ -252,7 +252,7 @@ describe('lambda api', () => { handler: new lambda.Function(stack, 'handler', { handler: 'index.handler', code: lambda.Code.fromInline('boom'), - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }), restApiName: cdk.PhysicalName.GENERATE_IF_NEEDED, }); diff --git a/packages/@aws-cdk/aws-apigateway/test/method.test.ts b/packages/@aws-cdk/aws-apigateway/test/method.test.ts index de41b0dfe363f..1540a7d27ad16 100644 --- a/packages/@aws-cdk/aws-apigateway/test/method.test.ts +++ b/packages/@aws-cdk/aws-apigateway/test/method.test.ts @@ -658,7 +658,7 @@ describe('method', () => { const func = new lambda.Function(stack, 'myfunction', { handler: 'handler', code: lambda.Code.fromInline('foo'), - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const auth = new apigw.TokenAuthorizer(stack, 'myauthorizer1', { diff --git a/packages/@aws-cdk/aws-autoscaling-hooktargets/test/hooks.test.ts b/packages/@aws-cdk/aws-autoscaling-hooktargets/test/hooks.test.ts index 413142423f7b5..1e824c28ebd04 100644 --- a/packages/@aws-cdk/aws-autoscaling-hooktargets/test/hooks.test.ts +++ b/packages/@aws-cdk/aws-autoscaling-hooktargets/test/hooks.test.ts @@ -121,7 +121,7 @@ describe('given an AutoScalingGroup and no role', () => { // GIVEN const fn = new lambda.Function(stack, 'Fn', { code: lambda.Code.fromInline('foo'), - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.index', }); @@ -165,7 +165,7 @@ describe('given an AutoScalingGroup and no role', () => { const key = new kms.Key(stack, 'key'); const fn = new lambda.Function(stack, 'Fn', { code: lambda.Code.fromInline('foo'), - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.index', }); @@ -297,7 +297,7 @@ describe('given an AutoScalingGroup and a role', () => { // GIVEN const fn = new lambda.Function(stack, 'Fn', { code: lambda.Code.fromInline('foo'), - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.index', }); const myrole = new iam.Role(stack, 'MyRole', { diff --git a/packages/@aws-cdk/aws-cloudfront/test/web-distribution.test.ts b/packages/@aws-cdk/aws-cloudfront/test/web-distribution.test.ts index ef7487bac0076..36b5b16e6b3a2 100644 --- a/packages/@aws-cdk/aws-cloudfront/test/web-distribution.test.ts +++ b/packages/@aws-cdk/aws-cloudfront/test/web-distribution.test.ts @@ -840,7 +840,7 @@ added the ellipsis so a user would know there was more to r...`, const lambdaFunction = new lambda.Function(stack, 'Lambda', { code: lambda.Code.fromInline('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); new CloudFrontWebDistribution(stack, 'AnAmazingWebsiteProbably', { @@ -890,7 +890,7 @@ added the ellipsis so a user would know there was more to r...`, const lambdaFunction = new lambda.Function(stack, 'Lambda', { code: lambda.Code.fromInline('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); lambdaFunction.addEnvironment('KEY', 'value', { removeInEdge: true }); @@ -928,7 +928,7 @@ added the ellipsis so a user would know there was more to r...`, const lambdaFunction = new lambda.Function(stack, 'Lambda', { code: lambda.Code.fromInline('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, environment: { KEY: 'value', }, @@ -1324,7 +1324,7 @@ added the ellipsis so a user would know there was more to r...`, const fn = new lambda.Function(stack, 'Lambda', { code: lambda.Code.fromInline('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const lambdaVersion = new lambda.Version(stack, 'LambdaVersion', { lambda: fn }); diff --git a/packages/@aws-cdk/aws-cloudtrail/test/cloudtrail.test.ts b/packages/@aws-cdk/aws-cloudtrail/test/cloudtrail.test.ts index 1492a3c1377b1..4687fc5057b0c 100644 --- a/packages/@aws-cdk/aws-cloudtrail/test/cloudtrail.test.ts +++ b/packages/@aws-cdk/aws-cloudtrail/test/cloudtrail.test.ts @@ -572,7 +572,7 @@ describe('cloudtrail', () => { test('for Lambda function data event', () => { const stack = getTestStack(); const lambdaFunction = new lambda.Function(stack, 'LambdaFunction', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'hello.handler', code: lambda.Code.fromInline('exports.handler = {}'), }); diff --git a/packages/@aws-cdk/aws-codedeploy/test/lambda/custom-deployment-config.test.ts b/packages/@aws-cdk/aws-codedeploy/test/lambda/custom-deployment-config.test.ts index 618479726a3f2..4498ed8522f73 100644 --- a/packages/@aws-cdk/aws-codedeploy/test/lambda/custom-deployment-config.test.ts +++ b/packages/@aws-cdk/aws-codedeploy/test/lambda/custom-deployment-config.test.ts @@ -7,7 +7,7 @@ function mockFunction(stack: cdk.Stack, id: string) { return new lambda.Function(stack, id, { code: lambda.Code.fromInline('mock'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); } function mockAlias(stack: cdk.Stack) { diff --git a/packages/@aws-cdk/aws-codedeploy/test/lambda/deployment-group.test.ts b/packages/@aws-cdk/aws-codedeploy/test/lambda/deployment-group.test.ts index 5dbd5c98258ab..9fc6049e9a2c5 100644 --- a/packages/@aws-cdk/aws-codedeploy/test/lambda/deployment-group.test.ts +++ b/packages/@aws-cdk/aws-codedeploy/test/lambda/deployment-group.test.ts @@ -9,7 +9,7 @@ function mockFunction(stack: cdk.Stack, id: string) { return new lambda.Function(stack, id, { code: lambda.Code.fromInline('mock'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); } function mockAlias(stack: cdk.Stack) { diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/lambda/lambda-invoke-action.test.ts b/packages/@aws-cdk/aws-codepipeline-actions/test/lambda/lambda-invoke-action.test.ts index cf6317f20f030..835dc0e0d6819 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/lambda/lambda-invoke-action.test.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/lambda/lambda-invoke-action.test.ts @@ -361,7 +361,7 @@ function stackIncludingLambdaInvokeCodePipeline(props: HelperProps, app?: App) { lambda: new lambda.Function(stack, 'Lambda', { code: lambda.Code.fromCfnParameters(), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }), userParameters: props.userParams, userParametersString: props.userParamsString, diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/pipeline.test.ts b/packages/@aws-cdk/aws-codepipeline-actions/test/pipeline.test.ts index ee3fc2cc1e0fc..8a66b5d01854f 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/pipeline.test.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/pipeline.test.ts @@ -434,7 +434,7 @@ describe('pipeline', () => { const lambdaFun = new lambda.Function(stack, 'Function', { code: new lambda.InlineCode('bla'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const pipeline = new codepipeline.Pipeline(stack, 'Pipeline'); diff --git a/packages/@aws-cdk/aws-config/test/rule.test.ts b/packages/@aws-cdk/aws-config/test/rule.test.ts index a6e125b4d89ec..93f614073687d 100644 --- a/packages/@aws-cdk/aws-config/test/rule.test.ts +++ b/packages/@aws-cdk/aws-config/test/rule.test.ts @@ -41,7 +41,7 @@ describe('rule', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.AssetCode.fromInline('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // WHEN @@ -202,7 +202,7 @@ describe('rule', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.AssetCode.fromInline('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // THEN @@ -219,7 +219,7 @@ describe('rule', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.AssetCode.fromInline('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // THEN @@ -238,7 +238,7 @@ describe('rule', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.fromInline('dummy'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // WHEN diff --git a/packages/@aws-cdk/aws-lambda-destinations/test/destinations.test.ts b/packages/@aws-cdk/aws-lambda-destinations/test/destinations.test.ts index 5a94887c5673b..2b0fa9431c827 100644 --- a/packages/@aws-cdk/aws-lambda-destinations/test/destinations.test.ts +++ b/packages/@aws-cdk/aws-lambda-destinations/test/destinations.test.ts @@ -14,7 +14,7 @@ beforeEach(() => { const lambdaProps = { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }; test('event bus as destination', () => { diff --git a/packages/@aws-cdk/aws-lambda/test/alias.test.ts b/packages/@aws-cdk/aws-lambda/test/alias.test.ts index 358287145e17a..132506a3f655a 100644 --- a/packages/@aws-cdk/aws-lambda/test/alias.test.ts +++ b/packages/@aws-cdk/aws-lambda/test/alias.test.ts @@ -11,7 +11,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const version = fn.addVersion('1'); @@ -37,7 +37,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); new lambda.Alias(stack, 'Alias', { @@ -58,7 +58,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const version = fn.addVersion('NewVersion'); @@ -84,7 +84,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const version1 = fn.addVersion('1'); @@ -114,7 +114,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const pce = 5; @@ -147,7 +147,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const version = fn.currentVersion; @@ -178,7 +178,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const version = fn.currentVersion; @@ -221,7 +221,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // WHEN: Alias provisionedConcurrencyConfig less than 0 @@ -256,7 +256,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const version = fn.currentVersion; @@ -273,7 +273,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const version = fn.currentVersion; @@ -309,7 +309,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'fn', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // WHEN @@ -355,7 +355,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'fn', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const alias = new lambda.Alias(stack, 'Alias', { aliasName: 'prod', @@ -396,7 +396,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const alias = new lambda.Alias(stack, 'Alias', { @@ -435,7 +435,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const alias = new lambda.Alias(stack, 'Alias', { @@ -481,7 +481,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const alias = new lambda.Alias(stack, 'Alias', { @@ -511,7 +511,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const alias = new lambda.Alias(stack, 'Alias', { @@ -532,7 +532,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const alias = new lambda.Alias(stack, 'Alias', { @@ -553,7 +553,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const alias = new lambda.Alias(stack, 'Alias', { @@ -586,7 +586,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const alias = new lambda.Alias(stack, 'Alias', { @@ -611,7 +611,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const alias = new lambda.Alias(stack, 'Alias', { @@ -637,7 +637,7 @@ describe('alias', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const alias = new lambda.Alias(stack, 'Alias', { aliasName: 'prod', diff --git a/packages/@aws-cdk/aws-lambda/test/code.test.ts b/packages/@aws-cdk/aws-lambda/test/code.test.ts index 3c0d31f6931e9..79f2bae611a29 100644 --- a/packages/@aws-cdk/aws-lambda/test/code.test.ts +++ b/packages/@aws-cdk/aws-lambda/test/code.test.ts @@ -15,7 +15,7 @@ describe('code', () => { expect(() => defineFunction(lambda.Code.fromInline('boom'), lambda.Runtime.JAVA_8)).toThrow(/Inline source not allowed for java8/); }); test('fails if larger than 4096 bytes', () => { - expect(() => defineFunction(lambda.Code.fromInline(generateRandomString(4097)), lambda.Runtime.NODEJS_10_X)) + expect(() => defineFunction(lambda.Code.fromInline(generateRandomString(4097)), lambda.Runtime.NODEJS_14_X)) .toThrow(/Lambda source is too large, must be <= 4096 but is 4097/); }); }); @@ -38,13 +38,13 @@ describe('code', () => { // WHEN new lambda.Function(stack, 'Func1', { handler: 'foom', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: directoryAsset, }); new lambda.Function(stack, 'Func2', { handler: 'foom', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: directoryAsset, }); @@ -66,7 +66,7 @@ describe('code', () => { // WHEN new lambda.Function(stack, 'Func1', { code: lambda.Code.fromAsset(location), - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'foom', }); @@ -88,14 +88,14 @@ describe('code', () => { const stack1 = new cdk.Stack(app, 'Stack1'); new lambda.Function(stack1, 'Func', { code: asset, - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'foom', }); const stack2 = new cdk.Stack(app, 'Stack2'); expect(() => new lambda.Function(stack2, 'Func', { code: asset, - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'foom', })).toThrow(/already associated/); }); @@ -107,7 +107,7 @@ describe('code', () => { const code = new lambda.CfnParametersCode(); new lambda.Function(stack, 'Function', { code, - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', }); @@ -153,7 +153,7 @@ describe('code', () => { new lambda.Function(stack, 'Function', { code, - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', }); @@ -541,7 +541,7 @@ describe('code', () => { }); }); -function defineFunction(code: lambda.Code, runtime: lambda.Runtime = lambda.Runtime.NODEJS_10_X) { +function defineFunction(code: lambda.Code, runtime: lambda.Runtime = lambda.Runtime.NODEJS_14_X) { const stack = new cdk.Stack(); return new lambda.Function(stack, 'Func', { handler: 'foom', diff --git a/packages/@aws-cdk/aws-lambda/test/function-hash.test.ts b/packages/@aws-cdk/aws-lambda/test/function-hash.test.ts index 4fcc5b4ed33f9..3862406118e7f 100644 --- a/packages/@aws-cdk/aws-lambda/test/function-hash.test.ts +++ b/packages/@aws-cdk/aws-lambda/test/function-hash.test.ts @@ -92,7 +92,7 @@ describe('function hash', () => { const stack2 = new Stack(); const fn2 = new lambda.Function(stack2, 'MyFunction', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromAsset(path.join(__dirname, 'my-lambda-handler')), handler: 'index.handler', environment: { @@ -114,7 +114,7 @@ describe('function hash', () => { const stack2 = new Stack(); const fn2 = new lambda.Function(stack2, 'MyFunction', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromInline('foo bar'), handler: 'index.handler', }); diff --git a/packages/@aws-cdk/aws-lambda/test/function-url.test.ts b/packages/@aws-cdk/aws-lambda/test/function-url.test.ts index 0cd4a2b74f687..eb8ccd2e337d6 100644 --- a/packages/@aws-cdk/aws-lambda/test/function-url.test.ts +++ b/packages/@aws-cdk/aws-lambda/test/function-url.test.ts @@ -10,7 +10,7 @@ describe('FunctionUrl', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // WHEN @@ -36,7 +36,7 @@ describe('FunctionUrl', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // WHEN @@ -94,7 +94,7 @@ describe('FunctionUrl', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const alias = new lambda.Alias(stack, 'Alias', { aliasName: 'prod', @@ -121,7 +121,7 @@ describe('FunctionUrl', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const version = new lambda.Version(stack, 'Version', { lambda: fn, @@ -146,7 +146,7 @@ describe('FunctionUrl', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const fnUrl = new lambda.FunctionUrl(stack, 'FunctionUrl', { function: fn, diff --git a/packages/@aws-cdk/aws-lambda/test/function.test.ts b/packages/@aws-cdk/aws-lambda/test/function.test.ts index c644e59a70e03..f53bae1d56c52 100644 --- a/packages/@aws-cdk/aws-lambda/test/function.test.ts +++ b/packages/@aws-cdk/aws-lambda/test/function.test.ts @@ -26,7 +26,7 @@ describe('function', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); Template.fromStack(stack).hasResourceProperties('AWS::IAM::Role', { @@ -61,7 +61,7 @@ describe('function', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, initialPolicy: [new iam.PolicyStatement({ actions: ['*'], resources: ['*'] })], }); Template.fromStack(stack).hasResourceProperties('AWS::IAM::Role', { @@ -639,7 +639,7 @@ describe('function', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, functionName: 'OneFunctionToRuleThemAll', deadLetterQueueEnabled: true, }); @@ -731,7 +731,7 @@ describe('function', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, deadLetterQueueEnabled: true, }); @@ -757,7 +757,7 @@ describe('function', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, deadLetterQueueEnabled: false, }); @@ -787,7 +787,7 @@ describe('function', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, deadLetterQueue: dlQueue, }); @@ -832,7 +832,7 @@ describe('function', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, deadLetterQueueEnabled: true, deadLetterQueue: dlQueue, }); @@ -878,7 +878,7 @@ describe('function', () => { expect(() => new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, deadLetterQueueEnabled: false, deadLetterQueue: dlQueue, })).toThrow(/deadLetterQueue defined but deadLetterQueueEnabled explicitly set to false/); @@ -892,7 +892,7 @@ describe('function', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, deadLetterTopic: dlTopic, }); @@ -927,7 +927,7 @@ describe('function', () => { expect(() => new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, deadLetterQueueEnabled: false, deadLetterTopic: dlTopic, })).toThrow(/deadLetterQueue and deadLetterTopic cannot be specified together at the same time/); @@ -941,7 +941,7 @@ describe('function', () => { expect(() => new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, deadLetterQueueEnabled: true, deadLetterTopic: dlTopic, })).toThrow(/deadLetterQueue and deadLetterTopic cannot be specified together at the same time/); @@ -956,7 +956,7 @@ describe('function', () => { expect(() => new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, deadLetterQueue: dlQueue, deadLetterTopic: dlTopic, })).toThrow(/deadLetterQueue and deadLetterTopic cannot be specified together at the same time/); @@ -968,7 +968,7 @@ describe('function', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, tracing: lambda.Tracing.ACTIVE, }); @@ -1024,7 +1024,7 @@ describe('function', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, tracing: lambda.Tracing.PASS_THROUGH, }); @@ -1080,7 +1080,7 @@ describe('function', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, tracing: lambda.Tracing.DISABLED, }); @@ -1132,7 +1132,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.fromInline('xxx'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // WHEN @@ -1162,7 +1162,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.fromInline('xxx'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const service = new iam.ServicePrincipal('apigateway.amazonaws.com'); @@ -1188,7 +1188,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.fromInline('xxx'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const account = new iam.AccountPrincipal('123456789012'); @@ -1214,7 +1214,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.fromInline('xxx'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const account = new iam.ArnPrincipal('arn:aws:iam::123456789012:role/someRole'); @@ -1240,7 +1240,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.fromInline('xxx'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const service = new iam.ServicePrincipal('elasticloadbalancing.amazonaws.com'); @@ -1269,7 +1269,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.fromInline('xxx'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // WHEN @@ -1301,7 +1301,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.fromInline('xxx'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // WHEN @@ -1402,7 +1402,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.fromInline('xxx'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // THEN @@ -1421,7 +1421,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.fromInline('xxx'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); let bindTarget; @@ -1513,7 +1513,7 @@ describe('function', () => { // THEN expect(() => new lambda.Function(stack, 'Function', { layers: [layer], - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromInline('exports.main = function() { console.log("DONE"); }'), handler: 'index.main', })).toThrow(/nodejs10.x is not in \[nodejs12.x\]/); @@ -1524,13 +1524,13 @@ describe('function', () => { const stack = new cdk.Stack(undefined, 'TestStack'); const layers = new Array(6).fill(lambda.LayerVersion.fromLayerVersionAttributes(stack, 'TestLayer', { layerVersionArn: 'arn:aws:...', - compatibleRuntimes: [lambda.Runtime.NODEJS_10_X], + compatibleRuntimes: [lambda.Runtime.NODEJS_14_X], })); // THEN expect(() => new lambda.Function(stack, 'Function', { layers, - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromInline('exports.main = function() { console.log("DONE"); }'), handler: 'index.main', })).toThrow(/Unable to add layer:/); @@ -1614,7 +1614,7 @@ describe('function', () => { // WHEN new lambda.Function(stack, 'fn', { code: lambda.Code.fromInline('boom'), - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.bam', events: [ new EventSource(), @@ -1690,7 +1690,7 @@ describe('function', () => { new lambda.Function(stack, 'fn', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, onFailure: { bind: () => ({ destination: 'on-failure-arn' }), }, @@ -1726,7 +1726,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'fn', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, maxEventAge: cdk.Duration.hours(1), }); @@ -1760,7 +1760,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'fn', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // WHEN @@ -1891,7 +1891,7 @@ describe('function', () => { // WHEN/THEN expect(() => new lambda.Function(stack, 'fn', { handler: 'foo', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromInline(''), })).toThrow(/Lambda inline code cannot be empty/); }); @@ -1900,7 +1900,7 @@ describe('function', () => { const stack = new cdk.Stack(); const fn = new lambda.Function(stack, 'fn', { handler: 'foo', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromInline('foo'), }); const logGroup = fn.logGroup; @@ -1918,7 +1918,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'fn', { handler: 'foo', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromInline('foo'), deadLetterQueue: dlQueue, }); @@ -1940,7 +1940,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'fn', { handler: 'foo', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromInline('foo'), deadLetterTopic: dlTopic, }); @@ -1957,7 +1957,7 @@ describe('function', () => { const stack = new cdk.Stack(); const fn = new lambda.Function(stack, 'fn', { handler: 'foo', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromInline('foo'), deadLetterQueueEnabled: true, }); @@ -1974,7 +1974,7 @@ describe('function', () => { const stack = new cdk.Stack(); const fn = new lambda.Function(stack, 'fn', { handler: 'foo', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromInline('foo'), }); const deadLetterQueue = fn.deadLetterQueue; @@ -1988,7 +1988,7 @@ describe('function', () => { const stack = new cdk.Stack(); const fn = new lambda.Function(stack, 'fn', { handler: 'foo', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromInline('foo'), logRetention: logs.RetentionDays.FIVE_DAYS, }); @@ -2015,7 +2015,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const version1 = fn.latestVersion; @@ -2043,7 +2043,7 @@ describe('function', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, environment: { SOME: 'Variable', }, @@ -2234,7 +2234,7 @@ describe('function', () => { expect(() => new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, profilingGroup: new ProfilingGroup(stack, 'ProfilingGroup'), environment: { AWS_CODEGURU_PROFILER_GROUP_ARN: 'profiler_group_arn', @@ -2580,7 +2580,7 @@ describe('function', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, codeSigningConfig, }); @@ -2745,7 +2745,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // WHEN @@ -2769,7 +2769,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // WHEN @@ -2818,7 +2818,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); fn.addFunctionUrl(); diff --git a/packages/@aws-cdk/aws-lambda/test/lambda-insights.test.ts b/packages/@aws-cdk/aws-lambda/test/lambda-insights.test.ts index ac758ab4be5ad..a2e3f5a9cc484 100644 --- a/packages/@aws-cdk/aws-lambda/test/lambda-insights.test.ts +++ b/packages/@aws-cdk/aws-lambda/test/lambda-insights.test.ts @@ -17,7 +17,7 @@ function functionWithInsightsVersion( functionName: id, code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, architecture, insightsVersion, }); diff --git a/packages/@aws-cdk/aws-lambda/test/lambda-version.test.ts b/packages/@aws-cdk/aws-lambda/test/lambda-version.test.ts index d18e5301d971d..73f18ba033617 100644 --- a/packages/@aws-cdk/aws-lambda/test/lambda-version.test.ts +++ b/packages/@aws-cdk/aws-lambda/test/lambda-version.test.ts @@ -31,7 +31,7 @@ describe('lambda version', () => { // GIVEN const stack = new cdk.Stack(); const fn = new lambda.Function(stack, 'Fn', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('foo'), }); @@ -63,7 +63,7 @@ describe('lambda version', () => { // GIVEN const stack = new cdk.Stack(); const fn = new lambda.Function(stack, 'Fn', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('foo'), }); @@ -108,7 +108,7 @@ describe('lambda version', () => { // GIVEN const stack = new cdk.Stack(); const fn = new lambda.Function(stack, 'Fn', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('foo'), }); @@ -136,7 +136,7 @@ describe('lambda version', () => { // GIVEN const stack = new cdk.Stack(); const fn = new lambda.Function(stack, 'Fn', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('foo'), }); @@ -189,7 +189,7 @@ describe('lambda version', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const version = new lambda.Version(stack, 'Version', { lambda: fn, diff --git a/packages/@aws-cdk/aws-lambda/test/layers.test.ts b/packages/@aws-cdk/aws-lambda/test/layers.test.ts index 5f818c480e2da..302bddf550db5 100644 --- a/packages/@aws-cdk/aws-lambda/test/layers.test.ts +++ b/packages/@aws-cdk/aws-lambda/test/layers.test.ts @@ -15,7 +15,7 @@ describe('layers', () => { // WHEN new lambda.LayerVersion(stack, 'LayerVersion', { code, - compatibleRuntimes: [lambda.Runtime.NODEJS_10_X], + compatibleRuntimes: [lambda.Runtime.NODEJS_14_X], }); // THEN @@ -35,7 +35,7 @@ describe('layers', () => { const code = new lambda.S3Code(bucket, 'ObjectKey'); const layer = new lambda.LayerVersion(stack, 'LayerVersion', { code, - compatibleRuntimes: [lambda.Runtime.NODEJS_10_X], + compatibleRuntimes: [lambda.Runtime.NODEJS_14_X], }); // WHEN diff --git a/packages/@aws-cdk/aws-lambda/test/vpc-lambda.test.ts b/packages/@aws-cdk/aws-lambda/test/vpc-lambda.test.ts index d8ad105edaa6d..f1811b59e8f03 100644 --- a/packages/@aws-cdk/aws-lambda/test/vpc-lambda.test.ts +++ b/packages/@aws-cdk/aws-lambda/test/vpc-lambda.test.ts @@ -21,7 +21,7 @@ describe('lambda + vpc', () => { fn = new lambda.Function(stack, 'Lambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, vpc: vpc, allowAllOutbound: false, }); @@ -47,7 +47,7 @@ describe('lambda + vpc', () => { new lambda.Function(stack, 'LambdaWithCustomSG', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, vpc, securityGroup: new ec2.SecurityGroup(stack, 'CustomSecurityGroupX', { vpc }), }); @@ -70,7 +70,7 @@ describe('lambda + vpc', () => { new lambda.Function(stack, 'LambdaWithCustomSGList', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, vpc, securityGroups: [ new ec2.SecurityGroup(stack, 'CustomSecurityGroupA', { vpc }), @@ -98,7 +98,7 @@ describe('lambda + vpc', () => { new lambda.Function(stack, 'LambdaWithWrongProps', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, vpc, securityGroup: new ec2.SecurityGroup(stack, 'CustomSecurityGroupB', { vpc }), securityGroups: [ @@ -189,7 +189,7 @@ describe('lambda + vpc', () => { const lambdaFn = new lambda.Function(stack, 'Lambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // WHEN @@ -208,7 +208,7 @@ describe('lambda + vpc', () => { allowPublicSubnet: true, code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, vpc, vpcSubnets: { subnetType: ec2.SubnetType.PUBLIC }, }); @@ -236,7 +236,7 @@ describe('lambda + vpc', () => { new lambda.Function(stack, 'PrivateLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, vpc, vpcSubnets: { subnetType: ec2.SubnetType.PRIVATE_WITH_NAT }, }); @@ -272,7 +272,7 @@ describe('lambda + vpc', () => { new lambda.Function(stack, 'IsolatedLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, vpc, vpcSubnets: { subnetType: ec2.SubnetType.PRIVATE_ISOLATED }, }); @@ -317,7 +317,7 @@ describe('lambda + vpc', () => { new lambda.Function(stack, 'PublicLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, vpc, vpcSubnets: { subnetType: ec2.SubnetType.PUBLIC }, }); diff --git a/packages/@aws-cdk/aws-logs-destinations/test/lambda.test.ts b/packages/@aws-cdk/aws-logs-destinations/test/lambda.test.ts index f5a80285c8146..19332cb4de198 100644 --- a/packages/@aws-cdk/aws-logs-destinations/test/lambda.test.ts +++ b/packages/@aws-cdk/aws-logs-destinations/test/lambda.test.ts @@ -14,7 +14,7 @@ beforeEach(() => { fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); logGroup = new logs.LogGroup(stack, 'LogGroup'); }); diff --git a/packages/@aws-cdk/aws-rds/test/instance.test.ts b/packages/@aws-cdk/aws-rds/test/instance.test.ts index 695342f02f255..8ddc2b92dd697 100644 --- a/packages/@aws-cdk/aws-rds/test/instance.test.ts +++ b/packages/@aws-cdk/aws-rds/test/instance.test.ts @@ -505,7 +505,7 @@ describe('instance', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.fromInline('dummy'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // WHEN diff --git a/packages/@aws-cdk/aws-s3-notifications/test/lambda/lambda.test.ts b/packages/@aws-cdk/aws-s3-notifications/test/lambda/lambda.test.ts index d6e563a4438ca..1b886de0f157c 100644 --- a/packages/@aws-cdk/aws-s3-notifications/test/lambda/lambda.test.ts +++ b/packages/@aws-cdk/aws-s3-notifications/test/lambda/lambda.test.ts @@ -9,13 +9,13 @@ test('add notifications to multiple functions', () => { const stack = new Stack(); const bucket = new s3.Bucket(stack, 'MyBucket'); const fn1 = new lambda.Function(stack, 'MyFunction1', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('foo'), }); const fn2 = new lambda.Function(stack, 'MyFunction2', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('foo'), }); @@ -80,7 +80,7 @@ test('lambda in a different stack as notification target', () => { const lambdaFunction = new lambda.Function(lambdaStack, 'lambdaFunction', { code: lambda.Code.fromInline('whatever'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); const bucket = new s3.Bucket(bucketStack, 'bucket'); @@ -121,7 +121,7 @@ test('lambda as notification target', () => { const stack = new Stack(); const bucketA = new s3.Bucket(stack, 'MyBucket'); const fn = new lambda.Function(stack, 'MyFunction', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('foo'), }); @@ -188,7 +188,7 @@ test('permissions are added as a dependency to the notifications resource when u const bucket = new s3.Bucket(stack, 'MyBucket'); const fn = new lambda.SingletonFunction(stack, 'MyFunction', { uuid: 'uuid', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('foo'), }); @@ -208,7 +208,7 @@ test('add multiple event notifications using a singleton function', () => { const bucket = new s3.Bucket(stack, 'MyBucket'); const fn = new lambda.SingletonFunction(stack, 'MyFunction', { uuid: 'uuid', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('foo'), }); diff --git a/packages/@aws-cdk/aws-secretsmanager/test/rotation-schedule.test.ts b/packages/@aws-cdk/aws-secretsmanager/test/rotation-schedule.test.ts index 26f4ad5a753f5..bd183b8d89291 100644 --- a/packages/@aws-cdk/aws-secretsmanager/test/rotation-schedule.test.ts +++ b/packages/@aws-cdk/aws-secretsmanager/test/rotation-schedule.test.ts @@ -15,7 +15,7 @@ test('create a rotation schedule with a rotation Lambda', () => { // GIVEN const secret = new secretsmanager.Secret(stack, 'Secret'); const rotationLambda = new lambda.Function(stack, 'Lambda', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromInline('export.handler = event => event;'), handler: 'index.handler', }); @@ -47,7 +47,7 @@ test('assign permissions for rotation schedule with a rotation Lambda', () => { // GIVEN const secret = new secretsmanager.Secret(stack, 'Secret'); const rotationLambda = new lambda.Function(stack, 'Lambda', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromInline('export.handler = event => event;'), handler: 'index.handler', }); @@ -106,7 +106,7 @@ test('grants correct permissions for secret imported by name', () => { // GIVEN const secret = secretsmanager.Secret.fromSecretNameV2(stack, 'Secret', 'mySecretName'); const rotationLambda = new lambda.Function(stack, 'Lambda', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromInline('export.handler = event => event;'), handler: 'index.handler', }); @@ -158,7 +158,7 @@ test('assign kms permissions for rotation schedule with a rotation Lambda', () = const encryptionKey = new kms.Key(stack, 'Key'); const secret = new secretsmanager.Secret(stack, 'Secret', { encryptionKey }); const rotationLambda = new lambda.Function(stack, 'Lambda', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromInline('export.handler = event => event;'), handler: 'index.handler', }); @@ -523,7 +523,7 @@ describe('manual rotations', () => { const localStack = new cdk.Stack(); const secret = new secretsmanager.Secret(localStack, 'Secret'); const rotationLambda = new lambda.Function(localStack, 'Lambda', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromInline('export.handler = event => event;'), handler: 'index.handler', }); diff --git a/packages/@aws-cdk/aws-secretsmanager/test/secret.test.ts b/packages/@aws-cdk/aws-secretsmanager/test/secret.test.ts index 0e9fad7d6eecb..91935fdf59330 100644 --- a/packages/@aws-cdk/aws-secretsmanager/test/secret.test.ts +++ b/packages/@aws-cdk/aws-secretsmanager/test/secret.test.ts @@ -1209,7 +1209,7 @@ test('add a rotation schedule to an attached secret', () => { }), }); const rotationLambda = new lambda.Function(stack, 'Lambda', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromInline('export.handler = event => event;'), handler: 'index.handler', }); diff --git a/packages/@aws-cdk/aws-ses-actions/test/actions.test.ts b/packages/@aws-cdk/aws-ses-actions/test/actions.test.ts index 845f99c963aa7..1c278eb93c92f 100644 --- a/packages/@aws-cdk/aws-ses-actions/test/actions.test.ts +++ b/packages/@aws-cdk/aws-ses-actions/test/actions.test.ts @@ -85,7 +85,7 @@ test('add lambda action', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.fromInline('boom'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); rule.addAction(new actions.Lambda({ diff --git a/packages/@aws-cdk/aws-sns-subscriptions/test/subs.test.ts b/packages/@aws-cdk/aws-sns-subscriptions/test/subs.test.ts index 546fe9a3c6dae..d13361eb2ba9f 100644 --- a/packages/@aws-cdk/aws-sns-subscriptions/test/subs.test.ts +++ b/packages/@aws-cdk/aws-sns-subscriptions/test/subs.test.ts @@ -1060,7 +1060,7 @@ test('encrypted queue subscription', () => { test('lambda subscription', () => { const fction = new lambda.Function(stack, 'MyFunc', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('exports.handler = function(e, c, cb) { return cb() }'), }); @@ -1171,7 +1171,7 @@ test('lambda subscription, cross region env agnostic', () => { displayName: 'displayName', }); const fction = new lambda.Function(lambdaStack, 'MyFunc', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('exports.handler = function(e, c, cb) { return cb() }'), }); @@ -1285,7 +1285,7 @@ test('lambda subscription, cross region', () => { displayName: 'displayName', }); const fction = new lambda.Function(lambdaStack, 'MyFunc', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('exports.handler = function(e, c, cb) { return cb() }'), }); @@ -1571,7 +1571,7 @@ test('email and url subscriptions with unresolved - four subscriptions', () => { test('multiple subscriptions', () => { const queue = new sqs.Queue(stack, 'MyQueue'); const func = new lambda.Function(stack, 'MyFunc', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('exports.handler = function(e, c, cb) { return cb() }'), }); @@ -1739,7 +1739,7 @@ test('throws with mutliple subscriptions of the same subscriber', () => { test('with filter policy', () => { const fction = new lambda.Function(stack, 'MyFunc', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('exports.handler = function(e, c, cb) { return cb() }'), }); @@ -1818,7 +1818,7 @@ test('region property on an imported topic as a parameter - sqs', () => { test('region property is present on an imported topic - lambda', () => { const imported = sns.Topic.fromTopicArn(stack, 'mytopic', 'arn:aws:sns:us-east-1:1234567890:mytopic'); const func = new lambda.Function(stack, 'MyFunc', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('exports.handler = function(e, c, cb) { return cb() }'), }); @@ -1833,7 +1833,7 @@ test('region property on an imported topic as a parameter - lambda', () => { const topicArn = new CfnParameter(stack, 'topicArn'); const imported = sns.Topic.fromTopicArn(stack, 'mytopic', topicArn.valueAsString); const func = new lambda.Function(stack, 'MyFunc', { - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, handler: 'index.handler', code: lambda.Code.fromInline('exports.handler = function(e, c, cb) { return cb() }'), }); diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/evaluate-expression.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/evaluate-expression.ts index b60128e366031..1ff79b7f5e542 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/evaluate-expression.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/evaluate-expression.ts @@ -100,13 +100,13 @@ function createEvalFn(runtime: lambda.Runtime, scope: Construct) { const nodeJsGuids = { [lambda.Runtime.NODEJS_14_X.name]: 'da2d1181-604e-4a45-8694-1a6abd7fe42d', [lambda.Runtime.NODEJS_12_X.name]: '2b81e383-aad2-44db-8aaf-b4809ae0e3b4', - [lambda.Runtime.NODEJS_10_X.name]: 'a0d2ce44-871b-4e74-87a1-f5e63d7c3bdc', + [lambda.Runtime.NODEJS_14_X.name]: 'a0d2ce44-871b-4e74-87a1-f5e63d7c3bdc', }; switch (runtime) { case lambda.Runtime.NODEJS_14_X: case lambda.Runtime.NODEJS_12_X: - case lambda.Runtime.NODEJS_10_X: + case lambda.Runtime.NODEJS_14_X: const uuid = nodeJsGuids[runtime.name]; if (uuid) { return new lambda.SingletonFunction(scope, 'EvalFunction', { diff --git a/packages/@aws-cdk/custom-resources/test/provider-framework/provider.test.ts b/packages/@aws-cdk/custom-resources/test/provider-framework/provider.test.ts index ecab3a86edc7a..a7188f5ec596b 100644 --- a/packages/@aws-cdk/custom-resources/test/provider-framework/provider.test.ts +++ b/packages/@aws-cdk/custom-resources/test/provider-framework/provider.test.ts @@ -21,12 +21,12 @@ test('security groups are applied to all framework functions', () => { onEventHandler: new lambda.Function(stack, 'OnEvent', { code: lambda.Code.fromInline('foo'), handler: 'index.onEvent', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }), isCompleteHandler: new lambda.Function(stack, 'IsComplete', { code: lambda.Code.fromInline('foo'), handler: 'index.isComplete', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }), vpc: vpc, vpcSubnets: { subnetType: ec2.SubnetType.PRIVATE_WITH_NAT }, @@ -89,12 +89,12 @@ test('vpc is applied to all framework functions', () => { onEventHandler: new lambda.Function(stack, 'OnEvent', { code: lambda.Code.fromInline('foo'), handler: 'index.onEvent', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }), isCompleteHandler: new lambda.Function(stack, 'IsComplete', { code: lambda.Code.fromInline('foo'), handler: 'index.isComplete', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }), vpc: vpc, vpcSubnets: { subnetType: ec2.SubnetType.PRIVATE_WITH_NAT }, @@ -141,7 +141,7 @@ test('minimal setup', () => { onEventHandler: new lambda.Function(stack, 'MyHandler', { code: lambda.Code.fromAsset(path.join(__dirname, './integration-test-fixtures/s3-file-handler')), handler: 'index.onEvent', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }), }); @@ -173,7 +173,7 @@ test('if isComplete is specified, the isComplete framework handler is also inclu const handler = new lambda.Function(stack, 'MyHandler', { code: lambda.Code.fromAsset(path.join(__dirname, './integration-test-fixtures/s3-file-handler')), handler: 'index.onEvent', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // WHEN @@ -247,7 +247,7 @@ test('fails if "queryInterval" and/or "totalTimeout" are set without "isComplete const handler = new lambda.Function(stack, 'MyHandler', { code: lambda.Code.fromAsset(path.join(__dirname, './integration-test-fixtures/s3-file-handler')), handler: 'index.onEvent', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }); // THEN @@ -303,7 +303,7 @@ describe('log retention', () => { onEventHandler: new lambda.Function(stack, 'MyHandler', { code: lambda.Code.fromAsset(path.join(__dirname, './integration-test-fixtures/s3-file-handler')), handler: 'index.onEvent', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }), logRetention: logs.RetentionDays.ONE_WEEK, }); @@ -334,7 +334,7 @@ describe('log retention', () => { onEventHandler: new lambda.Function(stack, 'MyHandler', { code: lambda.Code.fromAsset(path.join(__dirname, './integration-test-fixtures/s3-file-handler')), handler: 'index.onEvent', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }), }); @@ -353,7 +353,7 @@ describe('role', () => { onEventHandler: new lambda.Function(stack, 'MyHandler', { code: lambda.Code.fromAsset(path.join(__dirname, './integration-test-fixtures/s3-file-handler')), handler: 'index.onEvent', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }), role: new iam.Role(stack, 'MyRole', { assumedBy: new iam.ServicePrincipal('lambda.amazonaws.com'), @@ -381,7 +381,7 @@ describe('role', () => { onEventHandler: new lambda.Function(stack, 'MyHandler', { code: lambda.Code.fromAsset(path.join(__dirname, './integration-test-fixtures/s3-file-handler')), handler: 'index.onEvent', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }), }); @@ -408,7 +408,7 @@ describe('name', () => { onEventHandler: new lambda.Function(stack, 'MyHandler', { code: lambda.Code.fromAsset(path.join(__dirname, './integration-test-fixtures/s3-file-handler')), handler: 'index.onEvent', - runtime: lambda.Runtime.NODEJS_10_X, + runtime: lambda.Runtime.NODEJS_14_X, }), providerFunctionName, }); From e54576947a13aac59f9cc3647b4fd72d79f798d8 Mon Sep 17 00:00:00 2001 From: Elena Naum Date: Wed, 1 Jun 2022 14:25:15 +0200 Subject: [PATCH 2/2] feat(lambda): Migrate NODEJS_10_X to NODEJS_14_X --- .../test-with-snapshot-assets-diff.integ.snapshot/manifest.json | 2 +- .../test-with-snapshot-assets.integ.snapshot/manifest.json | 2 +- .../test-data/test-with-snapshot.integ.snapshot/manifest.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/@aws-cdk/integ-runner/test/test-data/test-with-snapshot-assets-diff.integ.snapshot/manifest.json b/packages/@aws-cdk/integ-runner/test/test-data/test-with-snapshot-assets-diff.integ.snapshot/manifest.json index d1c7a0ea225c1..d5518ce4bd0e1 100644 --- a/packages/@aws-cdk/integ-runner/test/test-data/test-with-snapshot-assets-diff.integ.snapshot/manifest.json +++ b/packages/@aws-cdk/integ-runner/test/test-data/test-with-snapshot-assets-diff.integ.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "19.0.0", + "version": "20.0.0", "artifacts": { "Tree": { "type": "cdk:tree", diff --git a/packages/@aws-cdk/integ-runner/test/test-data/test-with-snapshot-assets.integ.snapshot/manifest.json b/packages/@aws-cdk/integ-runner/test/test-data/test-with-snapshot-assets.integ.snapshot/manifest.json index 8ef72f9af40ea..7c2c6d4d8cdce 100644 --- a/packages/@aws-cdk/integ-runner/test/test-data/test-with-snapshot-assets.integ.snapshot/manifest.json +++ b/packages/@aws-cdk/integ-runner/test/test-data/test-with-snapshot-assets.integ.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "19.0.0", + "version": "20.0.0", "artifacts": { "Tree": { "type": "cdk:tree", diff --git a/packages/@aws-cdk/integ-runner/test/test-data/test-with-snapshot.integ.snapshot/manifest.json b/packages/@aws-cdk/integ-runner/test/test-data/test-with-snapshot.integ.snapshot/manifest.json index bc0e09d1ce230..7b8ed0311e8f0 100644 --- a/packages/@aws-cdk/integ-runner/test/test-data/test-with-snapshot.integ.snapshot/manifest.json +++ b/packages/@aws-cdk/integ-runner/test/test-data/test-with-snapshot.integ.snapshot/manifest.json @@ -1,5 +1,5 @@ { - "version": "19.0.0", + "version": "20.0.0", "artifacts": { "Tree": { "type": "cdk:tree",