From b25c7a23c28c5d4e93ca56dbf8b5a8ff544d8501 Mon Sep 17 00:00:00 2001 From: robertd Date: Tue, 14 May 2019 16:46:45 -0600 Subject: [PATCH 1/2] feat(lambda): add nodejs10x runtime and update tests --- .../test/integ.restapi.books.expected.json | 6 +-- .../test/integ.restapi.books.ts | 6 +-- .../test/integ.restapi.expected.json | 2 +- .../aws-apigateway/test/integ.restapi.ts | 2 +- .../aws-apigateway/test/test.lambda-api.ts | 8 ++-- .../aws-apigateway/test/test.lambda.ts | 6 +-- .../test/integ.lambda-pipeline.expected.json | 2 +- .../test/integ.lambda-pipeline.ts | 2 +- .../test/test.pipeline.ts | 2 +- .../aws-cognito/test/test.user-pool.ts | 6 +-- .../test/lambda/integ.events.expected.json | 2 +- .../test/lambda/integ.events.ts | 2 +- packages/@aws-cdk/aws-lambda/lib/runtime.ts | 1 + .../integ.bucket-notifications.expected.json | 2 +- .../test/integ.bucket-notifications.ts | 2 +- .../test/integ.lambda.expected.json | 2 +- .../@aws-cdk/aws-lambda/test/integ.lambda.ts | 2 +- .../@aws-cdk/aws-lambda/test/test.alias.ts | 14 +++--- .../@aws-cdk/aws-lambda/test/test.code.ts | 2 +- .../@aws-cdk/aws-lambda/test/test.lambda.ts | 46 +++++++++---------- .../test/test.subscriptiondestination.ts | 2 +- .../aws-lambda/test/test.vpc-lambda.ts | 6 +-- packages/@aws-cdk/aws-sns/test/test.sns.ts | 8 ++-- .../test/integ.rtv.lambda.expected.json | 2 +- .../runtime-values/test/integ.rtv.lambda.ts | 2 +- .../@aws-cdk/runtime-values/test/test.rtv.ts | 2 +- 26 files changed, 70 insertions(+), 69 deletions(-) diff --git a/packages/@aws-cdk/aws-apigateway/test/integ.restapi.books.expected.json b/packages/@aws-cdk/aws-apigateway/test/integ.restapi.books.expected.json index 0baf839a608ca..93f3524ea8a44 100644 --- a/packages/@aws-cdk/aws-apigateway/test/integ.restapi.books.expected.json +++ b/packages/@aws-cdk/aws-apigateway/test/integ.restapi.books.expected.json @@ -54,7 +54,7 @@ "Arn" ] }, - "Runtime": "nodejs6.10" + "Runtime": "nodejs8.10" }, "DependsOn": [ "BooksHandlerServiceRole5B6A8847" @@ -270,7 +270,7 @@ "Arn" ] }, - "Runtime": "nodejs6.10" + "Runtime": "nodejs8.10" }, "DependsOn": [ "BookHandlerServiceRole894768AD" @@ -486,7 +486,7 @@ "Arn" ] }, - "Runtime": "nodejs6.10" + "Runtime": "nodejs8.10" }, "DependsOn": [ "HelloServiceRole1E55EA16" diff --git a/packages/@aws-cdk/aws-apigateway/test/integ.restapi.books.ts b/packages/@aws-cdk/aws-apigateway/test/integ.restapi.books.ts index 783459ebb6009..93c6ca50713c0 100644 --- a/packages/@aws-cdk/aws-apigateway/test/integ.restapi.books.ts +++ b/packages/@aws-cdk/aws-apigateway/test/integ.restapi.books.ts @@ -7,19 +7,19 @@ class BookStack extends cdk.Stack { super(scope, id); const booksHandler = new apigw.LambdaIntegration(new lambda.Function(this, 'BooksHandler', { - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, handler: 'index.handler', code: lambda.Code.inline(`exports.handler = ${echoHandlerCode}`) })); const bookHandler = new apigw.LambdaIntegration(new lambda.Function(this, 'BookHandler', { - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, handler: 'index.handler', code: lambda.Code.inline(`exports.handler = ${echoHandlerCode}`) })); const hello = new apigw.LambdaIntegration(new lambda.Function(this, 'Hello', { - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, handler: 'index.handler', code: lambda.Code.inline(`exports.handler = ${helloCode}`) })); diff --git a/packages/@aws-cdk/aws-apigateway/test/integ.restapi.expected.json b/packages/@aws-cdk/aws-apigateway/test/integ.restapi.expected.json index c46e8005d766f..7e095288177d3 100644 --- a/packages/@aws-cdk/aws-apigateway/test/integ.restapi.expected.json +++ b/packages/@aws-cdk/aws-apigateway/test/integ.restapi.expected.json @@ -384,7 +384,7 @@ "Arn" ] }, - "Runtime": "nodejs6.10" + "Runtime": "nodejs8.10" }, "DependsOn": [ "MyHandlerServiceRoleFFA06653" diff --git a/packages/@aws-cdk/aws-apigateway/test/integ.restapi.ts b/packages/@aws-cdk/aws-apigateway/test/integ.restapi.ts index d81e9ac3ccea1..60c3fb55b437c 100644 --- a/packages/@aws-cdk/aws-apigateway/test/integ.restapi.ts +++ b/packages/@aws-cdk/aws-apigateway/test/integ.restapi.ts @@ -23,7 +23,7 @@ class Test extends cdk.Stack { }); const handler = new lambda.Function(this, 'MyHandler', { - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, code: lambda.Code.inline(`exports.handler = ${handlerCode}`), handler: 'index.handler', }); diff --git a/packages/@aws-cdk/aws-apigateway/test/test.lambda-api.ts b/packages/@aws-cdk/aws-apigateway/test/test.lambda-api.ts index 5a16869d06149..48216e0a353cc 100644 --- a/packages/@aws-cdk/aws-apigateway/test/test.lambda-api.ts +++ b/packages/@aws-cdk/aws-apigateway/test/test.lambda-api.ts @@ -14,7 +14,7 @@ export = { const handler = new lambda.Function(stack, 'handler', { handler: 'index.handler', code: lambda.Code.inline('boom'), - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, }); // WHEN @@ -78,7 +78,7 @@ export = { const handler = new lambda.Function(stack, 'handler', { handler: 'index.handler', code: lambda.Code.inline('boom'), - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, }); const alias = new lambda.Alias(stack, 'alias', { aliasName: 'my-alias', @@ -145,7 +145,7 @@ export = { const handler = new lambda.Function(stack, 'handler', { handler: 'index.handler', code: lambda.Code.inline('boom'), - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, }); // WHEN @@ -184,7 +184,7 @@ export = { const handler = new lambda.Function(stack, 'handler', { handler: 'index.handler', code: lambda.Code.inline('boom'), - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, }); test.throws(() => new apigw.LambdaRestApi(stack, 'lambda-rest-api', { diff --git a/packages/@aws-cdk/aws-apigateway/test/test.lambda.ts b/packages/@aws-cdk/aws-apigateway/test/test.lambda.ts index a2997316d50aa..8a656c4542001 100644 --- a/packages/@aws-cdk/aws-apigateway/test/test.lambda.ts +++ b/packages/@aws-cdk/aws-apigateway/test/test.lambda.ts @@ -56,7 +56,7 @@ export = { // GIVEN const stack = new cdk.Stack(); const fn = new lambda.Function(stack, 'Handler', { - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, code: lambda.Code.inline('foo'), handler: 'index.handler' }); @@ -106,7 +106,7 @@ export = { // GIVEN const stack = new cdk.Stack(); const fn = new lambda.Function(stack, 'Handler', { - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, code: lambda.Code.inline('foo'), handler: 'index.handler' }); @@ -132,7 +132,7 @@ export = { const api = new apigateway.RestApi(stack, 'test-api'); const handler = new lambda.Function(stack, 'MyFunc', { - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, handler: 'index.handler', code: lambda.Code.inline(``) }); diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-pipeline.expected.json b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-pipeline.expected.json index 63f6c7e3817f2..95e2c143571f5 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-pipeline.expected.json +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-pipeline.expected.json @@ -658,7 +658,7 @@ "Arn" ] }, - "Runtime": "nodejs6.10" + "Runtime": "nodejs8.10" }, "DependsOn": [ "LambdaFunServiceRoleDefaultPolicy217FED83", diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-pipeline.ts b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-pipeline.ts index c98510d3c392f..b5742cc222477 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-pipeline.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-pipeline.ts @@ -34,7 +34,7 @@ const lambdaFun = new lambda.Function(stack, 'LambdaFun', { }; `), handler: 'index.handler', - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, }); const lambdaStage = pipeline.addStage({ name: 'Lambda' }); lambdaStage.addAction(new cpactions.LambdaInvokeAction({ diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/test.pipeline.ts b/packages/@aws-cdk/aws-codepipeline-actions/test/test.pipeline.ts index 1bba1fd738244..afe45b320f0bc 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/test.pipeline.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/test.pipeline.ts @@ -434,7 +434,7 @@ export = { const lambdaFun = new lambda.Function(stack, 'Function', { code: new lambda.InlineCode('bla'), handler: 'index.handler', - runtime: lambda.Runtime.NodeJS43, + runtime: lambda.Runtime.NodeJS810, }); const pipeline = new codepipeline.Pipeline(stack, 'Pipeline'); diff --git a/packages/@aws-cdk/aws-cognito/test/test.user-pool.ts b/packages/@aws-cdk/aws-cognito/test/test.user-pool.ts index 11c92b4669180..10b2fa45711f8 100644 --- a/packages/@aws-cdk/aws-cognito/test/test.user-pool.ts +++ b/packages/@aws-cdk/aws-cognito/test/test.user-pool.ts @@ -28,7 +28,7 @@ export = { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, }); // WHEN @@ -56,7 +56,7 @@ export = { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, }); // WHEN @@ -93,7 +93,7 @@ export = { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, }); // WHEN diff --git a/packages/@aws-cdk/aws-events-targets/test/lambda/integ.events.expected.json b/packages/@aws-cdk/aws-events-targets/test/lambda/integ.events.expected.json index f71081e3ff084..9e2df8005f1c4 100644 --- a/packages/@aws-cdk/aws-events-targets/test/lambda/integ.events.expected.json +++ b/packages/@aws-cdk/aws-events-targets/test/lambda/integ.events.expected.json @@ -54,7 +54,7 @@ "Arn" ] }, - "Runtime": "nodejs6.10" + "Runtime": "nodejs8.10" }, "DependsOn": [ "MyFuncServiceRole54065130" diff --git a/packages/@aws-cdk/aws-events-targets/test/lambda/integ.events.ts b/packages/@aws-cdk/aws-events-targets/test/lambda/integ.events.ts index c815efec9a00f..6ed768e89a61d 100644 --- a/packages/@aws-cdk/aws-events-targets/test/lambda/integ.events.ts +++ b/packages/@aws-cdk/aws-events-targets/test/lambda/integ.events.ts @@ -8,7 +8,7 @@ const app = new cdk.App(); const stack = new cdk.Stack(app, 'lambda-events'); const fn = new lambda.Function(stack, 'MyFunc', { - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, handler: 'index.handler', code: lambda.Code.inline(`exports.handler = ${handler.toString()}`) }); diff --git a/packages/@aws-cdk/aws-lambda/lib/runtime.ts b/packages/@aws-cdk/aws-lambda/lib/runtime.ts index 23c4ec38f01e2..809938cf4b9a6 100644 --- a/packages/@aws-cdk/aws-lambda/lib/runtime.ts +++ b/packages/@aws-cdk/aws-lambda/lib/runtime.ts @@ -30,6 +30,7 @@ export class Runtime { public static readonly NodeJS43 = new Runtime('nodejs4.3', RuntimeFamily.NodeJS, { supportsInlineCode: true }); public static readonly NodeJS610 = new Runtime('nodejs6.10', RuntimeFamily.NodeJS, { supportsInlineCode: true }); public static readonly NodeJS810 = new Runtime('nodejs8.10', RuntimeFamily.NodeJS, { supportsInlineCode: true }); + public static readonly NodeJS10x = new Runtime('nodejs10.x', RuntimeFamily.NodeJS, { supportsInlineCode: false }); public static readonly Python27 = new Runtime('python2.7', RuntimeFamily.Python, { supportsInlineCode: true }); public static readonly Python36 = new Runtime('python3.6', RuntimeFamily.Python, { supportsInlineCode: true }); public static readonly Python37 = new Runtime('python3.7', RuntimeFamily.Python, { supportsInlineCode: true }); diff --git a/packages/@aws-cdk/aws-lambda/test/integ.bucket-notifications.expected.json b/packages/@aws-cdk/aws-lambda/test/integ.bucket-notifications.expected.json index 738b14605a43c..9c3ab42650608 100644 --- a/packages/@aws-cdk/aws-lambda/test/integ.bucket-notifications.expected.json +++ b/packages/@aws-cdk/aws-lambda/test/integ.bucket-notifications.expected.json @@ -99,7 +99,7 @@ "Arn" ] }, - "Runtime": "nodejs6.10" + "Runtime": "nodejs8.10" }, "DependsOn": [ "MyFunctionServiceRole3C357FF2" diff --git a/packages/@aws-cdk/aws-lambda/test/integ.bucket-notifications.ts b/packages/@aws-cdk/aws-lambda/test/integ.bucket-notifications.ts index 6898b68d48336..eeb14db4809f1 100644 --- a/packages/@aws-cdk/aws-lambda/test/integ.bucket-notifications.ts +++ b/packages/@aws-cdk/aws-lambda/test/integ.bucket-notifications.ts @@ -11,7 +11,7 @@ const bucketA = new s3.Bucket(stack, 'MyBucket', { }); const fn = new lambda.Function(stack, 'MyFunction', { - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, handler: 'index.handler', code: lambda.Code.inline(`exports.handler = ${handler.toString()}`) }); diff --git a/packages/@aws-cdk/aws-lambda/test/integ.lambda.expected.json b/packages/@aws-cdk/aws-lambda/test/integ.lambda.expected.json index eac87632a5aa2..2e397aba640bc 100644 --- a/packages/@aws-cdk/aws-lambda/test/integ.lambda.expected.json +++ b/packages/@aws-cdk/aws-lambda/test/integ.lambda.expected.json @@ -75,7 +75,7 @@ "Arn" ] }, - "Runtime": "nodejs6.10" + "Runtime": "nodejs8.10" }, "DependsOn": [ "MyLambdaServiceRoleDefaultPolicy5BBC6F68", diff --git a/packages/@aws-cdk/aws-lambda/test/integ.lambda.ts b/packages/@aws-cdk/aws-lambda/test/integ.lambda.ts index e76b4f90121a8..c5d5979197641 100644 --- a/packages/@aws-cdk/aws-lambda/test/integ.lambda.ts +++ b/packages/@aws-cdk/aws-lambda/test/integ.lambda.ts @@ -9,7 +9,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.NodeJS610, + runtime: lambda.Runtime.NodeJS810, }); fn.addToRolePolicy(new iam.PolicyStatement().addAllResources().addAction('*')); diff --git a/packages/@aws-cdk/aws-lambda/test/test.alias.ts b/packages/@aws-cdk/aws-lambda/test/test.alias.ts index 2ffeb46f6219c..d5ee321959f9a 100644 --- a/packages/@aws-cdk/aws-lambda/test/test.alias.ts +++ b/packages/@aws-cdk/aws-lambda/test/test.alias.ts @@ -10,7 +10,7 @@ export = { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, }); const version = fn.addVersion('1'); @@ -45,7 +45,7 @@ export = { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, }); const version = fn.newVersion(); @@ -73,7 +73,7 @@ export = { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, }); const version1 = fn.addVersion('1'); @@ -106,7 +106,7 @@ export = { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, }); const version = fn.addVersion('1'); @@ -137,7 +137,7 @@ export = { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, }); const version = fn.addVersion('1'); @@ -187,7 +187,7 @@ export = { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, }); const version = fn.addVersion('1'); @@ -206,7 +206,7 @@ export = { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, }); const version = fn.addVersion('1'); diff --git a/packages/@aws-cdk/aws-lambda/test/test.code.ts b/packages/@aws-cdk/aws-lambda/test/test.code.ts index f74809a71fc37..dd03afa3c9630 100644 --- a/packages/@aws-cdk/aws-lambda/test/test.code.ts +++ b/packages/@aws-cdk/aws-lambda/test/test.code.ts @@ -17,7 +17,7 @@ export = { }, 'fails if larger than 4096 bytes'(test: Test) { test.throws( - () => defineFunction(lambda.Code.inline(generateRandomString(4097)), lambda.Runtime.NodeJS610), + () => defineFunction(lambda.Code.inline(generateRandomString(4097)), lambda.Runtime.NodeJS810), /Lambda source is too large, must be <= 4096 but is 4097/); test.done(); } diff --git a/packages/@aws-cdk/aws-lambda/test/test.lambda.ts b/packages/@aws-cdk/aws-lambda/test/test.lambda.ts index a591078948957..5134bc66b62e6 100644 --- a/packages/@aws-cdk/aws-lambda/test/test.lambda.ts +++ b/packages/@aws-cdk/aws-lambda/test/test.lambda.ts @@ -16,7 +16,7 @@ export = { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, }); expect(stack).toMatch({ Resources: @@ -40,7 +40,7 @@ export = { { Code: { ZipFile: 'foo' }, Handler: 'index.handler', Role: { 'Fn::GetAtt': [ 'MyLambdaServiceRole4539ECB6', 'Arn' ] }, - Runtime: 'nodejs6.10' }, + Runtime: 'nodejs8.10' }, DependsOn: [ 'MyLambdaServiceRole4539ECB6' ] } } }); test.done(); }, @@ -50,7 +50,7 @@ export = { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, initialPolicy: [new iam.PolicyStatement().addAction("*").addAllResources()] }); expect(stack).toMatch({ Resources: @@ -94,7 +94,7 @@ export = { { Code: { ZipFile: 'foo' }, Handler: 'index.handler', Role: { 'Fn::GetAtt': [ 'MyLambdaServiceRole4539ECB6', 'Arn' ] }, - Runtime: 'nodejs6.10' }, + Runtime: 'nodejs8.10' }, DependsOn: [ 'MyLambdaServiceRoleDefaultPolicy5BBC6F68', 'MyLambdaServiceRole4539ECB6' ] } } } ); test.done(); @@ -295,7 +295,7 @@ export = { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, functionName: 'OneFunctionToRuleThemAll', deadLetterQueueEnabled: true }); @@ -379,7 +379,7 @@ export = { "Arn" ] }, - "Runtime": "nodejs6.10", + "Runtime": "nodejs8.10", "DeadLetterConfig": { "TargetArn": { "Fn::GetAtt": [ @@ -407,7 +407,7 @@ export = { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, deadLetterQueueEnabled: true, }); @@ -490,7 +490,7 @@ export = { "Arn" ] }, - "Runtime": "nodejs6.10", + "Runtime": "nodejs8.10", "DeadLetterConfig": { "TargetArn": { "Fn::GetAtt": [ @@ -517,7 +517,7 @@ export = { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, deadLetterQueueEnabled: false, }); @@ -568,7 +568,7 @@ export = { "Arn" ] }, - "Runtime": "nodejs6.10" + "Runtime": "nodejs8.10" }, "DependsOn": [ "MyLambdaServiceRole4539ECB6" @@ -591,7 +591,7 @@ export = { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, deadLetterQueue: dlQueue, }); @@ -668,7 +668,7 @@ export = { "Arn" ] }, - "Runtime": "nodejs6.10", + "Runtime": "nodejs8.10", "DeadLetterConfig": { "TargetArn": { "Fn::GetAtt": [ @@ -700,7 +700,7 @@ export = { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, deadLetterQueueEnabled: true, deadLetterQueue: dlQueue, }); @@ -778,7 +778,7 @@ export = { "Arn" ] }, - "Runtime": "nodejs6.10", + "Runtime": "nodejs8.10", "DeadLetterConfig": { "TargetArn": { "Fn::GetAtt": [ @@ -810,7 +810,7 @@ export = { test.throws(() => new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, deadLetterQueueEnabled: false, deadLetterQueue: dlQueue, }), /deadLetterQueue defined but deadLetterQueueEnabled explicitly set to false/); @@ -824,7 +824,7 @@ export = { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, tracing: lambda.Tracing.Active }); @@ -862,7 +862,7 @@ export = { "Arn" ] }, - "Runtime": "nodejs6.10", + "Runtime": "nodejs8.10", "TracingConfig": { "Mode": "Active" } @@ -882,7 +882,7 @@ export = { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, tracing: lambda.Tracing.PassThrough }); @@ -920,7 +920,7 @@ export = { "Arn" ] }, - "Runtime": "nodejs6.10", + "Runtime": "nodejs8.10", "TracingConfig": { "Mode": "PassThrough" } @@ -940,7 +940,7 @@ export = { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, tracing: lambda.Tracing.Disabled }); @@ -978,7 +978,7 @@ export = { "Arn" ] }, - "Runtime": "nodejs6.10" + "Runtime": "nodejs8.10" }, "DependsOn": [ "MyLambdaServiceRole4539ECB6" @@ -1167,11 +1167,11 @@ export = { // THEN test.throws(() => new lambda.Function(stack, 'Function', { layers: [layer], - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS10x, code: lambda.Code.inline('exports.main = function() { console.log("DONE"); }'), handler: 'index.main' }), - /nodejs6.10 is not in \[nodejs8.10\]/); + /nodejs10.x is not in \[nodejs8.10\]/); test.done(); }, diff --git a/packages/@aws-cdk/aws-lambda/test/test.subscriptiondestination.ts b/packages/@aws-cdk/aws-lambda/test/test.subscriptiondestination.ts index f07817c5c22c1..7bf465a8dc6cc 100644 --- a/packages/@aws-cdk/aws-lambda/test/test.subscriptiondestination.ts +++ b/packages/@aws-cdk/aws-lambda/test/test.subscriptiondestination.ts @@ -11,7 +11,7 @@ export = { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, }); const logGroup = new logs.LogGroup(stack, 'LogGroup'); diff --git a/packages/@aws-cdk/aws-lambda/test/test.vpc-lambda.ts b/packages/@aws-cdk/aws-lambda/test/test.vpc-lambda.ts index fb92bbe244c39..96d7d729e634e 100644 --- a/packages/@aws-cdk/aws-lambda/test/test.vpc-lambda.ts +++ b/packages/@aws-cdk/aws-lambda/test/test.vpc-lambda.ts @@ -19,7 +19,7 @@ export = { this.lambda = new lambda.Function(this.stack, 'Lambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, vpc: this.vpc, allowAllOutbound: false }); @@ -114,7 +114,7 @@ export = { const lambdaFn = new lambda.Function(stack, 'Lambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, }); // WHEN @@ -135,7 +135,7 @@ export = { new lambda.Function(stack, 'Lambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, vpc, vpcSubnets: { subnetType: ec2.SubnetType.Public } }); diff --git a/packages/@aws-cdk/aws-sns/test/test.sns.ts b/packages/@aws-cdk/aws-sns/test/test.sns.ts index 4f8d9c0e829c6..e41743627e266 100644 --- a/packages/@aws-cdk/aws-sns/test/test.sns.ts +++ b/packages/@aws-cdk/aws-sns/test/test.sns.ts @@ -279,7 +279,7 @@ export = { }); const fction = new lambda.Function(stack, 'MyFunc', { - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, handler: 'index.handler', code: lambda.Code.inline('exports.handler = function(e, c, cb) { return cb() }') }); @@ -343,7 +343,7 @@ export = { "Arn" ] }, - "Runtime": "nodejs6.10" + "Runtime": "nodejs8.10" }, "DependsOn": [ "MyFuncServiceRole54065130" @@ -416,7 +416,7 @@ export = { const queue = new sqs.Queue(stack, 'MyQueue'); const func = new lambda.Function(stack, 'MyFunc', { - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, handler: 'index.handler', code: lambda.Code.inline('exports.handler = function(e, c, cb) { return cb() }') }); @@ -545,7 +545,7 @@ export = { "Arn" ] }, - "Runtime": "nodejs6.10" + "Runtime": "nodejs8.10" }, "DependsOn": [ "MyFuncServiceRole54065130" diff --git a/packages/@aws-cdk/runtime-values/test/integ.rtv.lambda.expected.json b/packages/@aws-cdk/runtime-values/test/integ.rtv.lambda.expected.json index 794e175f5738d..0875ed9d70338 100644 --- a/packages/@aws-cdk/runtime-values/test/integ.rtv.lambda.expected.json +++ b/packages/@aws-cdk/runtime-values/test/integ.rtv.lambda.expected.json @@ -105,7 +105,7 @@ "Arn" ] }, - "Runtime": "nodejs6.10", + "Runtime": "nodejs8.10", "Environment": { "Variables": { "RTV_STACK_NAME": { diff --git a/packages/@aws-cdk/runtime-values/test/integ.rtv.lambda.ts b/packages/@aws-cdk/runtime-values/test/integ.rtv.lambda.ts index 0c45cf9b4eb33..0475813b94228 100644 --- a/packages/@aws-cdk/runtime-values/test/integ.rtv.lambda.ts +++ b/packages/@aws-cdk/runtime-values/test/integ.rtv.lambda.ts @@ -14,7 +14,7 @@ class TestStack extends cdk.Stack { const queue = new sqs.Queue(this, 'MyQueue'); const fn = new lambda.Function(this, 'MyFunction', { code: lambda.Code.inline(`exports.handler = ${runtimeCode.toString()}`), - runtime: lambda.Runtime.NodeJS610, + runtime: lambda.Runtime.NodeJS810, handler: 'index.handler' }); diff --git a/packages/@aws-cdk/runtime-values/test/test.rtv.ts b/packages/@aws-cdk/runtime-values/test/test.rtv.ts index 05eb8b94625b1..fedb2d533cff0 100644 --- a/packages/@aws-cdk/runtime-values/test/test.rtv.ts +++ b/packages/@aws-cdk/runtime-values/test/test.rtv.ts @@ -29,7 +29,7 @@ class RuntimeValueTest extends cdk.Construct { }); new lambda.CfnFunction(this, 'Function', { - runtime: 'nodejs6.10', + runtime: 'nodejs8.10', handler: 'index.handler', code: { zipFile: ` From bcade1e84650d86561d24e259d482a0428b391d7 Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Thu, 16 May 2019 12:40:44 +0300 Subject: [PATCH 2/2] fix test --- packages/@aws-cdk/aws-lambda/test/test.lambda.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/@aws-cdk/aws-lambda/test/test.lambda.ts b/packages/@aws-cdk/aws-lambda/test/test.lambda.ts index 5134bc66b62e6..8b0a705961824 100644 --- a/packages/@aws-cdk/aws-lambda/test/test.lambda.ts +++ b/packages/@aws-cdk/aws-lambda/test/test.lambda.ts @@ -1167,11 +1167,11 @@ export = { // THEN test.throws(() => new lambda.Function(stack, 'Function', { layers: [layer], - runtime: lambda.Runtime.NodeJS10x, + runtime: lambda.Runtime.NodeJS610, code: lambda.Code.inline('exports.main = function() { console.log("DONE"); }'), handler: 'index.main' }), - /nodejs10.x is not in \[nodejs8.10\]/); + /nodejs6.10 is not in \[nodejs8.10\]/); test.done(); },