diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/authorizers/integ.request-authorizer.lit.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/authorizers/integ.request-authorizer.lit.ts index 3bf407ca48dfe..701c8dcca2a09 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/authorizers/integ.request-authorizer.lit.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/authorizers/integ.request-authorizer.lit.ts @@ -12,7 +12,7 @@ const app = new App(); const stack = new Stack(app, 'RequestAuthorizerInteg'); const authorizerFn = new lambda.Function(stack, 'MyAuthorizerFunction', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.AssetCode.fromAsset(path.join(__dirname, 'integ.request-authorizer.handler')), }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/authorizers/integ.token-authorizer-iam-role.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/authorizers/integ.token-authorizer-iam-role.ts index 129dab750e2cd..401759b765071 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/authorizers/integ.token-authorizer-iam-role.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/authorizers/integ.token-authorizer-iam-role.ts @@ -16,7 +16,7 @@ const app = new App(); const stack = new Stack(app, 'TokenAuthorizerIAMRoleInteg'); const authorizerFn = new lambda.Function(stack, 'MyAuthorizerFunction', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.AssetCode.fromAsset(path.join(__dirname, 'integ.token-authorizer.handler')), }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/authorizers/integ.token-authorizer.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/authorizers/integ.token-authorizer.ts index 2a7f4b201aa86..ed00c3081769b 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/authorizers/integ.token-authorizer.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/authorizers/integ.token-authorizer.ts @@ -8,7 +8,7 @@ const app = new App(); const stack = new Stack(app, 'TokenAuthorizerInteg'); const authorizerFn = new lambda.Function(stack, 'MyAuthorizerFunction', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.AssetCode.fromAsset(path.join(__dirname, 'integ.token-authorizer.handler')), }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.cors.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.cors.ts index 6c10e15d062bf..3dfe1e0b42bd8 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.cors.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.cors.ts @@ -14,7 +14,7 @@ class TestStack extends Stack { }); const handler = new lambda.Function(this, 'handler', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromAsset(path.join(__dirname, 'integ.cors.handler')), }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.lambda-api-nonproxy.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.lambda-api-nonproxy.ts index 2222d39b2d59d..0bcb036082493 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.lambda-api-nonproxy.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.lambda-api-nonproxy.ts @@ -10,7 +10,7 @@ class LambdaApiIntegrationOptionsNonProxyIntegrationStack extends Stack { const fn = new Function(this, 'myfn', { code: Code.fromInline('foo'), - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, handler: 'index.handler', }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.lambda-api.latebound-deploymentstage.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.lambda-api.latebound-deploymentstage.ts index 113f5f730981e..56c0f8c29d710 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.lambda-api.latebound-deploymentstage.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.lambda-api.latebound-deploymentstage.ts @@ -10,7 +10,7 @@ class LateBoundDeploymentStageStack extends Stack { const fn = new Function(this, 'myfn', { code: Code.fromInline('foo'), - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, handler: 'index.handler', }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi-default-apikey.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi-default-apikey.ts index c9cdc5ab8fbbb..4bdb1dd98c054 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi-default-apikey.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi-default-apikey.ts @@ -10,7 +10,7 @@ const stack = new 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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); const apigw = new RestApi(stack, 'MyRestApi', { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.books.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.books.ts index da6889af57220..da2c01c4f0577 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.books.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.books.ts @@ -8,19 +8,19 @@ class BookStack extends cdk.Stack { super(scope, id); const booksHandler = new apigw.LambdaIntegration(new lambda.Function(this, 'BooksHandler', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromInline(`exports.handler = ${echoHandlerCode}`), })); const bookHandler = new apigw.LambdaIntegration(new lambda.Function(this, 'BookHandler', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromInline(`exports.handler = ${echoHandlerCode}`), })); const hello = new apigw.LambdaIntegration(new lambda.Function(this, 'Hello', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromInline(`exports.handler = ${helloCode}`), })); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.multistack.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.multistack.ts index 6a1824d323adb..542db8f53da08 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.multistack.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.multistack.ts @@ -19,7 +19,7 @@ class FirstStack extends cdk.Stack { } }`), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.multiuse.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.multiuse.ts index c7fd1be6968d4..d20f508d11a4f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.multiuse.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.multiuse.ts @@ -8,7 +8,7 @@ class MultiStack extends cdk.Stack { super(scope, id); const hello = new apigw.LambdaIntegration(new lambda.Function(this, 'Hello', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromInline(`exports.handler = ${helloCode}`), })); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.ts index befc3df8a0e45..7cd1f21c5b1c8 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.restapi.ts @@ -27,7 +27,7 @@ class Test extends cdk.Stack { }); const handler = new lambda.Function(this, 'MyHandler', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline(`exports.handler = ${handlerCode}`), handler: 'index.handler', }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.spec-restapi.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.spec-restapi.ts index c531edf6e1b20..a38d8830d5320 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.spec-restapi.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-apigateway/test/integ.spec-restapi.ts @@ -30,7 +30,7 @@ class Test extends cdk.Stack { }); const handler = new lambda.Function(this, 'MyHandler', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline(`exports.handler = ${handlerCode}`), handler: 'index.handler', }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-appsync/test/integ.appsync-lambda.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-appsync/test/integ.appsync-lambda.ts index 50492141633fb..a8fa17cc3ee2a 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-appsync/test/integ.appsync-lambda.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-appsync/test/integ.appsync-lambda.ts @@ -29,7 +29,7 @@ const api = new appsync.GraphqlApi(stack, 'LambdaAPI', { const func = new lambda.Function(stack, 'func', { code: lambda.Code.fromAsset(path.join(__dirname, 'verify/lambda-tutorial')), handler: 'lambda-tutorial.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); const lambdaDS = api.addLambdaDataSource('LambdaDS', func); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-appsync/test/integ.graphql-iam.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-appsync/test/integ.graphql-iam.ts index 15a14f71e1e0c..7d494a3fa22ea 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-appsync/test/integ.graphql-iam.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-appsync/test/integ.graphql-iam.ts @@ -96,14 +96,14 @@ api.grantMutation(lambdaIAM, 'addTest'); new Function(stack, 'testQuery', { code: Code.fromAsset(join(__dirname, 'verify/iam-query')), handler: 'iam-query.handler', - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, environment: { APPSYNC_ENDPOINT: api.graphqlUrl }, role: lambdaIAM, }); new Function(stack, 'testFail', { code: Code.fromAsset(join(__dirname, 'verify/iam-query')), handler: 'iam-query.handler', - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, environment: { APPSYNC_ENDPOINT: api.graphqlUrl }, }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-appsync/test/integ.lambda-auth.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-appsync/test/integ.lambda-auth.ts index a57d8b8089088..13de5d595dbc3 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-appsync/test/integ.lambda-auth.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-appsync/test/integ.lambda-auth.ts @@ -14,7 +14,7 @@ class GraphQLApiLambdaAuthStack extends cdk.Stack { path.join(__dirname, 'verify/lambda-tutorial'), ), handler: 'lambda-tutorial.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); new appsync.GraphqlApi(this, 'api1', { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudformation/test/integ.core-custom-resources.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudformation/test/integ.core-custom-resources.ts index 036d8662e787b..f692e788f1e59 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudformation/test/integ.core-custom-resources.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudformation/test/integ.core-custom-resources.ts @@ -20,7 +20,7 @@ class TestStack extends Stack { const serviceToken = CustomResourceProvider.getOrCreate(this, resourceType, { codeDirectory: `${__dirname}/core-custom-resource-provider-fixture`, - runtime: CustomResourceProviderRuntime.NODEJS_14_X, + runtime: CustomResourceProviderRuntime.NODEJS_16_X, description: 'veni vidi vici', }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudformation/test/integ.core-deps.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudformation/test/integ.core-deps.ts index 14cfb04d87f33..370eae9552b49 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudformation/test/integ.core-deps.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudformation/test/integ.core-deps.ts @@ -22,7 +22,7 @@ class TestStack extends Stack { new lambda.Function(this, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, logRetention: RetentionDays.ONE_DAY, }); const logRetentionFunction = this.node.tryFindChild('LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8a')!; @@ -47,12 +47,12 @@ class TestNestedStack extends Stack { const resource1 = new lambda.Function(stack1, 'Lambda1', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }).node.defaultChild! as CfnResource; const resource2 = new lambda.Function(stack2, 'Lambda2', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }).node.defaultChild! as CfnResource; // The following two statements should cancel each other out diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudformation/test/integ.nested-stack.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudformation/test/integ.nested-stack.ts index 7800f14771927..3a2e9bb9e2d44 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudformation/test/integ.nested-stack.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudformation/test/integ.nested-stack.ts @@ -40,7 +40,7 @@ class MyNestedStack extends NestedStack { if (props.subscriber) { new lambda.Function(this, 'fn', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('console.error("hi")'), handler: 'index.handler', environment: { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudformation/test/integ.nested-stacks-assets.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudformation/test/integ.nested-stacks-assets.ts index ffd1c2d1a2021..f7e9a78a61973 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudformation/test/integ.nested-stacks-assets.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudformation/test/integ.nested-stacks-assets.ts @@ -11,7 +11,7 @@ class MyNestedStack extends NestedStack { new lambda.Function(this, 'Handler', { code: lambda.Code.fromAsset(path.join(__dirname, 'asset-directory-fixture')), - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', }); } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront/test/integ.cloudfront-lambda-association.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront/test/integ.cloudfront-lambda-association.ts index 7ca443d759df4..2fb0a1fd66b21 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront/test/integ.cloudfront-lambda-association.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront/test/integ.cloudfront-lambda-association.ts @@ -14,7 +14,7 @@ const sourceBucket = new s3.Bucket(stack, 'Bucket', { const lambdaFunction = new lambda.Function(stack, 'Lambda', { code: lambda.Code.fromInline('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); const lambdaVersion = new lambda.Version(stack, 'LambdaVersion', { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront/test/integ.distribution-lambda-cross-region.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront/test/integ.distribution-lambda-cross-region.ts index 30f11d44cdb35..a172255830fb0 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront/test/integ.distribution-lambda-cross-region.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront/test/integ.distribution-lambda-cross-region.ts @@ -12,13 +12,13 @@ const stack = new cdk.Stack(app, 'integ-distribution-lambda-cross-region', { env const lambdaFunction = new cloudfront.experimental.EdgeFunction(stack, 'Lambda', { code: lambda.Code.fromInline('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); const lambdaFunction2 = new cloudfront.experimental.EdgeFunction(stack, 'Lambda2', { code: lambda.Code.fromInline('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, stackId: `edge-lambda-stack-${region}-2`, }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront/test/integ.distribution-lambda.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront/test/integ.distribution-lambda.ts index bb8233d1e88b3..8835f00d26197 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront/test/integ.distribution-lambda.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudfront/test/integ.distribution-lambda.ts @@ -9,7 +9,7 @@ const stack = new cdk.Stack(app, 'integ-distribution-lambda', { env: { region: ' const lambdaFunction = new lambda.Function(stack, 'Lambda', { code: lambda.Code.fromInline('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); new cloudfront.Distribution(stack, 'Dist', { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudtrail/test/integ.cloudtrail-supplied-bucket.lit.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudtrail/test/integ.cloudtrail-supplied-bucket.lit.ts index 998e9db521fa2..4f1b081f466ff 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudtrail/test/integ.cloudtrail-supplied-bucket.lit.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudtrail/test/integ.cloudtrail-supplied-bucket.lit.ts @@ -13,7 +13,7 @@ const bucket = new s3.Bucket(stack, 'Bucket', { autoDeleteObjects: true, }); const lambdaFunction = new lambda.Function(stack, 'LambdaFunction', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'hello.handler', code: lambda.Code.fromInline('exports.handler = {}'), }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudtrail/test/integ.cloudtrail.lit.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudtrail/test/integ.cloudtrail.lit.ts index 671128c721428..22c7b69ac4122 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-cloudtrail/test/integ.cloudtrail.lit.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cloudtrail/test/integ.cloudtrail.lit.ts @@ -13,7 +13,7 @@ const bucket = new s3.Bucket(stack, 'Bucket', { }); const topic = new sns.Topic(stack, 'Topic'); const lambdaFunction = new lambda.Function(stack, 'LambdaFunction', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'hello.handler', code: lambda.Code.fromInline('exports.handler = {}'), }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/lambda/integ.deployment-group.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/lambda/integ.deployment-group.ts index 0c1d76fc9dc3b..cf7075d1fefe4 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/lambda/integ.deployment-group.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-codedeploy/test/lambda/integ.deployment-group.ts @@ -10,7 +10,7 @@ const stack = new cdk.Stack(app, 'aws-cdk-codedeploy-lambda'); const handler = new lambda.Function(stack, 'Handler', { code: lambda.Code.fromAsset(path.join(__dirname, 'handler')), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); const version = handler.currentVersion; const blueGreenAlias = new lambda.Alias(stack, 'Alias', { @@ -21,12 +21,12 @@ const blueGreenAlias = new lambda.Alias(stack, 'Alias', { const preHook = new lambda.Function(stack, 'PreHook', { code: lambda.Code.fromAsset(path.join(__dirname, 'preHook')), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); const postHook = new lambda.Function(stack, 'PostHook', { code: lambda.Code.fromAsset(path.join(__dirname, 'postHook')), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); new codedeploy.LambdaDeploymentGroup(stack, 'BlueGreenDeployment', { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.lambda-deployed-through-codepipeline.lit.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.lambda-deployed-through-codepipeline.lit.ts index c5ec1989475aa..f1789f1164481 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.lambda-deployed-through-codepipeline.lit.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.lambda-deployed-through-codepipeline.lit.ts @@ -14,7 +14,7 @@ const lambdaCode = lambda.Code.fromCfnParameters(); new lambda.Function(lambdaStack, 'Lambda', { code: lambdaCode, handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); // other resources that your Lambda needs, added to the lambdaStack... diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.lambda-pipeline.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.lambda-pipeline.ts index 0fcc60981b9a0..37a0a18b577b6 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-codepipeline-actions/test/integ.lambda-pipeline.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/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.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); const lambdaStage = pipeline.addStage({ stageName: 'Lambda' }); lambdaStage.addAction(new cpactions.LambdaInvokeAction({ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cognito/test/integ.user-pool-custom-sender.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-cognito/test/integ.user-pool-custom-sender.ts index b50f4804b6d7e..84fd855298d46 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-cognito/test/integ.user-pool-custom-sender.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cognito/test/integ.user-pool-custom-sender.ts @@ -12,7 +12,7 @@ const app = new App(); const stack = new Stack(app, 'integ-user-pool-custom-sender'); const customSenderLambda = new lambda.Function(stack, 'emailLambda', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromInline('exports.handler = function(event, ctx, cb) { console.log("Mocked custom email send");return cb(null, "success"); }'), }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-cognito/test/integ.user-pool-explicit-props.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-cognito/test/integ.user-pool-explicit-props.ts index e04ca43ea4dce..e1a46b90b2fa7 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-cognito/test/integ.user-pool-explicit-props.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-cognito/test/integ.user-pool-explicit-props.ts @@ -95,7 +95,7 @@ function dummyTrigger(name: string): IFunction { return new Function(stack, name, { functionName: name, handler: 'index.handler', - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, code: Code.fromInline('foo'), }); } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-config/test/integ.rule.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-config/test/integ.rule.ts index b533e711e7936..bac285b99db71 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-config/test/integ.rule.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-config/test/integ.rule.ts @@ -12,7 +12,7 @@ const stack = new cdk.Stack(app, 'aws-cdk-config-custompolicy'); const fn = new lambda.Function(stack, 'CustomFunction', { code: lambda.AssetCode.fromInline('exports.handler = (event) => console.log(event);'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); new config.CustomRule(stack, 'Custom', { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-config/test/integ.scoped-rule.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-config/test/integ.scoped-rule.ts index a425e54a8f50f..49a0550278f00 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-config/test/integ.scoped-rule.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-config/test/integ.scoped-rule.ts @@ -10,7 +10,7 @@ const stack = new cdk.Stack(app, 'aws-cdk-config-rule-scoped-integ', {}); const fn = new lambda.Function(stack, 'CustomFunction', { code: lambda.AssetCode.fromInline('exports.handler = (event) => console.log(event);'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); new config.CustomRule(stack, 'Custom', { diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.client-vpn-endpoint.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.client-vpn-endpoint.ts index 16d8779705dc0..94ef1966a5f12 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.client-vpn-endpoint.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ec2/test/integ.client-vpn-endpoint.ts @@ -40,7 +40,7 @@ class ImportCertificates extends Construct { const serviceToken = CustomResourceProvider.getOrCreate(this, IMPORT_CERTIFICATES_RESOURCE_TYPE, { codeDirectory: path.join(__dirname, 'import-certificates-handler'), - runtime: CustomResourceProviderRuntime.NODEJS_14_X, + runtime: CustomResourceProviderRuntime.NODEJS_16_X, policyStatements: [{ Effect: 'Allow', Action: ['acm:ImportCertificate', 'acm:DeleteCertificate'], diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/lambda/integ.events.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/lambda/integ.events.ts index ff83638cfbddf..4547a5250c3bd 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/lambda/integ.events.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-events-targets/test/lambda/integ.events.ts @@ -9,7 +9,7 @@ const app = new cdk.App(); const stack = new cdk.Stack(app, 'lambda-events'); const fn = new lambda.Function(stack, 'MyFunc', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromInline(`exports.handler = ${handler.toString()}`), }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-destinations/test/integ.destinations.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-destinations/test/integ.destinations.ts index b87b2434b8fd4..61466bad75d7e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-destinations/test/integ.destinations.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-destinations/test/integ.destinations.ts @@ -22,7 +22,7 @@ class TestStack extends Stack { this.queue = new sqs.Queue(this, 'Queue'); this.fn = new lambda.Function(this, 'SnsSqs', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromInline(`exports.handler = async (event) => { if (event.status === 'OK') return 'success'; @@ -35,7 +35,7 @@ class TestStack extends Stack { }); const onSuccessLambda = new lambda.Function(this, 'OnSucces', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromInline(`exports.handler = async (event) => { console.log(event); @@ -43,7 +43,7 @@ class TestStack extends Stack { }); new lambda.Function(this, 'EventBusLambda', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromInline(`exports.handler = async (event) => { if (event.status === 'OK') return 'success'; diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-destinations/test/integ.lambda-chain.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-destinations/test/integ.lambda-chain.ts index 1f04c4b87d71f..878a2948b2057 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-destinations/test/integ.lambda-chain.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-destinations/test/integ.lambda-chain.ts @@ -23,7 +23,7 @@ class TestStack extends Stack { super(scope, id, props); const lambdaProps: lambda.FunctionProps = { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromInline(`exports.handler = async (event) => { console.log('Event: %j', event); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-event-sources/test/integ.kinesiswithdlq.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-event-sources/test/integ.kinesiswithdlq.ts index 8979fcf7c36f9..d188e29a669e5 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-event-sources/test/integ.kinesiswithdlq.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-event-sources/test/integ.kinesiswithdlq.ts @@ -22,7 +22,7 @@ class KinesisWithDLQTest extends Stack { super(scope, id); const fn = new lambda.Function(this, 'F', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromInline(`exports.handler = ${handler.toString()}`), }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-event-sources/test/test-function.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-event-sources/test/test-function.ts index c5204b267fc62..e7dce7701952b 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-event-sources/test/test-function.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-event-sources/test/test-function.ts @@ -6,7 +6,7 @@ export class TestFunction extends lambda.Function { super(scope, id, { handler: 'index.handler', code: lambda.Code.fromInline(`exports.handler = ${handler.toString()}`), - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); } } diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.function.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.function.ts index 8500354338505..e0a2fd6e5169b 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.function.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda-nodejs/test/integ.function.ts @@ -12,7 +12,7 @@ class TestStack extends Stack { new lambda.NodejsFunction(this, 'ts-handler', { entry: path.join(__dirname, 'integ-handlers/ts-handler.ts'), - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, bundling: { minify: true, sourceMap: true, @@ -22,18 +22,18 @@ class TestStack extends Stack { new lambda.NodejsFunction(this, 'js-handler', { entry: path.join(__dirname, 'integ-handlers/js-handler.js'), - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, }); new lambda.NodejsFunction(this, 'ts-handler-vpc', { entry: path.join(__dirname, 'integ-handlers/ts-handler.ts'), - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, vpc: new Vpc(this, 'Vpc', { restrictDefaultSecurityGroup: false }), }); new lambda.NodejsFunction(this, 'ts-handler-custom-handler-no-dots', { entry: path.join(__dirname, 'integ-handlers/ts-handler.ts'), - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, bundling: { minify: true, sourceMap: true, @@ -44,7 +44,7 @@ class TestStack extends Stack { new lambda.NodejsFunction(this, 'ts-handler-custom-handler-dots', { entry: path.join(__dirname, 'integ-handlers/ts-web-handler.ts'), - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, bundling: { minify: true, sourceMap: true, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.autoscaling.lit.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.autoscaling.lit.ts index b315365c88fcc..5a765de3b4536 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.autoscaling.lit.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.autoscaling.lit.ts @@ -15,7 +15,7 @@ class TestStack extends cdk.Stack { const fn = new lambda.Function(this, 'MyLambda', { code: new lambda.InlineCode('exports.handler = async () => { console.log(\'hello world\'); };'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); const version = fn.currentVersion; diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.lambda-adot.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.lambda-adot.ts index 07c6e6f1e74f2..91ed7bd0ca09d 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.lambda-adot.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.lambda-adot.ts @@ -27,7 +27,7 @@ class StackUnderTest extends Stack { super(scope, id, props); new Function(this, 'MyFunc1', { - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, handler: 'index.handler', code: Code.fromInline(`exports.handler = ${handler.toString()}`), architecture: props.architecture, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.lambda-customize-roles.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.lambda-customize-roles.ts index 654eb108e2ef8..553c8f699e11e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.lambda-customize-roles.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.lambda-customize-roles.ts @@ -15,7 +15,7 @@ iam.Role.customizeRoles(stack, { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); const bucket = new Bucket(stack, 'Bucket'); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.lambda-insights-mapping.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.lambda-insights-mapping.ts index dee643c44c8e9..727cb1a9ab2b2 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.lambda-insights-mapping.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.lambda-insights-mapping.ts @@ -6,42 +6,42 @@ const app = new cdk.App(); const stack = new cdk.Stack(app, 'stack'); new lambda.Function(stack, 'MyFunc1', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromInline(`exports.handler = ${handler.toString()}`), insightsVersion: lambda.LambdaInsightsVersion.VERSION_1_0_54_0, }); new lambda.Function(stack, 'MyFunc2', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromInline(`exports.handler = ${handler.toString()}`), insightsVersion: lambda.LambdaInsightsVersion.VERSION_1_0_86_0, }); new lambda.Function(stack, 'MyFunc3', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromInline(`exports.handler = ${handler.toString()}`), insightsVersion: lambda.LambdaInsightsVersion.VERSION_1_0_89_0, }); new lambda.Function(stack, 'MyFunc4', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromInline(`exports.handler = ${handler.toString()}`), insightsVersion: lambda.LambdaInsightsVersion.VERSION_1_0_98_0, }); new lambda.Function(stack, 'MyFunc5', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromInline(`exports.handler = ${handler.toString()}`), insightsVersion: lambda.LambdaInsightsVersion.VERSION_1_0_119_0, }); new lambda.Function(stack, 'MyFunc6', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, architecture: lambda.Architecture.ARM_64, handler: 'index.handler', code: lambda.Code.fromInline(`exports.handler = ${handler.toString()}`), diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.lambda.prov.concurrent.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.lambda.prov.concurrent.ts index 98866c52ce1e6..c44e667bf178f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.lambda.prov.concurrent.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.lambda.prov.concurrent.ts @@ -16,7 +16,7 @@ const pce = 5; const fn = new lambda.Function(stack, 'MyLambdaAliasPCE', { code: new lambda.InlineCode(lambdaCode.replace('#type#', 'Alias')), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); fn.addToRolePolicy(new iam.PolicyStatement({ @@ -40,7 +40,7 @@ alias.addPermission('AliasPermission', { const fnVersionPCE = new lambda.Function(stack, 'MyLambdaVersionPCE', { code: new lambda.InlineCode(lambdaCode.replace('#type#', 'Version')), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, currentVersionOptions: { provisionedConcurrentExecutions: pce, }, diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.lambda.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.lambda.ts index 5e441fd1f6228..63a7627ad35e8 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.lambda.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.lambda.ts @@ -10,7 +10,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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); fn.addToRolePolicy(new iam.PolicyStatement({ diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.layer-version.lit.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.layer-version.lit.ts index 6ded43147af09..2f973e47c5967 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.layer-version.lit.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.layer-version.lit.ts @@ -12,7 +12,7 @@ const awsAccountId = stack.account; /// !show const layer = new lambda.LayerVersion(stack, 'MyLayer', { code: lambda.Code.fromAsset(path.join(__dirname, 'layer-code')), - compatibleRuntimes: [lambda.Runtime.NODEJS_14_X], + compatibleRuntimes: [lambda.Runtime.NODEJS_16_X], license: 'Apache-2.0', description: 'A layer to test the L2 construct', }); @@ -26,7 +26,7 @@ layer.addPermission('remote-account-grant', { accountId: awsAccountId }); new lambda.Function(stack, 'MyLayeredLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, layers: [layer], }); /// !hide diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.log-retention.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.log-retention.ts index b2e268847847a..c081a762679a5 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.log-retention.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.log-retention.ts @@ -9,21 +9,21 @@ const stack = new cdk.Stack(app, 'aws-cdk-lambda-log-retention'); new lambda.Function(stack, 'OneWeek', { code: new lambda.InlineCode('exports.handler = (event) => console.log(JSON.stringify(event));'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, logRetention: logs.RetentionDays.ONE_WEEK, }); new lambda.Function(stack, 'OneMonth', { code: new lambda.InlineCode('exports.handler = (event) => console.log(JSON.stringify(event));'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, logRetention: logs.RetentionDays.ONE_MONTH, }); new lambda.Function(stack, 'OneYear', { code: new lambda.InlineCode('exports.handler = (event) => console.log(JSON.stringify(event));'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, logRetention: logs.RetentionDays.ONE_YEAR, }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.permissions.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.permissions.ts index 80ef825fa5fab..4db9e92dbc33c 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.permissions.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-lambda/test/integ.permissions.ts @@ -9,7 +9,7 @@ const stack = new cdk.Stack(app, 'lambda-permissions'); const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); fn.grantInvoke(new iam.AnyPrincipal().inOrganization('o-yyyyyyyyyy')); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.instance.lit.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.instance.lit.ts index a2d100079f328..fc7485d3c298b 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.instance.lit.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-rds/test/integ.instance.lit.ts @@ -86,7 +86,7 @@ class DatabaseInstanceStack extends cdk.Stack { const fn = new lambda.Function(this, 'Function', { code: lambda.Code.fromInline('exports.handler = (event) => console.log(event);'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); const availabilityRule = instance.onEvent('Availability', { target: new targets.LambdaFunction(fn) }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-route53-targets/test/integ.api-gateway-domain-name.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-route53-targets/test/integ.api-gateway-domain-name.ts index 0f5f4d8bf36a6..c0d73963c0a8e 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-route53-targets/test/integ.api-gateway-domain-name.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-route53-targets/test/integ.api-gateway-domain-name.ts @@ -23,7 +23,7 @@ class TestStack extends Stack { body: 'hello, world!' }; };`), - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-substitution.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-substitution.ts index a4099532270a5..8ccfc4136934c 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-substitution.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-deployment/test/integ.bucket-deployment-substitution.ts @@ -14,7 +14,7 @@ class Test extends cdk.Stack { super(scope, id); const hello = new lambda.Function(this, 'Hello', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromInline(`exports.handler = ${helloCode}`), }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-notifications/test/lambda/integ.bucket-notifications.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-notifications/test/lambda/integ.bucket-notifications.ts index 98f2dc7d07fcc..29c1585270e3f 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-s3-notifications/test/lambda/integ.bucket-notifications.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-s3-notifications/test/lambda/integ.bucket-notifications.ts @@ -12,7 +12,7 @@ const bucketA = new s3.Bucket(stack, 'MyBucket', { }); const fn = new lambda.Function(stack, 'MyFunction', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromInline(`exports.handler = ${handler.toString()}`), }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.ts index e43bf53190331..3a22f4dd6a781 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-s3/test/integ.bucket-auto-delete-objects.ts @@ -19,7 +19,7 @@ class TestStack extends Stack { // Put objects in the bucket to ensure auto delete works as expected const serviceToken = CustomResourceProvider.getOrCreate(this, PUT_OBJECTS_RESOURCE_TYPE, { codeDirectory: path.join(__dirname, 'put-objects-handler'), - runtime: CustomResourceProviderRuntime.NODEJS_14_X, + runtime: CustomResourceProviderRuntime.NODEJS_16_X, policyStatements: [{ Effect: 'Allow', Action: 's3:PutObject', diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-secretsmanager/test/integ.lambda-rotation.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-secretsmanager/test/integ.lambda-rotation.ts index eedd5f6654472..9e0b3cc745761 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-secretsmanager/test/integ.lambda-rotation.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-secretsmanager/test/integ.lambda-rotation.ts @@ -15,7 +15,7 @@ class TestStack extends cdk.Stack { secret.addRotationSchedule('Schedule', { rotationLambda: new lambda.Function(this, 'Lambda', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromInline('NOOP'), }), diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-secretsmanager/test/integ.secret-name-parsed.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-secretsmanager/test/integ.secret-name-parsed.ts index 66747f387d990..70787a51c0afe 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-secretsmanager/test/integ.secret-name-parsed.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-secretsmanager/test/integ.secret-name-parsed.ts @@ -21,7 +21,7 @@ class SecretsManagerStack extends cdk.Stack { const resourceType = 'Custom::IntegVerificationSecretNameMatches'; const serviceToken = cdk.CustomResourceProvider.getOrCreate(this, resourceType, { codeDirectory: path.join(__dirname, 'integ.secret-name-parsed.handler'), - runtime: cdk.CustomResourceProviderRuntime.NODEJS_14_X, + runtime: cdk.CustomResourceProviderRuntime.NODEJS_16_X, policyStatements: [{ Effect: 'Allow', Resource: secrets.map(s => s.secretArn), diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-ses-actions/test/integ.actions.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-ses-actions/test/integ.actions.ts index fd174a8f6f33a..5cbdffc3cdd50 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-ses-actions/test/integ.actions.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-ses-actions/test/integ.actions.ts @@ -15,7 +15,7 @@ const topic = new sns.Topic(stack, 'Topic'); const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.fromInline('exports.handler = async (event) => event;'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); const bucket = new s3.Bucket(stack, 'Bucket'); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-sns-subscriptions/test/integ.sns-lambda-cross-region.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-sns-subscriptions/test/integ.sns-lambda-cross-region.ts index 0f82618315c10..073d6bae849a9 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-sns-subscriptions/test/integ.sns-lambda-cross-region.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-sns-subscriptions/test/integ.sns-lambda-cross-region.ts @@ -21,7 +21,7 @@ const functionStack = new cdk.Stack(app, 'FunctionStack', { }); const fction = new lambda.Function(functionStack, 'Echo', { handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline(`exports.handler = ${handler.toString()}`), }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-sns-subscriptions/test/integ.sns-lambda.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-sns-subscriptions/test/integ.sns-lambda.ts index 7bb71d89dff3a..aea9757a728de 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-sns-subscriptions/test/integ.sns-lambda.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-sns-subscriptions/test/integ.sns-lambda.ts @@ -12,7 +12,7 @@ class SnsToLambda extends cdk.Stack { const func = new lambda.Function(this, 'Echo', { handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline(`exports.handler = ${handler.toString()}`), }); @@ -22,7 +22,7 @@ class SnsToLambda extends cdk.Stack { const funcFiltered = new lambda.Function(this, 'Filtered', { handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline(`exports.handler = ${handler.toString()}`), }); @@ -43,7 +43,7 @@ class SnsToLambda extends cdk.Stack { const funcFilteredWithMessageBody = new lambda.Function(this, 'FilteredMessageBody', { handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline(`exports.handler = ${handler.toString()}`), }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/apigateway/integ.call-rest-api.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/apigateway/integ.call-rest-api.ts index 37411facf734a..dbb415bcebd43 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/apigateway/integ.call-rest-api.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/apigateway/integ.call-rest-api.ts @@ -18,7 +18,7 @@ const stack = new cdk.Stack(app, 'CallRestApiInteg'); const restApi = new apigateway.RestApi(stack, 'MyRestApi', { cloudWatchRole: true }); const hello = new apigateway.LambdaIntegration(new lambda.Function(stack, 'Hello', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: new lambda.InlineCode('exports.handler = async function(event, context) { return { statusCode: 200, body: "hello, world!" }; };'), })); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/lambda/integ.invoke.payload.only.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/lambda/integ.invoke.payload.only.ts index 326dce19cd1d3..5a9b83fbdd391 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/lambda/integ.invoke.payload.only.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/lambda/integ.invoke.payload.only.ts @@ -25,7 +25,7 @@ const submitJobLambda = new Function(stack, 'submitJobLambda', { body: 'hello, world!' }; };`), - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, handler: 'index.handler', }); @@ -40,7 +40,7 @@ const checkJobStateLambda = new Function(stack, 'checkJobStateLambda', { status: event.statusCode === '200' ? 'SUCCEEDED' : 'FAILED' }; };`), - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, handler: 'index.handler', }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/lambda/integ.invoke.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/lambda/integ.invoke.ts index f366a20b4847d..2e78ebf7f1cfb 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/lambda/integ.invoke.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/lambda/integ.invoke.ts @@ -27,7 +27,7 @@ const submitJobLambda = new Function(stack, 'submitJobLambda', { ...event, }; };`), - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, handler: 'index.handler', }); @@ -60,7 +60,7 @@ const checkJobStateLambda = new Function(stack, 'checkJobStateLambda', { status: event.statusCode === '200' && fieldsAreSet ? 'SUCCEEDED' : 'FAILED' }; };`), - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, handler: 'index.handler', }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/lambda/integ.run-lambda.ts b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/lambda/integ.run-lambda.ts index 2b42b5ec9256b..b499a5daef394 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/lambda/integ.run-lambda.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/aws-stepfunctions-tasks/test/lambda/integ.run-lambda.ts @@ -21,7 +21,7 @@ const submitJobLambda = new Function(stack, 'submitJobLambda', { body: 'hello, world!' }; };`), - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, handler: 'index.handler', }); @@ -36,7 +36,7 @@ const checkJobStateLambda = new Function(stack, 'checkJobStateLambda', { status: event.statusCode === '200' ? 'SUCCEEDED' : 'FAILED' }; };`), - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, handler: 'index.handler', }); diff --git a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/provider-framework/integration-test-fixtures/s3-file.ts b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/provider-framework/integration-test-fixtures/s3-file.ts index 6ab5483a7abde..bd6fb048a32e8 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/provider-framework/integration-test-fixtures/s3-file.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/custom-resources/test/provider-framework/integration-test-fixtures/s3-file.ts @@ -78,7 +78,7 @@ class S3FileProvider extends Construct { this.provider = new cr.Provider(this, 's3file-provider', { onEventHandler: new lambda.Function(this, 's3file-on-event', { code: lambda.Code.fromAsset(path.join(__dirname, 's3-file-handler')), - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.onEvent', initialPolicy: [ new iam.PolicyStatement({ diff --git a/packages/@aws-cdk-testing/framework-integ/test/lambda-layer-node-proxy-agent/test/integ.node-proxy-agent.ts b/packages/@aws-cdk-testing/framework-integ/test/lambda-layer-node-proxy-agent/test/integ.node-proxy-agent.ts index a1a7f3917e523..9b8a5367db087 100644 --- a/packages/@aws-cdk-testing/framework-integ/test/lambda-layer-node-proxy-agent/test/integ.node-proxy-agent.ts +++ b/packages/@aws-cdk-testing/framework-integ/test/lambda-layer-node-proxy-agent/test/integ.node-proxy-agent.ts @@ -15,18 +15,18 @@ const app = new cdk.App(); const stack = new cdk.Stack(app, 'lambda-layer-node-proxy-agent-integ-stack'); const layer = new NodeProxyAgentLayer(stack, 'NodeProxyAgentLayer'); -const provider = new cr.Provider(stack, 'ProviderNode14', { - onEventHandler: new lambda.Function(stack, 'Lambda$Node14', { +const provider = new cr.Provider(stack, 'ProviderNode16', { + onEventHandler: new lambda.Function(stack, 'Lambda$Node16', { code: lambda.Code.fromAsset(path.join(__dirname, 'lambda-handler')), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, layers: [layer], memorySize: 512, timeout: cdk.Duration.seconds(30), }), }); -new cdk.CustomResource(stack, 'CustomResourceNode14', { +new cdk.CustomResource(stack, 'CustomResourceNode16', { serviceToken: provider.serviceToken, }); diff --git a/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/http/integ.lambda.ts b/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/http/integ.lambda.ts index 53202ce6c3307..6e3a34a2846a2 100644 --- a/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/http/integ.lambda.ts +++ b/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/http/integ.lambda.ts @@ -18,7 +18,7 @@ const stack = new Stack(app, 'AuthorizerInteg'); const httpApi = new HttpApi(stack, 'MyHttpApi'); const authHandler = new lambda.Function(stack, 'auth-function', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromAsset(path.join(__dirname, '../auth-handler')), }); @@ -30,7 +30,7 @@ const authorizer = new HttpLambdaAuthorizer('LambdaAuthorizer', authHandler, { }); const handler = new lambda.Function(stack, 'lambda', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.AssetCode.fromAsset(path.join(__dirname, '../integ.lambda.handler')), }); diff --git a/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/http/integ.user-pool.ts b/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/http/integ.user-pool.ts index f21e0c60b7d57..b579665aef128 100644 --- a/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/http/integ.user-pool.ts +++ b/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/http/integ.user-pool.ts @@ -23,7 +23,7 @@ const userPool = new cognito.UserPool(stack, 'userpool'); const authorizer = new HttpUserPoolAuthorizer('UserPoolAuthorizer', userPool); const handler = new lambda.Function(stack, 'lambda', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.AssetCode.fromAsset(path.join(__dirname, '../integ.user-pool.handler')), }); diff --git a/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/http/lambda.test.ts b/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/http/lambda.test.ts index 9757e59309a83..d0dca75302346 100644 --- a/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/http/lambda.test.ts +++ b/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/http/lambda.test.ts @@ -13,7 +13,7 @@ describe('HttpLambdaAuthorizer', () => { const api = new HttpApi(stack, 'HttpApi'); const handler = new Function(stack, 'auth-function', { - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, code: Code.fromInline('exports.handler = () => {return true}'), handler: 'index.handler', }); @@ -49,7 +49,7 @@ describe('HttpLambdaAuthorizer', () => { const api = new HttpApi(stack, 'HttpApi'); const handler = new Function(stack, 'auth-function', { - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, code: Code.fromInline('exports.handler = () => {return true}'), handler: 'index.handler', }); @@ -78,7 +78,7 @@ describe('HttpLambdaAuthorizer', () => { const api = new HttpApi(stack, 'HttpApi'); const handler = new Function(stack, 'auth-function', { - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, code: Code.fromInline('exports.handler = () => {return true}'), handler: 'index.handler', }); @@ -107,7 +107,7 @@ describe('HttpLambdaAuthorizer', () => { const api = new HttpApi(stack, 'HttpApi'); const handler = new Function(stack, 'auth-function', { - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, code: Code.fromInline('exports.handler = () => {return true}'), handler: 'index.handler', }); @@ -136,7 +136,7 @@ describe('HttpLambdaAuthorizer', () => { const api = new HttpApi(stack, 'HttpApi'); const handler = new Function(stack, 'auth-functon', { - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, code: Code.fromInline('exports.handler = () => {return true}'), handler: 'index.handler', }); diff --git a/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/websocket/iam.test.ts b/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/websocket/iam.test.ts index e52a5c6ae7835..49d84523a9b90 100644 --- a/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/websocket/iam.test.ts +++ b/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/websocket/iam.test.ts @@ -10,7 +10,7 @@ describe('WebSocketLambdaAuthorizer', () => { const stack = new Stack(); const handler = new Function(stack, 'auth-function', { - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, code: Code.fromInline('exports.handler = () => {return true}'), handler: 'index.handler', }); diff --git a/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/websocket/integ.iam.ts b/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/websocket/integ.iam.ts index 72dc0f2884ab0..e08f70af1d349 100644 --- a/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/websocket/integ.iam.ts +++ b/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/websocket/integ.iam.ts @@ -15,7 +15,7 @@ const userAccessKey = new iam.AccessKey(stack, 'UserAccess', { }); const handler = new Function(stack, 'auth-function', { - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, code: Code.fromInline('exports.handler = () => {return true}'), handler: 'index.handler', }); diff --git a/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/websocket/lambda.test.ts b/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/websocket/lambda.test.ts index 4b7890e1a9de5..e440fa1be1ccd 100644 --- a/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/websocket/lambda.test.ts +++ b/packages/@aws-cdk/aws-apigatewayv2-authorizers-alpha/test/websocket/lambda.test.ts @@ -11,7 +11,7 @@ describe('WebSocketLambdaAuthorizer', () => { const stack = new Stack(); const handler = new Function(stack, 'auth-function', { - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, code: Code.fromInline('exports.handler = () => {return true}'), handler: 'index.handler', }); diff --git a/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/http/integ.http-proxy.ts b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/http/integ.http-proxy.ts index 980ba108b09a1..e9e3437bb4e11 100644 --- a/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/http/integ.http-proxy.ts +++ b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/http/integ.http-proxy.ts @@ -25,7 +25,7 @@ new CfnOutput(stack, 'Endpoint', { function lambdaProxyEndpoint(s: Stack): HttpApi { const handler = new lambda.Function(s, 'AlwaysSuccess', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: new lambda.InlineCode('exports.handler = async function(event, context) { return { statusCode: 200, body: "success" }; };'), }); diff --git a/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/http/integ.lambda-proxy.ts b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/http/integ.lambda-proxy.ts index cefdb08014905..9cc3e29fc2bfa 100644 --- a/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/http/integ.lambda-proxy.ts +++ b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/http/integ.lambda-proxy.ts @@ -13,7 +13,7 @@ const app = new App(); const stack = new Stack(app, 'integ-lambda-proxy'); const handler = new lambda.Function(stack, 'AlwaysSuccess', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: new lambda.InlineCode('exports.handler = async function(event, context) { return { statusCode: 200, body: "success" }; };'), }); diff --git a/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/http/lambda.test.ts b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/http/lambda.test.ts index 2515df27163e3..23e15f17d4e32 100644 --- a/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/http/lambda.test.ts +++ b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/http/lambda.test.ts @@ -111,7 +111,7 @@ describe('LambdaProxyIntegration', () => { function fooFunction(stack: Stack, id: string) { return new Function(stack, id, { code: Code.fromInline('foo'), - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, handler: 'index.handler', }); } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda.ts b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda.ts index e77b88cb9b2f1..85272d9f9e79a 100644 --- a/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda.ts +++ b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/integ.lambda.ts @@ -15,25 +15,25 @@ const app = new App(); const stack = new Stack(app, 'WebSocketApiInteg'); const connectHandler = new lambda.Function(stack, 'ConnectHandler', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: new lambda.InlineCode('exports.handler = async function(event, context) { console.log(event); return { statusCode: 200, body: "connected" }; };'), }); const disconnetHandler = new lambda.Function(stack, 'DisconnectHandler', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: new lambda.InlineCode('exports.handler = async function(event, context) { console.log(event); return { statusCode: 200, body: "disconnected" }; };'), }); const defaultHandler = new lambda.Function(stack, 'DefaultHandler', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: new lambda.InlineCode('exports.handler = async function(event, context) { console.log(event); return { statusCode: 200, body: "default" }; };'), }); const messageHandler = new lambda.Function(stack, 'MessageHandler', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: new lambda.InlineCode('exports.handler = async function(event, context) { console.log(event); return { statusCode: 200, body: "received" }; };'), }); diff --git a/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/lambda.test.ts b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/lambda.test.ts index bd74acb0e7971..a890afd970280 100644 --- a/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/lambda.test.ts +++ b/packages/@aws-cdk/aws-apigatewayv2-integrations-alpha/test/websocket/lambda.test.ts @@ -50,7 +50,7 @@ describe('LambdaWebSocketIntegration', () => { function fooFunction(stack: Stack, id: string) { return new Function(stack, id, { code: Code.fromInline('foo'), - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, handler: 'index.handler', }); } diff --git a/packages/@aws-cdk/aws-iot-actions-alpha/test/lambda/integ.lambda-function-action.ts b/packages/@aws-cdk/aws-iot-actions-alpha/test/lambda/integ.lambda-function-action.ts index 6aa0e441b0e1c..50b2b4b5a9bbc 100644 --- a/packages/@aws-cdk/aws-iot-actions-alpha/test/lambda/integ.lambda-function-action.ts +++ b/packages/@aws-cdk/aws-iot-actions-alpha/test/lambda/integ.lambda-function-action.ts @@ -10,7 +10,7 @@ class TestStack extends cdk.Stack { super(scope, id, props); const func = new lambda.Function(this, 'MyFunction', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromInline(` exports.handler = (event) => { diff --git a/packages/@aws-cdk/aws-iot-actions-alpha/test/lambda/lambda-function-action.test.ts b/packages/@aws-cdk/aws-iot-actions-alpha/test/lambda/lambda-function-action.test.ts index bb2864abeb2e6..4959bc504d7a3 100644 --- a/packages/@aws-cdk/aws-iot-actions-alpha/test/lambda/lambda-function-action.test.ts +++ b/packages/@aws-cdk/aws-iot-actions-alpha/test/lambda/lambda-function-action.test.ts @@ -11,7 +11,7 @@ test('create a topic rule with lambda action and a lambda permission to be invok sql: iot.IotSql.fromStringAsVer20160323("SELECT topic(2) as device_id FROM 'device/+/data'"), }); const func = new lambda.Function(stack, 'MyFunction', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromInline('console.log("foo")'), }); @@ -60,7 +60,7 @@ test('create two different permissions, when two topic rules have the same actio // GIVEN const stack = new cdk.Stack(); const func = new lambda.Function(stack, 'MyFunction', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromInline('console.log("foo")'), }); diff --git a/packages/@aws-cdk/aws-iotevents-actions-alpha/test/lambda/integ.lambda-invoke-action.ts b/packages/@aws-cdk/aws-iotevents-actions-alpha/test/lambda/integ.lambda-invoke-action.ts index 3be3e3ce103bb..e8f0ad5946ff7 100644 --- a/packages/@aws-cdk/aws-iotevents-actions-alpha/test/lambda/integ.lambda-invoke-action.ts +++ b/packages/@aws-cdk/aws-iotevents-actions-alpha/test/lambda/integ.lambda-invoke-action.ts @@ -18,7 +18,7 @@ class TestStack extends cdk.Stack { attributeJsonPaths: ['payload.deviceId'], }); const func = new lambda.Function(this, 'MyFunction', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromInline(` exports.handler = (event) => { diff --git a/packages/@aws-cdk/aws-kinesisfirehose-destinations-alpha/test/s3-bucket.test.ts b/packages/@aws-cdk/aws-kinesisfirehose-destinations-alpha/test/s3-bucket.test.ts index ad4a0bc313305..457fd2695d0e7 100644 --- a/packages/@aws-cdk/aws-kinesisfirehose-destinations-alpha/test/s3-bucket.test.ts +++ b/packages/@aws-cdk/aws-kinesisfirehose-destinations-alpha/test/s3-bucket.test.ts @@ -240,7 +240,7 @@ describe('S3 destination', () => { beforeEach(() => { lambdaFunction = new lambda.Function(stack, 'DataProcessorFunction', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('foo'), handler: 'bar', }); diff --git a/packages/@aws-cdk/aws-lambda-python-alpha/test/function.test.ts b/packages/@aws-cdk/aws-lambda-python-alpha/test/function.test.ts index 075a2926d6366..e04571cc025b1 100644 --- a/packages/@aws-cdk/aws-lambda-python-alpha/test/function.test.ts +++ b/packages/@aws-cdk/aws-lambda-python-alpha/test/function.test.ts @@ -112,7 +112,7 @@ test('throws when entry does not exist', () => { test('throws with the wrong runtime family', () => { expect(() => new PythonFunction(stack, 'handler1', { entry: path.join(__dirname, 'lambda-handler'), - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, })).toThrow(/Only `PYTHON` runtimes are supported/); }); diff --git a/packages/@aws-cdk/aws-s3objectlambda-alpha/test/integ.s3objectlambda.ts b/packages/@aws-cdk/aws-s3objectlambda-alpha/test/integ.s3objectlambda.ts index ff85858ee0592..35a6ccc7942ad 100644 --- a/packages/@aws-cdk/aws-s3objectlambda-alpha/test/integ.s3objectlambda.ts +++ b/packages/@aws-cdk/aws-s3objectlambda-alpha/test/integ.s3objectlambda.ts @@ -9,13 +9,13 @@ class TestStack extends cdk.Stack { const bucket = new s3.Bucket(this, 'MyBucket'); const handler1 = new lambda.Function(this, 'MyFunction1', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromInline('foo'), }); const handler2 = new lambda.Function(this, 'MyFunction2', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromInline('foo'), }); diff --git a/packages/@aws-cdk/aws-s3objectlambda-alpha/test/s3objectlambda.test.ts b/packages/@aws-cdk/aws-s3objectlambda-alpha/test/s3objectlambda.test.ts index c0f1171ccef7a..414ecb0444d1b 100644 --- a/packages/@aws-cdk/aws-s3objectlambda-alpha/test/s3objectlambda.test.ts +++ b/packages/@aws-cdk/aws-s3objectlambda-alpha/test/s3objectlambda.test.ts @@ -12,7 +12,7 @@ beforeEach(() => { stack = new cdk.Stack(); bucket = new s3.Bucket(stack, 'MyBucket'); handler = new lambda.Function(stack, 'MyFunction', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.hello', code: new lambda.InlineCode('def hello(): pass'), }); diff --git a/packages/aws-cdk-lib/aws-apigateway/test/authorizers/integ.request-authorizer.lit.ts b/packages/aws-cdk-lib/aws-apigateway/test/authorizers/integ.request-authorizer.lit.ts index 3f1d8d3aa4935..e273c72cce89e 100644 --- a/packages/aws-cdk-lib/aws-apigateway/test/authorizers/integ.request-authorizer.lit.ts +++ b/packages/aws-cdk-lib/aws-apigateway/test/authorizers/integ.request-authorizer.lit.ts @@ -12,7 +12,7 @@ const app = new App(); const stack = new Stack(app, 'RequestAuthorizerInteg'); const authorizerFn = new lambda.Function(stack, 'MyAuthorizerFunction', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.AssetCode.fromAsset(path.join(__dirname, 'integ.request-authorizer.handler')), }); diff --git a/packages/aws-cdk-lib/aws-apigateway/test/authorizers/lambda.test.ts b/packages/aws-cdk-lib/aws-apigateway/test/authorizers/lambda.test.ts index 5bfd5b9efefa7..7eea5ca1ec00e 100644 --- a/packages/aws-cdk-lib/aws-apigateway/test/authorizers/lambda.test.ts +++ b/packages/aws-cdk-lib/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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); const auth = new TokenAuthorizer(stack, 'myauthorizer', { @@ -84,7 +84,7 @@ describe('lambda authorizer', () => { const func = new lambda.Function(stack, 'myfunction', { handler: 'handler', code: lambda.Code.fromInline('foo'), - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); const auth = new RequestAuthorizer(stack, 'myauthorizer', { @@ -159,7 +159,7 @@ describe('lambda authorizer', () => { const func = new lambda.Function(stack, 'myfunction', { handler: 'handler', code: lambda.Code.fromInline('foo'), - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); expect(() => new RequestAuthorizer(stack, 'myauthorizer', { @@ -175,7 +175,7 @@ describe('lambda authorizer', () => { const func = new lambda.Function(stack, 'myfunction', { handler: 'handler', code: lambda.Code.fromInline('foo'), - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); const auth = new TokenAuthorizer(stack, 'myauthorizer', { @@ -248,7 +248,7 @@ describe('lambda authorizer', () => { const func = new lambda.Function(stack, 'myfunction', { handler: 'handler', code: lambda.Code.fromInline('foo'), - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); const auth = new RequestAuthorizer(stack, 'myauthorizer', { @@ -319,7 +319,7 @@ describe('lambda authorizer', () => { const func = new lambda.Function(stack, 'myfunction', { handler: 'handler', code: lambda.Code.fromInline('foo'), - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); const role = new iam.Role(stack, 'authorizerassumerole', { @@ -409,7 +409,7 @@ describe('lambda authorizer', () => { const func = new lambda.Function(stack, 'myfunction', { handler: 'handler', code: lambda.Code.fromInline('foo'), - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); const role = new iam.Role(stack, 'authorizerassumerole', { @@ -500,7 +500,7 @@ describe('lambda authorizer', () => { const func = new lambda.Function(stack, 'myfunction', { handler: 'handler', code: lambda.Code.fromInline('foo'), - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); const auth = new TokenAuthorizer(stack, 'myauthorizer', { handler: func, @@ -514,7 +514,7 @@ describe('lambda authorizer', () => { const func = new lambda.Function(stack, 'myfunction', { handler: 'handler', code: lambda.Code.fromInline('foo'), - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); const auth = new RequestAuthorizer(stack, 'myauthorizer', { handler: func, @@ -559,7 +559,7 @@ describe('lambda authorizer', () => { const func = new lambda.Function(stack, 'myfunction', { handler: 'handler', code: lambda.Code.fromInline('foo'), - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); const auth = new RequestAuthorizer(stack, 'myauthorizer', { diff --git a/packages/aws-cdk-lib/aws-apigateway/test/cors.test.ts b/packages/aws-cdk-lib/aws-apigateway/test/cors.test.ts index a4969efc41d73..d26b9b8e1363f 100644 --- a/packages/aws-cdk-lib/aws-apigateway/test/cors.test.ts +++ b/packages/aws-cdk-lib/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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); // WHEN diff --git a/packages/aws-cdk-lib/aws-apigateway/test/deployment.test.ts b/packages/aws-cdk-lib/aws-apigateway/test/deployment.test.ts index e82ff90112518..eefc4bfd9bf97 100644 --- a/packages/aws-cdk-lib/aws-apigateway/test/deployment.test.ts +++ b/packages/aws-cdk-lib/aws-apigateway/test/deployment.test.ts @@ -198,12 +198,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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', }); const handler2 = new lambda.Function(stack2, 'handler2', { code: lambda.Code.fromAsset(path.join(__dirname, 'lambda')), - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', }); diff --git a/packages/aws-cdk-lib/aws-apigateway/test/integrations/lambda.test.ts b/packages/aws-cdk-lib/aws-apigateway/test/integrations/lambda.test.ts index 07642c8307086..fcbbc85f50050 100644 --- a/packages/aws-cdk-lib/aws-apigateway/test/integrations/lambda.test.ts +++ b/packages/aws-cdk-lib/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_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromInline('loo'), }); diff --git a/packages/aws-cdk-lib/aws-apigateway/test/lambda-api.test.ts b/packages/aws-cdk-lib/aws-apigateway/test/lambda-api.test.ts index a72bed650dbab..0db0f46ed9e79 100644 --- a/packages/aws-cdk-lib/aws-apigateway/test/lambda-api.test.ts +++ b/packages/aws-cdk-lib/aws-apigateway/test/lambda-api.test.ts @@ -12,7 +12,7 @@ describe('lambda api', () => { const handler = new lambda.Function(stack, 'handler', { handler: 'index.handler', code: lambda.Code.fromInline('boom'), - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); // WHEN @@ -74,7 +74,7 @@ describe('lambda api', () => { const handler = new lambda.Function(stack, 'handler', { handler: 'index.handler', code: lambda.Code.fromInline('boom'), - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); const alias = new lambda.Alias(stack, 'alias', { aliasName: 'my-alias', @@ -139,7 +139,7 @@ describe('lambda api', () => { const handler = new lambda.Function(stack, 'handler', { handler: 'index.handler', code: lambda.Code.fromInline('boom'), - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); // WHEN @@ -203,7 +203,7 @@ describe('lambda api', () => { const handler = new lambda.Function(stack, 'handler', { handler: 'index.handler', code: lambda.Code.fromInline('boom'), - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); expect(() => new apigw.LambdaRestApi(stack, 'lambda-rest-api', { @@ -224,7 +224,7 @@ describe('lambda api', () => { const handler = new lambda.Function(stack, 'handler', { handler: 'index.handler', code: lambda.Code.fromInline('boom'), - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); // WHEN @@ -278,7 +278,7 @@ describe('lambda api', () => { const handler = new lambda.Function(stack, 'handler', { handler: 'index.handler', code: lambda.Code.fromInline('boom'), - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); // WHEN @@ -340,7 +340,7 @@ describe('lambda api', () => { handler: new lambda.Function(stack, 'handler', { handler: 'index.handler', code: lambda.Code.fromInline('boom'), - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }), restApiName: cdk.PhysicalName.GENERATE_IF_NEEDED, }); diff --git a/packages/aws-cdk-lib/aws-apigateway/test/method.test.ts b/packages/aws-cdk-lib/aws-apigateway/test/method.test.ts index e5e1a0855c3d5..0201eada97ce8 100644 --- a/packages/aws-cdk-lib/aws-apigateway/test/method.test.ts +++ b/packages/aws-cdk-lib/aws-apigateway/test/method.test.ts @@ -643,7 +643,7 @@ describe('method', () => { const func = new lambda.Function(stack, 'myfunction', { handler: 'handler', code: lambda.Code.fromInline('foo'), - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); const auth = new apigw.TokenAuthorizer(stack, 'myauthorizer1', { diff --git a/packages/aws-cdk-lib/aws-appsync/test/appsync-auth.test.ts b/packages/aws-cdk-lib/aws-appsync/test/appsync-auth.test.ts index a6a6f0a2b41f0..7503303a29623 100644 --- a/packages/aws-cdk-lib/aws-appsync/test/appsync-auth.test.ts +++ b/packages/aws-cdk-lib/aws-appsync/test/appsync-auth.test.ts @@ -637,7 +637,7 @@ describe('AppSync Lambda Authorization', () => { let fn: lambda.Function; beforeEach(() => { fn = new lambda.Function(stack, 'auth-function', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromInline('/* lambda authentication code here.*/'), }); diff --git a/packages/aws-cdk-lib/aws-appsync/test/appsync-caching-config.test.ts b/packages/aws-cdk-lib/aws-appsync/test/appsync-caching-config.test.ts index 918beab56a1cb..8ccaeacb4ed1f 100644 --- a/packages/aws-cdk-lib/aws-appsync/test/appsync-caching-config.test.ts +++ b/packages/aws-cdk-lib/aws-appsync/test/appsync-caching-config.test.ts @@ -25,7 +25,7 @@ describe('Lambda caching config', () => { func = new lambda.Function(stack, 'func', { code: lambda.Code.fromAsset(path.join(__dirname, 'verify/lambda-tutorial')), handler: 'lambda-tutorial.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); }); diff --git a/packages/aws-cdk-lib/aws-appsync/test/appsync-lambda.test.ts b/packages/aws-cdk-lib/aws-appsync/test/appsync-lambda.test.ts index 46e39e15caaaf..2d3db2414db17 100644 --- a/packages/aws-cdk-lib/aws-appsync/test/appsync-lambda.test.ts +++ b/packages/aws-cdk-lib/aws-appsync/test/appsync-lambda.test.ts @@ -22,7 +22,7 @@ describe('Lambda Data Source configuration', () => { func = new lambda.Function(stack, 'func', { code: lambda.Code.fromAsset(path.join(__dirname, 'verify/iam-query')), handler: 'iam-query.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); }); @@ -78,7 +78,7 @@ describe('Lambda Data Source configuration', () => { const dummyFunction = new lambda.Function(newStack, 'func', { code: lambda.Code.fromAsset(path.join(__dirname, 'verify/iam-query')), handler: 'iam-query.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); graphqlapi.addLambdaDataSource(`data-${badCharacter}-source`, dummyFunction); @@ -132,7 +132,7 @@ describe('adding lambda data source from imported api', () => { func = new lambda.Function(stack, 'func', { code: lambda.Code.fromAsset(path.join(__dirname, 'verify/iam-query')), handler: 'iam-query.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); }); diff --git a/packages/aws-cdk-lib/aws-appsync/test/appsync-mapping-template.test.ts b/packages/aws-cdk-lib/aws-appsync/test/appsync-mapping-template.test.ts index 18d96ac45232c..06a5f268273aa 100644 --- a/packages/aws-cdk-lib/aws-appsync/test/appsync-mapping-template.test.ts +++ b/packages/aws-cdk-lib/aws-appsync/test/appsync-mapping-template.test.ts @@ -26,7 +26,7 @@ describe('Lambda Mapping Templates', () => { func = new lambda.Function(stack, 'func', { code: lambda.Code.fromAsset(path.join(__dirname, 'verify/lambda-tutorial')), handler: 'lambda-tutorial.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); }); diff --git a/packages/aws-cdk-lib/aws-autoscaling-hooktargets/test/hooks.test.ts b/packages/aws-cdk-lib/aws-autoscaling-hooktargets/test/hooks.test.ts index e208befc8ec6b..bdb213389f736 100644 --- a/packages/aws-cdk-lib/aws-autoscaling-hooktargets/test/hooks.test.ts +++ b/packages/aws-cdk-lib/aws-autoscaling-hooktargets/test/hooks.test.ts @@ -120,7 +120,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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.index', }); @@ -164,7 +164,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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.index', }); @@ -296,7 +296,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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.index', }); const myrole = new iam.Role(stack, 'MyRole', { diff --git a/packages/aws-cdk-lib/aws-cloudfront/test/distribution.test.ts b/packages/aws-cdk-lib/aws-cloudfront/test/distribution.test.ts index af3b268688703..d1ed9bc37492b 100644 --- a/packages/aws-cdk-lib/aws-cloudfront/test/distribution.test.ts +++ b/packages/aws-cdk-lib/aws-cloudfront/test/distribution.test.ts @@ -663,7 +663,7 @@ describe('with Lambda@Edge functions', () => { beforeEach(() => { lambdaFunction = new lambda.Function(stack, 'Function', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('whatever'), handler: 'index.handler', }); @@ -791,7 +791,7 @@ describe('with Lambda@Edge functions', () => { test('with removable env vars', () => { const envLambdaFunction = new lambda.Function(stack, 'EnvFunction', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('whateverwithenv'), handler: 'index.handler', }); @@ -819,7 +819,7 @@ describe('with Lambda@Edge functions', () => { test('with incompatible env vars', () => { const envLambdaFunction = new lambda.Function(stack, 'EnvFunction', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('whateverwithenv'), handler: 'index.handler', environment: { @@ -845,7 +845,7 @@ describe('with Lambda@Edge functions', () => { test('with singleton function', () => { const singleton = new lambda.SingletonFunction(stack, 'Singleton', { uuid: 'singleton-for-cloudfront', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('code'), handler: 'index.handler', }); diff --git a/packages/aws-cdk-lib/aws-cloudfront/test/experimental/edge-function.test.ts b/packages/aws-cdk-lib/aws-cloudfront/test/experimental/edge-function.test.ts index 54dff2ef5487e..288a439dfda75 100644 --- a/packages/aws-cdk-lib/aws-cloudfront/test/experimental/edge-function.test.ts +++ b/packages/aws-cdk-lib/aws-cloudfront/test/experimental/edge-function.test.ts @@ -90,7 +90,7 @@ describe('stacks', () => { Code: { ZipFile: 'foo' }, Handler: 'index.handler', Role: { 'Fn::GetAtt': ['MyFnServiceRoleF3016589', 'Arn'] }, - Runtime: 'nodejs14.x', + Runtime: 'nodejs16.x', }); Template.fromStack(fnStack).hasResourceProperties('AWS::Lambda::Version', { FunctionName: { Ref: 'MyFn6F8F742F' }, @@ -152,7 +152,7 @@ describe('stacks', () => { Code: { ZipFile: 'foo' }, Handler: 'index.handler', Role: { 'Fn::GetAtt': ['MyFnServiceRole3F9D41E1', 'Arn'] }, - Runtime: 'nodejs14.x', + Runtime: 'nodejs16.x', }); Template.fromStack(stack).hasResourceProperties('AWS::Lambda::Version', { FunctionName: { Ref: 'MyFn223608AD' }, @@ -310,7 +310,7 @@ function defaultEdgeFunctionProps(stackId?: string) { return { code: lambda.Code.fromInline('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, stackId: stackId, }; } diff --git a/packages/aws-cdk-lib/aws-cloudfront/test/web-distribution.test.ts b/packages/aws-cdk-lib/aws-cloudfront/test/web-distribution.test.ts index 360870588324c..f22b21ee20bb2 100644 --- a/packages/aws-cdk-lib/aws-cloudfront/test/web-distribution.test.ts +++ b/packages/aws-cdk-lib/aws-cloudfront/test/web-distribution.test.ts @@ -837,7 +837,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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); new CloudFrontWebDistribution(stack, 'AnAmazingWebsiteProbably', { @@ -886,7 +886,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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); lambdaFunction.addEnvironment('KEY', 'value', { removeInEdge: true }); @@ -923,7 +923,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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, environment: { KEY: 'value', }, @@ -1307,7 +1307,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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); const lambdaVersion = new lambda.Version(stack, 'LambdaVersion', { lambda: fn }); diff --git a/packages/aws-cdk-lib/aws-cloudtrail/test/cloudtrail.test.ts b/packages/aws-cdk-lib/aws-cloudtrail/test/cloudtrail.test.ts index 826f46e21bab7..33e611b902a4e 100644 --- a/packages/aws-cdk-lib/aws-cloudtrail/test/cloudtrail.test.ts +++ b/packages/aws-cdk-lib/aws-cloudtrail/test/cloudtrail.test.ts @@ -571,7 +571,7 @@ describe('cloudtrail', () => { test('for Lambda function data event', () => { const stack = getTestStack(); const lambdaFunction = new lambda.Function(stack, 'LambdaFunction', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'hello.handler', code: lambda.Code.fromInline('exports.handler = {}'), }); diff --git a/packages/aws-cdk-lib/aws-cloudtrail/test/integ.cloudtrail-supplied-bucket.lit.ts b/packages/aws-cdk-lib/aws-cloudtrail/test/integ.cloudtrail-supplied-bucket.lit.ts index 0614109c8a2ec..b514d2c89da05 100644 --- a/packages/aws-cdk-lib/aws-cloudtrail/test/integ.cloudtrail-supplied-bucket.lit.ts +++ b/packages/aws-cdk-lib/aws-cloudtrail/test/integ.cloudtrail-supplied-bucket.lit.ts @@ -13,7 +13,7 @@ const bucket = new s3.Bucket(stack, 'Bucket', { autoDeleteObjects: true, }); const lambdaFunction = new lambda.Function(stack, 'LambdaFunction', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'hello.handler', code: lambda.Code.fromInline('exports.handler = {}'), }); diff --git a/packages/aws-cdk-lib/aws-cloudtrail/test/integ.cloudtrail.lit.ts b/packages/aws-cdk-lib/aws-cloudtrail/test/integ.cloudtrail.lit.ts index 52736ff6ffeb1..42b62a767fab5 100644 --- a/packages/aws-cdk-lib/aws-cloudtrail/test/integ.cloudtrail.lit.ts +++ b/packages/aws-cdk-lib/aws-cloudtrail/test/integ.cloudtrail.lit.ts @@ -13,7 +13,7 @@ const bucket = new s3.Bucket(stack, 'Bucket', { }); const topic = new sns.Topic(stack, 'Topic'); const lambdaFunction = new lambda.Function(stack, 'LambdaFunction', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'hello.handler', code: lambda.Code.fromInline('exports.handler = {}'), }); diff --git a/packages/aws-cdk-lib/aws-codedeploy/test/lambda/custom-deployment-config.test.ts b/packages/aws-cdk-lib/aws-codedeploy/test/lambda/custom-deployment-config.test.ts index 53b38730d608a..80ccbf26347f1 100644 --- a/packages/aws-cdk-lib/aws-codedeploy/test/lambda/custom-deployment-config.test.ts +++ b/packages/aws-cdk-lib/aws-codedeploy/test/lambda/custom-deployment-config.test.ts @@ -8,7 +8,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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); } function mockAlias(stack: cdk.Stack) { diff --git a/packages/aws-cdk-lib/aws-codedeploy/test/lambda/deployment-group.test.ts b/packages/aws-cdk-lib/aws-codedeploy/test/lambda/deployment-group.test.ts index 9043ddf0f28ec..6d59bbdd6cb45 100644 --- a/packages/aws-cdk-lib/aws-codedeploy/test/lambda/deployment-group.test.ts +++ b/packages/aws-cdk-lib/aws-codedeploy/test/lambda/deployment-group.test.ts @@ -11,7 +11,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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); } function mockAlias(stack: cdk.Stack) { diff --git a/packages/aws-cdk-lib/aws-codepipeline-actions/test/integ.lambda-deployed-through-codepipeline.lit.ts b/packages/aws-cdk-lib/aws-codepipeline-actions/test/integ.lambda-deployed-through-codepipeline.lit.ts index 8c2a13a20bc85..96f5706b1b899 100644 --- a/packages/aws-cdk-lib/aws-codepipeline-actions/test/integ.lambda-deployed-through-codepipeline.lit.ts +++ b/packages/aws-cdk-lib/aws-codepipeline-actions/test/integ.lambda-deployed-through-codepipeline.lit.ts @@ -14,7 +14,7 @@ const lambdaCode = lambda.Code.fromCfnParameters(); new lambda.Function(lambdaStack, 'Lambda', { code: lambdaCode, handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); // other resources that your Lambda needs, added to the lambdaStack... diff --git a/packages/aws-cdk-lib/aws-codepipeline-actions/test/lambda/lambda-invoke-action.test.ts b/packages/aws-cdk-lib/aws-codepipeline-actions/test/lambda/lambda-invoke-action.test.ts index f64b47d34b38a..7cea2bd59406e 100644 --- a/packages/aws-cdk-lib/aws-codepipeline-actions/test/lambda/lambda-invoke-action.test.ts +++ b/packages/aws-cdk-lib/aws-codepipeline-actions/test/lambda/lambda-invoke-action.test.ts @@ -357,7 +357,7 @@ function stackIncludingLambdaInvokeCodePipeline(props: HelperProps, app?: App) { lambda: new lambda.Function(stack, 'Lambda', { code: lambda.Code.fromCfnParameters(), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }), userParameters: props.userParams, userParametersString: props.userParamsString, diff --git a/packages/aws-cdk-lib/aws-codepipeline-actions/test/pipeline.test.ts b/packages/aws-cdk-lib/aws-codepipeline-actions/test/pipeline.test.ts index 9c2bdedf5310c..0a7f5a589fb53 100644 --- a/packages/aws-cdk-lib/aws-codepipeline-actions/test/pipeline.test.ts +++ b/packages/aws-cdk-lib/aws-codepipeline-actions/test/pipeline.test.ts @@ -427,7 +427,7 @@ describe('pipeline', () => { const lambdaFun = new lambda.Function(stack, 'Function', { code: new lambda.InlineCode('bla'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); const pipeline = new codepipeline.Pipeline(stack, 'Pipeline'); diff --git a/packages/aws-cdk-lib/aws-cognito/test/user-pool.test.ts b/packages/aws-cdk-lib/aws-cognito/test/user-pool.test.ts index 0c2c7c42b3ccd..52fd586f34deb 100644 --- a/packages/aws-cdk-lib/aws-cognito/test/user-pool.test.ts +++ b/packages/aws-cdk-lib/aws-cognito/test/user-pool.test.ts @@ -520,12 +520,12 @@ describe('User Pool', () => { const fn1 = new lambda.Function(stack, 'fn1', { code: lambda.Code.fromInline('foo'), - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', }); const fn2 = new lambda.Function(stack, 'fn2', { code: lambda.Code.fromInline('foo'), - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', }); @@ -2114,7 +2114,7 @@ function fooFunction(scope: Construct, name: string): lambda.IFunction { return new lambda.Function(scope, name, { functionName: name, code: lambda.Code.fromInline('foo'), - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', }); } diff --git a/packages/aws-cdk-lib/aws-eks/lib/cluster.ts b/packages/aws-cdk-lib/aws-eks/lib/cluster.ts index 545eb31bcadeb..83a2febe00c1e 100644 --- a/packages/aws-cdk-lib/aws-eks/lib/cluster.ts +++ b/packages/aws-cdk-lib/aws-eks/lib/cluster.ts @@ -611,7 +611,7 @@ export interface ClusterOptions extends CommonClusterOptions { * ```ts * const layer = new lambda.LayerVersion(this, 'proxy-agent-layer', { * code: lambda.Code.fromAsset(`${__dirname}/layer.zip`), - * compatibleRuntimes: [lambda.Runtime.NODEJS_14_X], + * compatibleRuntimes: [lambda.Runtime.NODEJS_16_X], * }); * ``` * diff --git a/packages/aws-cdk-lib/aws-events-targets/lib/aws-api.ts b/packages/aws-cdk-lib/aws-events-targets/lib/aws-api.ts index 028e48fc224d5..f0a5eb59697b6 100644 --- a/packages/aws-cdk-lib/aws-events-targets/lib/aws-api.ts +++ b/packages/aws-cdk-lib/aws-events-targets/lib/aws-api.ts @@ -86,7 +86,7 @@ export class AwsApi implements events.IRuleTarget { code: lambda.Code.fromAsset(path.join(__dirname, 'aws-api-handler'), { exclude: ['*.ts'], }), - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', uuid: 'b4cf1abd-4e4f-4bc6-9944-1af7ccd9ec37', lambdaPurpose: 'AWS', diff --git a/packages/aws-cdk-lib/aws-events-targets/test/api-gateway/api-gateway.test.ts b/packages/aws-cdk-lib/aws-events-targets/test/api-gateway/api-gateway.test.ts index 2ebeccc5f9c6b..d3139db831c9d 100644 --- a/packages/aws-cdk-lib/aws-events-targets/test/api-gateway/api-gateway.test.ts +++ b/packages/aws-cdk-lib/aws-events-targets/test/api-gateway/api-gateway.test.ts @@ -255,7 +255,7 @@ function newTestRestApi(scope: constructs.Construct, suffix = '') { const lambdaFunctin = new lambda.Function(scope, `MyLambda${suffix}`, { code: new lambda.InlineCode('foo'), handler: 'bar', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); return new api.LambdaRestApi( scope, `MyLambdaRestApi${suffix}`, { handler: lambdaFunctin, diff --git a/packages/aws-cdk-lib/aws-iam/lib/oidc-provider/external.ts b/packages/aws-cdk-lib/aws-iam/lib/oidc-provider/external.ts index 17332605a70ba..369ca5479427d 100644 --- a/packages/aws-cdk-lib/aws-iam/lib/oidc-provider/external.ts +++ b/packages/aws-cdk-lib/aws-iam/lib/oidc-provider/external.ts @@ -1,11 +1,4 @@ /* istanbul ignore file */ -// the X509 certificate API is available only in node16. -// since we compile the repo against node 14, typechecking it will fail. -// its currently too complex to configure node16 only on this -// file (jsii doesn't support custom tsconfig) -// so we disable typechecking. don't worry, we have sufficient integ tests that -// validate this code doesn't break. -// @ts-nocheck import { X509Certificate } from 'node:crypto'; import * as tls from 'tls'; import * as url from 'url'; @@ -95,7 +88,7 @@ function printCertificate(cert: X509Certificate) { * @param certDate The valid to date for the certificate * @returns The number of days the certificate is valid wrt current date */ -function getCertificateValidity(certDate: Date): Number { +function getCertificateValidity(certDate: Date): number { const millisecondsInDay = 24 * 60 * 60 * 1000; const currentDate = new Date(); diff --git a/packages/aws-cdk-lib/aws-iam/test/permissions-boundary.test.ts b/packages/aws-cdk-lib/aws-iam/test/permissions-boundary.test.ts index 39029eb10b3c4..bfca20d90f99c 100644 --- a/packages/aws-cdk-lib/aws-iam/test/permissions-boundary.test.ts +++ b/packages/aws-cdk-lib/aws-iam/test/permissions-boundary.test.ts @@ -76,7 +76,7 @@ test('apply boundary to role created by a custom resource', () => { // GIVEN const provider = CustomResourceProvider.getOrCreateProvider(stack, 'Empty', { codeDirectory: path.join(__dirname, 'custom-resource'), - runtime: CustomResourceProviderRuntime.NODEJS_14_X, + runtime: CustomResourceProviderRuntime.NODEJS_16_X, }); // WHEN diff --git a/packages/aws-cdk-lib/aws-lambda-destinations/test/destinations.test.ts b/packages/aws-cdk-lib/aws-lambda-destinations/test/destinations.test.ts index 243e0df37be34..b3fb47027d4e5 100644 --- a/packages/aws-cdk-lib/aws-lambda-destinations/test/destinations.test.ts +++ b/packages/aws-cdk-lib/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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }; test('event bus as destination', () => { diff --git a/packages/aws-cdk-lib/aws-lambda-event-sources/test/test-function.ts b/packages/aws-cdk-lib/aws-lambda-event-sources/test/test-function.ts index 1a6b0ab62385f..94a73c88441d3 100644 --- a/packages/aws-cdk-lib/aws-lambda-event-sources/test/test-function.ts +++ b/packages/aws-cdk-lib/aws-lambda-event-sources/test/test-function.ts @@ -6,7 +6,7 @@ export class TestFunction extends lambda.Function { super(scope, id, { handler: 'index.handler', code: lambda.Code.fromInline(`exports.handler = ${handler.toString()}`), - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); } } diff --git a/packages/aws-cdk-lib/aws-lambda-nodejs/lib/bundling.ts b/packages/aws-cdk-lib/aws-lambda-nodejs/lib/bundling.ts index 5fd9024d8120e..c3a098c675ba5 100644 --- a/packages/aws-cdk-lib/aws-lambda-nodejs/lib/bundling.ts +++ b/packages/aws-cdk-lib/aws-lambda-nodejs/lib/bundling.ts @@ -2,6 +2,7 @@ import * as os from 'os'; import * as path from 'path'; import { PackageInstallation } from './package-installation'; import { LockFile, PackageManager } from './package-manager'; +import { DEFAULT_RUNTIME } from './private/default-runtime'; import { BundlingOptions, OutputFormat, SourceMapMode } from './types'; import { exec, extractDependencies, findUp, getTsconfigCompilerOptions } from './util'; import { Architecture, AssetCode, Code, Runtime } from '../../aws-lambda'; @@ -135,8 +136,8 @@ export class Bundling implements cdk.BundlingOptions { { buildArgs: { ...props.buildArgs ?? {}, - // If runtime isn't passed use regional default, lowest common denominator is node14 - IMAGE: (props.runtime ?? Runtime.NODEJS_14_X).bundlingImage.image, + // If runtime isn't passed use regional default, lowest common denominator is node16 + IMAGE: (props.runtime ?? Runtime.NODEJS_18_X).bundlingImage.image, ESBUILD_VERSION: props.esbuildVersion ?? ESBUILD_MAJOR_VERSION, }, platform: props.architecture.dockerPlatform, @@ -200,7 +201,7 @@ export class Bundling implements cdk.BundlingOptions { const esbuildCommand: string[] = [ options.esbuildRunner, '--bundle', `"${relativeEntryPath}"`, - `--target=${this.props.target ?? toTarget(this.props.runtime ?? Runtime.NODEJS_14_X)}`, + `--target=${this.props.target ?? toTarget(this.props.runtime ?? DEFAULT_RUNTIME)}`, '--platform=node', ...this.props.format ? [`--format=${this.props.format}`] : [], `--outfile="${pathJoin(options.outputDir, outFile)}"`, @@ -394,7 +395,7 @@ function toTarget(runtime: Runtime): string { } function toCliArgs(esbuildArgs: { [key: string]: string | boolean }): string { - const args = []; + const args = new Array(); for (const [key, value] of Object.entries(esbuildArgs)) { if (value === true || value === '') { @@ -407,7 +408,11 @@ function toCliArgs(esbuildArgs: { [key: string]: string | boolean }): string { return args.join(' '); } -function isSdkV2Runtime(runtime?: Runtime): boolean { +/** + * Detect of the a given Node.js runtime uses SDKv2 + * @param runtime Optional. Default runtime if not set. + */ +function isSdkV2Runtime(runtime: Runtime = DEFAULT_RUNTIME): boolean { const sdkV2RuntimeList = [ Runtime.NODEJS, Runtime.NODEJS_4_3, @@ -418,10 +423,6 @@ function isSdkV2Runtime(runtime?: Runtime): boolean { Runtime.NODEJS_14_X, Runtime.NODEJS_16_X, ]; - if (runtime) { - return sdkV2RuntimeList.some((r) => {return r.family === runtime.family && r.name === runtime.name;}); - } else { - // If undefined regional default is used which is node14/16 - return true; - } + + return sdkV2RuntimeList.some((r) => {return r.family === runtime.family && r.name === runtime.name;}); } diff --git a/packages/aws-cdk-lib/aws-lambda-nodejs/lib/function.ts b/packages/aws-cdk-lib/aws-lambda-nodejs/lib/function.ts index 2f4d9525c8130..0956124100e9b 100644 --- a/packages/aws-cdk-lib/aws-lambda-nodejs/lib/function.ts +++ b/packages/aws-cdk-lib/aws-lambda-nodejs/lib/function.ts @@ -3,6 +3,7 @@ import * as path from 'path'; import { Construct } from 'constructs'; import { Bundling } from './bundling'; import { LockFile } from './package-manager'; +import { DEFAULT_RUNTIME } from './private/default-runtime'; import { BundlingOptions } from './types'; import { callsites, findUpMultiple } from './util'; import { Architecture } from '../../aws-lambda'; @@ -36,7 +37,7 @@ export interface NodejsFunctionProps extends lambda.FunctionOptions { * The runtime environment. Only runtimes of the Node.js family are * supported. * - * @default Runtime.NODEJS_14_X + * @default Runtime.NODEJS_18_X */ readonly runtime?: lambda.Runtime; @@ -101,7 +102,7 @@ export class NodejsFunction extends lambda.Function { super(scope, id, { ...props, - runtime: props.runtime ?? lambda.Runtime.NODEJS_18_X, + runtime: props.runtime ?? DEFAULT_RUNTIME, code: Bundling.bundle({ ...props.bundling ?? {}, entry, diff --git a/packages/aws-cdk-lib/aws-lambda-nodejs/lib/private/default-runtime.ts b/packages/aws-cdk-lib/aws-lambda-nodejs/lib/private/default-runtime.ts new file mode 100644 index 0000000000000..348afc72b48c9 --- /dev/null +++ b/packages/aws-cdk-lib/aws-lambda-nodejs/lib/private/default-runtime.ts @@ -0,0 +1,3 @@ +import { Runtime } from '../../../aws-lambda/lib'; + +export const DEFAULT_RUNTIME = Runtime.NODEJS_18_X; \ No newline at end of file diff --git a/packages/aws-cdk-lib/aws-lambda-nodejs/test/bundling.test.ts b/packages/aws-cdk-lib/aws-lambda-nodejs/test/bundling.test.ts index 59845e6d40671..80cf8d95fa6b7 100644 --- a/packages/aws-cdk-lib/aws-lambda-nodejs/test/bundling.test.ts +++ b/packages/aws-cdk-lib/aws-lambda-nodejs/test/bundling.test.ts @@ -43,7 +43,7 @@ test('esbuild bundling in Docker', () => { entry, projectRoot, depsLockFilePath, - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, architecture: Architecture.X86_64, environment: { KEY: 'value', @@ -63,7 +63,7 @@ test('esbuild bundling in Docker', () => { }, command: [ 'bash', '-c', - 'esbuild --bundle "/asset-input/lib/handler.ts" --target=node14 --platform=node --outfile="/asset-output/index.js" --external:aws-sdk --loader:.png=dataurl', + 'esbuild --bundle "/asset-input/lib/handler.ts" --target=node16 --platform=node --outfile="/asset-output/index.js" --external:aws-sdk --loader:.png=dataurl', ], workingDirectory: '/', }), @@ -82,7 +82,7 @@ test('esbuild bundling with handler named index.ts', () => { entry: '/project/lib/index.ts', projectRoot, depsLockFilePath, - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, architecture: Architecture.X86_64, forceDockerBundling: true, }); @@ -93,7 +93,7 @@ test('esbuild bundling with handler named index.ts', () => { bundling: expect.objectContaining({ command: [ 'bash', '-c', - 'esbuild --bundle "/asset-input/lib/index.ts" --target=node14 --platform=node --outfile="/asset-output/index.js" --external:aws-sdk', + 'esbuild --bundle "/asset-input/lib/index.ts" --target=node16 --platform=node --outfile="/asset-output/index.js" --external:aws-sdk', ], }), }); @@ -104,7 +104,7 @@ test('esbuild bundling with tsx handler', () => { entry: '/project/lib/handler.tsx', projectRoot, depsLockFilePath, - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, architecture: Architecture.X86_64, forceDockerBundling: true, }); @@ -115,7 +115,7 @@ test('esbuild bundling with tsx handler', () => { bundling: expect.objectContaining({ command: [ 'bash', '-c', - 'esbuild --bundle "/asset-input/lib/handler.tsx" --target=node14 --platform=node --outfile="/asset-output/index.js" --external:aws-sdk', + 'esbuild --bundle "/asset-input/lib/handler.tsx" --target=node16 --platform=node --outfile="/asset-output/index.js" --external:aws-sdk', ], }), }); @@ -130,7 +130,7 @@ test('esbuild with Windows paths', () => { Bundling.bundle({ entry: 'C:\\my-project\\lib\\entry.ts', - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, architecture: Architecture.X86_64, projectRoot: 'C:\\my-project', depsLockFilePath: 'C:\\my-project\\package-lock.json', @@ -154,7 +154,7 @@ test('esbuild bundling with externals and dependencies', () => { entry: __filename, projectRoot: path.dirname(packageLock), depsLockFilePath: packageLock, - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, architecture: Architecture.X86_64, externalModules: ['abc'], nodeModules: ['delay'], @@ -168,7 +168,7 @@ test('esbuild bundling with externals and dependencies', () => { command: [ 'bash', '-c', [ - 'esbuild --bundle "/asset-input/test/bundling.test.js" --target=node14 --platform=node --outfile="/asset-output/index.js" --external:abc --external:delay', + 'esbuild --bundle "/asset-input/test/bundling.test.js" --target=node16 --platform=node --outfile="/asset-output/index.js" --external:abc --external:delay', `echo \'{\"dependencies\":{\"delay\":\"${delayVersion}\"}}\' > "/asset-output/package.json"`, 'cp "/asset-input/package-lock.json" "/asset-output/package-lock.json"', 'cd "/asset-output"', @@ -184,7 +184,7 @@ test('esbuild bundling with esbuild options', () => { entry, projectRoot, depsLockFilePath, - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, architecture: Architecture.X86_64, minify: true, sourceMap: true, @@ -261,7 +261,7 @@ test('esbuild bundling source map default', () => { entry, projectRoot, depsLockFilePath, - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, architecture: Architecture.X86_64, sourceMap: true, sourceMapMode: SourceMapMode.DEFAULT, @@ -274,7 +274,7 @@ test('esbuild bundling source map default', () => { command: [ 'bash', '-c', [ - 'esbuild --bundle "/asset-input/lib/handler.ts" --target=node14 --platform=node --outfile="/asset-output/index.js"', + 'esbuild --bundle "/asset-input/lib/handler.ts" --target=node16 --platform=node --outfile="/asset-output/index.js"', '--sourcemap --external:aws-sdk', ].join(' '), ], @@ -308,7 +308,7 @@ test('esbuild bundling source map inline', () => { entry, projectRoot, depsLockFilePath, - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, architecture: Architecture.X86_64, sourceMap: true, sourceMapMode: SourceMapMode.INLINE, @@ -321,7 +321,7 @@ test('esbuild bundling source map inline', () => { command: [ 'bash', '-c', [ - 'esbuild --bundle "/asset-input/lib/handler.ts" --target=node14 --platform=node --outfile="/asset-output/index.js"', + 'esbuild --bundle "/asset-input/lib/handler.ts" --target=node16 --platform=node --outfile="/asset-output/index.js"', '--sourcemap=inline --external:aws-sdk', ].join(' '), ], @@ -334,7 +334,7 @@ test('esbuild bundling is correctly done with custom runtime matching predefined entry, projectRoot, depsLockFilePath, - runtime: new Runtime('nodejs14.x', RuntimeFamily.NODEJS, { supportsInlineCode: true }), + runtime: new Runtime('nodejs16.x', RuntimeFamily.NODEJS, { supportsInlineCode: true }), architecture: Architecture.X86_64, sourceMapMode: SourceMapMode.INLINE, }); @@ -345,7 +345,7 @@ test('esbuild bundling is correctly done with custom runtime matching predefined command: [ 'bash', '-c', [ - 'esbuild --bundle "/asset-input/lib/handler.ts" --target=node14 --platform=node --outfile="/asset-output/index.js"', + 'esbuild --bundle "/asset-input/lib/handler.ts" --target=node16 --platform=node --outfile="/asset-output/index.js"', '--sourcemap=inline --external:aws-sdk', ].join(' '), ], @@ -358,7 +358,7 @@ test('esbuild bundling source map enabled when only source map mode exists', () entry, projectRoot, depsLockFilePath, - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, architecture: Architecture.X86_64, sourceMapMode: SourceMapMode.INLINE, }); @@ -370,7 +370,7 @@ test('esbuild bundling source map enabled when only source map mode exists', () command: [ 'bash', '-c', [ - 'esbuild --bundle "/asset-input/lib/handler.ts" --target=node14 --platform=node --outfile="/asset-output/index.js"', + 'esbuild --bundle "/asset-input/lib/handler.ts" --target=node16 --platform=node --outfile="/asset-output/index.js"', '--sourcemap=inline --external:aws-sdk', ].join(' '), ], @@ -384,7 +384,7 @@ test('esbuild bundling throws when sourceMapMode used with false sourceMap', () entry, projectRoot, depsLockFilePath, - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, architecture: Architecture.X86_64, sourceMap: false, sourceMapMode: SourceMapMode.INLINE, @@ -398,7 +398,7 @@ test('Detects yarn.lock', () => { entry: __filename, projectRoot: path.dirname(yarnLock), depsLockFilePath: yarnLock, - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, architecture: Architecture.X86_64, nodeModules: ['delay'], forceDockerBundling: true, @@ -421,7 +421,7 @@ test('Detects pnpm-lock.yaml', () => { entry: __filename, projectRoot, depsLockFilePath: pnpmLock, - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, architecture: Architecture.X86_64, nodeModules: ['delay'], forceDockerBundling: true, @@ -443,7 +443,7 @@ test('with Docker build args', () => { entry, projectRoot, depsLockFilePath, - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, architecture: Architecture.X86_64, buildArgs: { HELLO: 'WORLD', @@ -472,7 +472,7 @@ test('Local bundling', () => { entry, projectRoot, depsLockFilePath, - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, architecture: Architecture.X86_64, environment: { KEY: 'value', @@ -482,7 +482,7 @@ test('Local bundling', () => { expect(bundler.local).toBeDefined(); - const tryBundle = bundler.local?.tryBundle('/outdir', { image: Runtime.NODEJS_14_X.bundlingDockerImage }); + const tryBundle = bundler.local?.tryBundle('/outdir', { image: Runtime.NODEJS_16_X.bundlingDockerImage }); expect(tryBundle).toBe(true); expect(spawnSyncMock).toHaveBeenCalledWith( @@ -510,12 +510,12 @@ test('Incorrect esbuild version', () => { entry, projectRoot, depsLockFilePath, - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, architecture: Architecture.X86_64, }); expect(() => bundler.local?.tryBundle('/outdir', { - image: Runtime.NODEJS_14_X.bundlingImage, + image: Runtime.NODEJS_16_X.bundlingImage, })).toThrow(/Expected esbuild version 0.x but got 3.4.5/); }); @@ -524,7 +524,7 @@ test('Custom bundling docker image', () => { entry, projectRoot, depsLockFilePath, - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, architecture: Architecture.X86_64, dockerImage: DockerImage.fromRegistry('my-custom-image'), forceDockerBundling: true, @@ -543,7 +543,7 @@ test('with command hooks', () => { entry, projectRoot, depsLockFilePath, - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, architecture: Architecture.X86_64, commandHooks: { beforeBundling(inputDir: string, outputDir: string): string[] { @@ -579,7 +579,7 @@ test('esbuild bundling with projectRoot', () => { projectRoot: '/project', depsLockFilePath, tsconfig, - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, architecture: Architecture.X86_64, }); @@ -589,7 +589,7 @@ test('esbuild bundling with projectRoot', () => { bundling: expect.objectContaining({ command: [ 'bash', '-c', - 'esbuild --bundle "/asset-input/lib/index.ts" --target=node14 --platform=node --outfile="/asset-output/index.js" --external:aws-sdk --tsconfig=/asset-input/lib/custom-tsconfig.ts', + 'esbuild --bundle "/asset-input/lib/index.ts" --target=node16 --platform=node --outfile="/asset-output/index.js" --external:aws-sdk --tsconfig=/asset-input/lib/custom-tsconfig.ts', ], }), }); @@ -602,7 +602,7 @@ test('esbuild bundling with projectRoot and externals and dependencies', () => { entry: __filename, projectRoot: repoRoot, depsLockFilePath: packageLock, - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, architecture: Architecture.X86_64, externalModules: ['abc'], nodeModules: ['delay'], @@ -616,7 +616,7 @@ test('esbuild bundling with projectRoot and externals and dependencies', () => { command: [ 'bash', '-c', [ - 'esbuild --bundle "/asset-input/packages/aws-cdk-lib/aws-lambda-nodejs/test/bundling.test.js" --target=node14 --platform=node --outfile="/asset-output/index.js" --external:abc --external:delay', + 'esbuild --bundle "/asset-input/packages/aws-cdk-lib/aws-lambda-nodejs/test/bundling.test.js" --target=node16 --platform=node --outfile="/asset-output/index.js" --external:abc --external:delay', `echo \'{\"dependencies\":{\"delay\":\"${delayVersion}\"}}\' > "/asset-output/package.json"`, 'cp "/asset-input/common/package-lock.json" "/asset-output/package-lock.json"', 'cd "/asset-output"', @@ -634,7 +634,7 @@ test('esbuild bundling with pre compilations', () => { entry: __filename.replace('.js', '.ts'), projectRoot: path.dirname(packageLock), depsLockFilePath: packageLock, - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, preCompilation: true, forceDockerBundling: true, architecture: Architecture.X86_64, @@ -650,7 +650,7 @@ test('esbuild bundling with pre compilations', () => { 'bash', '-c', [ `tsc \"/asset-input/test/bundling.test.ts\" ${compilerOptions} &&`, - 'esbuild --bundle \"/asset-input/test/bundling.test.js\" --target=node14 --platform=node --outfile=\"/asset-output/index.js\" --external:aws-sdk', + 'esbuild --bundle \"/asset-input/test/bundling.test.js\" --target=node16 --platform=node --outfile=\"/asset-output/index.js\" --external:aws-sdk', ].join(' '), ], }), @@ -665,7 +665,7 @@ test('throws with pre compilation and not found tsconfig', () => { entry, projectRoot, depsLockFilePath, - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, forceDockerBundling: true, preCompilation: true, architecture: Architecture.X86_64, @@ -679,7 +679,7 @@ test('with custom hash', () => { entry, projectRoot, depsLockFilePath, - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, forceDockerBundling: true, assetHash: 'custom', architecture: Architecture.X86_64, @@ -697,7 +697,7 @@ test('Custom bundling entrypoint', () => { entry, projectRoot, depsLockFilePath, - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, architecture: Architecture.X86_64, forceDockerBundling: true, entrypoint: ['/cool/entrypoint', '--cool-entrypoint-arg'], @@ -716,7 +716,7 @@ test('Custom bundling volumes', () => { entry, projectRoot, depsLockFilePath, - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, architecture: Architecture.X86_64, forceDockerBundling: true, volumes: [{ hostPath: '/host-path', containerPath: '/container-path' }], @@ -735,7 +735,7 @@ test('Custom bundling volumesFrom', () => { entry, projectRoot, depsLockFilePath, - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, architecture: Architecture.X86_64, forceDockerBundling: true, volumesFrom: ['777f7dc92da7'], @@ -754,7 +754,7 @@ test('Custom bundling workingDirectory', () => { entry, projectRoot, depsLockFilePath, - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, architecture: Architecture.X86_64, forceDockerBundling: true, workingDirectory: '/working-directory', @@ -773,7 +773,7 @@ test('Custom bundling user', () => { entry, projectRoot, depsLockFilePath, - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, architecture: Architecture.X86_64, forceDockerBundling: true, user: 'user:group', @@ -792,7 +792,7 @@ test('Custom bundling securityOpt', () => { entry, projectRoot, depsLockFilePath, - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, architecture: Architecture.X86_64, forceDockerBundling: true, securityOpt: 'no-new-privileges', @@ -811,7 +811,7 @@ test('Custom bundling network', () => { entry, projectRoot, depsLockFilePath, - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, architecture: Architecture.X86_64, forceDockerBundling: true, network: 'host', @@ -830,7 +830,7 @@ test('Custom bundling file copy variant', () => { entry, projectRoot, depsLockFilePath, - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, architecture: Architecture.X86_64, forceDockerBundling: true, bundlingFileAccess: BundlingFileAccess.VOLUME_COPY, diff --git a/packages/aws-cdk-lib/aws-lambda/test/adot.test.ts b/packages/aws-cdk-lib/aws-lambda/test/adot.test.ts index 1cf54eaa83856..ee9e396826aca 100644 --- a/packages/aws-cdk-lib/aws-lambda/test/adot.test.ts +++ b/packages/aws-cdk-lib/aws-lambda/test/adot.test.ts @@ -95,7 +95,7 @@ describe('ADOT Lambda Layer', () => { const fn = new lambda.Function(stack, 'Function', { code: new lambda.InlineCode('FooBar'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, architecture: lambda.Architecture.ARM_64, }); diff --git a/packages/aws-cdk-lib/aws-lambda/test/alias.test.ts b/packages/aws-cdk-lib/aws-lambda/test/alias.test.ts index 739a756559ec3..d86dc25270c2f 100644 --- a/packages/aws-cdk-lib/aws-lambda/test/alias.test.ts +++ b/packages/aws-cdk-lib/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_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); const aliasName = 'prod'; const alias = new lambda.Alias(stack, 'Alias', { diff --git a/packages/aws-cdk-lib/aws-lambda/test/architecture.test.ts b/packages/aws-cdk-lib/aws-lambda/test/architecture.test.ts index 91e2823f09dae..7159db20965a6 100644 --- a/packages/aws-cdk-lib/aws-lambda/test/architecture.test.ts +++ b/packages/aws-cdk-lib/aws-lambda/test/architecture.test.ts @@ -11,7 +11,7 @@ describe('architecture', () => { const testLambda = new lambda.Function(stack, 'testLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }, ); diff --git a/packages/aws-cdk-lib/aws-lambda/test/code.test.ts b/packages/aws-cdk-lib/aws-lambda/test/code.test.ts index 2808ac4fcefea..9beccfd9d2152 100644 --- a/packages/aws-cdk-lib/aws-lambda/test/code.test.ts +++ b/packages/aws-cdk-lib/aws-lambda/test/code.test.ts @@ -37,13 +37,13 @@ describe('code', () => { // WHEN new lambda.Function(stack, 'Func1', { handler: 'foom', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: directoryAsset, }); new lambda.Function(stack, 'Func2', { handler: 'foom', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: directoryAsset, }); @@ -65,7 +65,7 @@ describe('code', () => { // WHEN new lambda.Function(stack, 'Func1', { code: lambda.Code.fromAsset(location), - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'foom', }); @@ -87,14 +87,14 @@ describe('code', () => { const stack1 = new cdk.Stack(app, 'Stack1'); new lambda.Function(stack1, 'Func', { code: asset, - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'foom', }); const stack2 = new cdk.Stack(app, 'Stack2'); expect(() => new lambda.Function(stack2, 'Func', { code: asset, - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'foom', })).toThrow(/already associated/); }); @@ -106,7 +106,7 @@ describe('code', () => { const code = new lambda.CfnParametersCode(); new lambda.Function(stack, 'Function', { code, - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', }); @@ -152,7 +152,7 @@ describe('code', () => { new lambda.Function(stack, 'Function', { code, - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', }); @@ -431,7 +431,7 @@ describe('code', () => { new lambda.Function(stack, 'Fn', { code: lambda.Code.fromDockerBuild(path.join(__dirname, 'docker-build-lambda')), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); // then @@ -457,7 +457,7 @@ describe('code', () => { imagePath: '/my/image/path', }), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); // then @@ -474,7 +474,7 @@ describe('code', () => { imagePath: '/my/image/path/', }), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); // then @@ -483,7 +483,7 @@ describe('code', () => { }); }); -function defineFunction(code: lambda.Code, runtime: lambda.Runtime = lambda.Runtime.NODEJS_14_X) { +function defineFunction(code: lambda.Code, runtime: lambda.Runtime = lambda.Runtime.NODEJS_16_X) { const stack = new cdk.Stack(); return new lambda.Function(stack, 'Func', { handler: 'foom', diff --git a/packages/aws-cdk-lib/aws-lambda/test/event-source-mapping.test.ts b/packages/aws-cdk-lib/aws-lambda/test/event-source-mapping.test.ts index 386967e1c3302..79df6799bb3bb 100644 --- a/packages/aws-cdk-lib/aws-lambda/test/event-source-mapping.test.ts +++ b/packages/aws-cdk-lib/aws-lambda/test/event-source-mapping.test.ts @@ -9,7 +9,7 @@ beforeEach(() => { fn = new Function(stack, 'fn', { handler: 'index.handler', code: Code.fromInline('exports.handler = ${handler.toString()}'), - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, }); }); diff --git a/packages/aws-cdk-lib/aws-lambda/test/function-hash.test.ts b/packages/aws-cdk-lib/aws-lambda/test/function-hash.test.ts index 74b496e533f22..2d1882eb74fbf 100644 --- a/packages/aws-cdk-lib/aws-lambda/test/function-hash.test.ts +++ b/packages/aws-cdk-lib/aws-lambda/test/function-hash.test.ts @@ -32,14 +32,14 @@ describe('function hash', () => { }); const stack1 = new Stack(app, 'Stack1'); const fn1 = new lambda.Function(stack1, 'MyFunction1', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromAsset(path.join(__dirname, 'handler.zip')), handler: 'index.handler', }); const stack2 = new Stack(app, 'Stack2'); const fn2 = new lambda.Function(stack2, 'MyFunction1', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromAsset(path.join(__dirname, 'handler.zip')), handler: 'index.handler', }); @@ -57,7 +57,7 @@ describe('function hash', () => { }); const stack1 = new Stack(app); const fn1 = new lambda.Function(stack1, 'MyFunction1', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromAsset(path.join(__dirname, 'my-lambda-handler')), handler: 'index.handler', }); @@ -74,7 +74,7 @@ describe('function hash', () => { }); const stack1 = new Stack(app, 'Stack1'); const fn1 = new lambda.Function(stack1, 'MyFunction', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromAsset(path.join(__dirname, 'my-lambda-handler')), handler: 'index.handler', environment: { @@ -84,7 +84,7 @@ describe('function hash', () => { const stack2 = new Stack(app); const fn2 = new lambda.Function(stack2, 'MyFunction', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromAsset(path.join(__dirname, 'my-lambda-handler')), handler: 'index.handler', environment: { @@ -104,7 +104,7 @@ describe('function hash', () => { }); const stack1 = new Stack(app, 'Stack1'); const fn1 = new lambda.Function(stack1, 'MyFunction', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_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(app); const fn2 = new lambda.Function(stack2, 'MyFunction', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromAsset(path.join(__dirname, 'my-lambda-handler')), handler: 'index.handler', environment: { @@ -129,14 +129,14 @@ describe('function hash', () => { test('inline code change impacts the hash', () => { const stack1 = new Stack(); const fn1 = new lambda.Function(stack1, 'MyFunction', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('foo'), handler: 'index.handler', }); const stack2 = new Stack(); const fn2 = new lambda.Function(stack2, 'MyFunction', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('foo bar'), handler: 'index.handler', }); @@ -153,13 +153,13 @@ describe('function hash', () => { stack1 = new Stack(); layer1 = new lambda.LayerVersion(stack1, 'MyLayer', { code: lambda.Code.fromAsset(path.join(__dirname, 'layer-code')), - compatibleRuntimes: [lambda.Runtime.NODEJS_14_X], + compatibleRuntimes: [lambda.Runtime.NODEJS_16_X], license: 'Apache-2.0', description: 'A layer to test the L2 construct', }); layer2 = new lambda.LayerVersion(stack1, 'MyLayer2', { code: lambda.Code.fromAsset(path.join(__dirname, 'layer-code')), - compatibleRuntimes: [lambda.Runtime.NODEJS_14_X], + compatibleRuntimes: [lambda.Runtime.NODEJS_16_X], license: 'Apache-2.0', description: 'A layer to test the L2 construct', }); @@ -168,7 +168,7 @@ describe('function hash', () => { test('same configuration yields the same hash', () => { const stack2 = new Stack(); const fn1 = new lambda.Function(stack2, 'MyFunction', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('foo'), handler: 'index.handler', layers: [layer1], @@ -176,7 +176,7 @@ describe('function hash', () => { const stack3 = new Stack(); const fn2 = new lambda.Function(stack3, 'MyFunction', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('foo'), handler: 'index.handler', layers: [layer1], @@ -189,7 +189,7 @@ describe('function hash', () => { test('different layers impacts hash', () => { const stack2 = new Stack(); const fn1 = new lambda.Function(stack2, 'MyFunction', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('foo'), handler: 'index.handler', layers: [layer1], @@ -197,7 +197,7 @@ describe('function hash', () => { const stack3 = new Stack(); const fn2 = new lambda.Function(stack3, 'MyFunction', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('foo'), handler: 'index.handler', layers: [layer2], @@ -211,7 +211,7 @@ describe('function hash', () => { test('without feature flag, preserve old behavior to avoid unnecessary invalidation of templates', () => { const stack2 = new Stack(); const fn1 = new lambda.Function(stack2, 'MyFunction', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('foo'), handler: 'index.handler', layers: [layer1, layer2], @@ -219,7 +219,7 @@ describe('function hash', () => { const stack3 = new Stack(); const fn2 = new lambda.Function(stack3, 'MyFunction', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('foo'), handler: 'index.handler', layers: [layer2, layer1], @@ -234,7 +234,7 @@ describe('function hash', () => { const stack2 = new Stack(app, 'stack2'); const fn1 = new lambda.Function(stack2, 'MyFunction', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('foo'), handler: 'index.handler', layers: [layer1, layer2], @@ -242,7 +242,7 @@ describe('function hash', () => { const stack3 = new Stack(app, 'stack3'); const fn2 = new lambda.Function(stack3, 'MyFunction', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('foo'), handler: 'index.handler', layers: [layer2, layer1], @@ -258,7 +258,7 @@ describe('function hash', () => { const stack2 = new Stack(app, 'stack2'); const importedLayer1 = lambda.LayerVersion.fromLayerVersionArn(stack2, 'imported-layer', 'arn:aws:lambda:::layer::'); const fn1 = new lambda.Function(stack2, 'MyFunction', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('foo'), handler: 'index.handler', layers: [importedLayer1], @@ -267,7 +267,7 @@ describe('function hash', () => { const stack3 = new Stack(app, 'stack3'); const importedLayer2 = lambda.LayerVersion.fromLayerVersionArn(stack3, 'imported-layer', 'arn:aws:lambda:::layer::'); const fn2 = new lambda.Function(stack3, 'MyFunction', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('foo'), handler: 'index.handler', layers: [importedLayer2], @@ -281,7 +281,7 @@ describe('function hash', () => { test('without "currentVersion", we preserve old behavior to avoid unnecessary invalidation of templates', () => { const stack1 = new Stack(); const fn1 = new lambda.Function(stack1, 'MyFunction', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromAsset(path.join(__dirname, 'my-lambda-handler')), handler: 'index.handler', environment: { @@ -292,7 +292,7 @@ describe('function hash', () => { const stack2 = new Stack(); const fn2 = new lambda.Function(stack2, 'MyFunction', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromAsset(path.join(__dirname, 'my-lambda-handler')), handler: 'index.handler', environment: { @@ -307,7 +307,7 @@ describe('function hash', () => { test('with "currentVersion", we sort env keys so order is consistent', () => { const stack1 = new Stack(); const fn1 = new lambda.Function(stack1, 'MyFunction', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromAsset(path.join(__dirname, 'my-lambda-handler')), handler: 'index.handler', environment: { @@ -320,7 +320,7 @@ describe('function hash', () => { const stack2 = new Stack(); const fn2 = new lambda.Function(stack2, 'MyFunction', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromAsset(path.join(__dirname, 'my-lambda-handler')), handler: 'index.handler', environment: { @@ -349,14 +349,14 @@ describe('function hash', () => { test('DependsOn does not impact function hash', () => { const stack1 = new Stack(app, 'Stack1'); const fn1 = new lambda.Function(stack1, 'MyFunction1', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromAsset(path.join(__dirname, 'handler.zip')), handler: 'index.handler', }); const stack2 = new Stack(app, 'Stack2'); const fn2 = new lambda.Function(stack2, 'MyFunction1', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromAsset(path.join(__dirname, 'handler.zip')), handler: 'index.handler', }); @@ -375,14 +375,14 @@ describe('function hash', () => { test('properties not locked to the version do not impact function hash', () => { const stack1 = new Stack(app, 'Stack1'); const fn1 = new lambda.Function(stack1, 'MyFunction', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromAsset(path.join(__dirname, 'handler.zip')), handler: 'index.handler', }); const stack2 = new Stack(app, 'Stack2'); const fn2 = new lambda.Function(stack2, 'MyFunction', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromAsset(path.join(__dirname, 'handler.zip')), handler: 'index.handler', @@ -396,7 +396,7 @@ describe('function hash', () => { test('unclassified property throws an error', () => { const stack = new Stack(app); const fn1 = new lambda.Function(stack, 'MyFunction1', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromAsset(path.join(__dirname, 'handler.zip')), handler: 'index.handler', }); @@ -408,7 +408,7 @@ describe('function hash', () => { test('manual classification as version locked', () => { const stack = new Stack(app); const fn1 = new lambda.Function(stack, 'MyFunction1', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromAsset(path.join(__dirname, 'handler.zip')), handler: 'index.handler', }); @@ -422,7 +422,7 @@ describe('function hash', () => { test('manual classification as not version locked', () => { const stack = new Stack(app); const fn1 = new lambda.Function(stack, 'MyFunction1', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromAsset(path.join(__dirname, 'handler.zip')), handler: 'index.handler', }); diff --git a/packages/aws-cdk-lib/aws-lambda/test/function-url.test.ts b/packages/aws-cdk-lib/aws-lambda/test/function-url.test.ts index 1ae2810ae7ba6..624a1769a94d2 100644 --- a/packages/aws-cdk-lib/aws-lambda/test/function-url.test.ts +++ b/packages/aws-cdk-lib/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_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); const aliasName = 'prod'; const alias = new lambda.Alias(stack, 'Alias', { @@ -124,7 +124,7 @@ describe('FunctionUrl', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); // WHEN @@ -169,7 +169,7 @@ describe('FunctionUrl', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); const fnUrl = new lambda.FunctionUrl(stack, 'FunctionUrl', { function: fn, diff --git a/packages/aws-cdk-lib/aws-lambda/test/function.test.ts b/packages/aws-cdk-lib/aws-lambda/test/function.test.ts index 83d25a6c13155..3bfaaf827a318 100644 --- a/packages/aws-cdk-lib/aws-lambda/test/function.test.ts +++ b/packages/aws-cdk-lib/aws-lambda/test/function.test.ts @@ -28,7 +28,7 @@ describe('function', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); Template.fromStack(stack).hasResourceProperties('AWS::IAM::Role', { @@ -52,7 +52,7 @@ describe('function', () => { Code: { ZipFile: 'foo' }, Handler: 'index.handler', Role: { 'Fn::GetAtt': ['MyLambdaServiceRole4539ECB6', 'Arn'] }, - Runtime: 'nodejs14.x', + Runtime: 'nodejs16.x', }, DependsOn: ['MyLambdaServiceRole4539ECB6'], }); @@ -63,7 +63,7 @@ describe('function', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, initialPolicy: [new iam.PolicyStatement({ actions: ['*'], resources: ['*'] })], }); Template.fromStack(stack).hasResourceProperties('AWS::IAM::Role', { @@ -105,7 +105,7 @@ describe('function', () => { Code: { ZipFile: 'foo' }, Handler: 'index.handler', Role: { 'Fn::GetAtt': ['MyLambdaServiceRole4539ECB6', 'Arn'] }, - Runtime: 'nodejs14.x', + Runtime: 'nodejs16.x', }, DependsOn: ['MyLambdaServiceRoleDefaultPolicy5BBC6F68', 'MyLambdaServiceRole4539ECB6'], }); @@ -741,7 +741,7 @@ describe('function', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, functionName: 'OneFunctionToRuleThemAll', deadLetterQueueEnabled: true, }); @@ -809,7 +809,7 @@ describe('function', () => { 'Arn', ], }, - Runtime: 'nodejs14.x', + Runtime: 'nodejs16.x', DeadLetterConfig: { TargetArn: { 'Fn::GetAtt': [ @@ -833,7 +833,7 @@ describe('function', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, deadLetterQueueEnabled: true, }); @@ -859,7 +859,7 @@ describe('function', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, deadLetterQueueEnabled: false, }); @@ -874,7 +874,7 @@ describe('function', () => { 'Arn', ], }, - Runtime: 'nodejs14.x', + Runtime: 'nodejs16.x', }); }); @@ -889,7 +889,7 @@ describe('function', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, deadLetterQueue: dlQueue, }); @@ -934,7 +934,7 @@ describe('function', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, deadLetterQueueEnabled: true, deadLetterQueue: dlQueue, }); @@ -980,7 +980,7 @@ describe('function', () => { expect(() => new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, deadLetterQueueEnabled: false, deadLetterQueue: dlQueue, })).toThrow(/deadLetterQueue defined but deadLetterQueueEnabled explicitly set to false/); @@ -994,7 +994,7 @@ describe('function', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, deadLetterTopic: dlTopic, }); @@ -1029,7 +1029,7 @@ describe('function', () => { expect(() => new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, deadLetterQueueEnabled: false, deadLetterTopic: dlTopic, })).toThrow(/deadLetterQueue and deadLetterTopic cannot be specified together at the same time/); @@ -1043,7 +1043,7 @@ describe('function', () => { expect(() => new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, deadLetterQueueEnabled: true, deadLetterTopic: dlTopic, })).toThrow(/deadLetterQueue and deadLetterTopic cannot be specified together at the same time/); @@ -1058,7 +1058,7 @@ describe('function', () => { expect(() => new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, deadLetterQueue: dlQueue, deadLetterTopic: dlTopic, })).toThrow(/deadLetterQueue and deadLetterTopic cannot be specified together at the same time/); @@ -1070,7 +1070,7 @@ describe('function', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, tracing: lambda.Tracing.ACTIVE, }); @@ -1108,7 +1108,7 @@ describe('function', () => { 'Arn', ], }, - Runtime: 'nodejs14.x', + Runtime: 'nodejs16.x', TracingConfig: { Mode: 'Active', }, @@ -1126,7 +1126,7 @@ describe('function', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, tracing: lambda.Tracing.PASS_THROUGH, }); @@ -1164,7 +1164,7 @@ describe('function', () => { 'Arn', ], }, - Runtime: 'nodejs14.x', + Runtime: 'nodejs16.x', TracingConfig: { Mode: 'PassThrough', }, @@ -1182,7 +1182,7 @@ describe('function', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, tracing: lambda.Tracing.DISABLED, }); @@ -1200,7 +1200,7 @@ describe('function', () => { 'Arn', ], }, - Runtime: 'nodejs14.x', + Runtime: 'nodejs16.x', }, DependsOn: [ 'MyLambdaServiceRole4539ECB6', @@ -1234,7 +1234,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.fromInline('xxx'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); // WHEN @@ -1264,7 +1264,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.fromInline('xxx'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); const service = new iam.ServicePrincipal('apigateway.amazonaws.com'); @@ -1290,7 +1290,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.fromInline('xxx'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); const account = new iam.AccountPrincipal('123456789012'); @@ -1316,7 +1316,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.fromInline('xxx'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); const account = new iam.ArnPrincipal('arn:aws:iam::123456789012:role/someRole'); @@ -1342,7 +1342,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.fromInline('xxx'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); const org = new iam.OrganizationPrincipal('my-org-id'); @@ -1369,7 +1369,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.fromInline('xxx'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); const service = new iam.ServicePrincipal('elasticloadbalancing.amazonaws.com'); @@ -1398,7 +1398,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.fromInline('xxx'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); // WHEN @@ -1430,7 +1430,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.fromInline('xxx'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); // WHEN @@ -1531,7 +1531,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.fromInline('xxx'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); // THEN @@ -1550,7 +1550,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.fromInline('xxx'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); let bindTarget; @@ -1575,7 +1575,7 @@ describe('function', () => { const code = new lambda.S3Code(bucket, 'ObjectKey'); const fn = new lambda.Function(stack, 'fn', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('exports.main = function() { console.log("DONE"); }'), handler: 'index.main', }); @@ -1585,7 +1585,7 @@ describe('function', () => { // WHEN const layer = new lambda.LayerVersion(stack, 'LayerVersion', { code, - compatibleRuntimes: [lambda.Runtime.NODEJS_14_X], + compatibleRuntimes: [lambda.Runtime.NODEJS_16_X], }); fn.addLayers(layer); @@ -1603,12 +1603,12 @@ describe('function', () => { const code = new lambda.S3Code(bucket, 'ObjectKey'); const layer = new lambda.LayerVersion(stack, 'LayerVersion', { code, - compatibleRuntimes: [lambda.Runtime.NODEJS_14_X], + compatibleRuntimes: [lambda.Runtime.NODEJS_16_X], }); // function with layer const fn = new lambda.Function(stack, 'fn', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('exports.main = function() { console.log("DONE"); }'), handler: 'index.main', layers: [layer], @@ -1636,7 +1636,7 @@ describe('function', () => { const stack = new cdk.Stack(undefined, 'TestStack'); const layer = lambda.LayerVersion.fromLayerVersionAttributes(stack, 'TestLayer', { layerVersionArn: 'arn:aws:...', - compatibleRuntimes: [lambda.Runtime.NODEJS_14_X], + compatibleRuntimes: [lambda.Runtime.NODEJS_16_X], }); // THEN @@ -1645,7 +1645,7 @@ describe('function', () => { runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('exports.main = function() { console.log("DONE"); }'), handler: 'index.main', - })).toThrow(/nodejs16.x is not in \[nodejs14.x\]/); + })).toThrow(/nodejs16.x is not in \[nodejs16.x\]/); }); test('using more than 5 layers', () => { @@ -1653,13 +1653,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_14_X], + compatibleRuntimes: [lambda.Runtime.NODEJS_16_X], })); // THEN expect(() => new lambda.Function(stack, 'Function', { layers, - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('exports.main = function() { console.log("DONE"); }'), handler: 'index.main', })).toThrow(/Unable to add layer:/); @@ -1743,7 +1743,7 @@ describe('function', () => { // WHEN new lambda.Function(stack, 'fn', { code: lambda.Code.fromInline('boom'), - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.bam', events: [ new EventSource(), @@ -1819,7 +1819,7 @@ describe('function', () => { new lambda.Function(stack, 'fn', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, onFailure: { bind: () => ({ destination: 'on-failure-arn' }), }, @@ -1855,7 +1855,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'fn', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, maxEventAge: cdk.Duration.hours(1), }); @@ -1889,7 +1889,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'fn', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); // WHEN @@ -1918,7 +1918,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'fn', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); fn.addEnvironment('KEY', 'value', { removeInEdge: true }); @@ -1937,7 +1937,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'fn', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, environment: { KEY: 'value', }, @@ -2020,7 +2020,7 @@ describe('function', () => { // WHEN/THEN expect(() => new lambda.Function(stack, 'fn', { handler: 'foo', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline(''), })).toThrow(/Lambda inline code cannot be empty/); }); @@ -2029,7 +2029,7 @@ describe('function', () => { const stack = new cdk.Stack(); const fn = new lambda.Function(stack, 'fn', { handler: 'foo', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('foo'), }); const logGroup = fn.logGroup; @@ -2047,7 +2047,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'fn', { handler: 'foo', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('foo'), deadLetterQueue: dlQueue, }); @@ -2069,7 +2069,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'fn', { handler: 'foo', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('foo'), deadLetterTopic: dlTopic, }); @@ -2086,7 +2086,7 @@ describe('function', () => { const stack = new cdk.Stack(); const fn = new lambda.Function(stack, 'fn', { handler: 'foo', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('foo'), deadLetterQueueEnabled: true, }); @@ -2103,7 +2103,7 @@ describe('function', () => { const stack = new cdk.Stack(); const fn = new lambda.Function(stack, 'fn', { handler: 'foo', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('foo'), }); const deadLetterQueue = fn.deadLetterQueue; @@ -2117,7 +2117,7 @@ describe('function', () => { const stack = new cdk.Stack(); const fn = new lambda.Function(stack, 'fn', { handler: 'foo', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('foo'), logRetention: logs.RetentionDays.FIVE_DAYS, }); @@ -2144,7 +2144,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); const version1 = fn.latestVersion; @@ -2172,7 +2172,7 @@ describe('function', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, environment: { SOME: 'Variable', }, @@ -2363,7 +2363,7 @@ describe('function', () => { expect(() => new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, profilingGroup: new ProfilingGroup(stack, 'ProfilingGroup'), environment: { AWS_CODEGURU_PROFILER_GROUP_ARN: 'profiler_group_arn', @@ -2381,7 +2381,7 @@ describe('function', () => { // WHEN const { timeout } = new lambda.Function(stack, 'MyFunction', { handler: 'foo', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromAsset(path.join(__dirname, 'handler.zip')), timeout: cdk.Duration.minutes(2), }); @@ -2397,7 +2397,7 @@ describe('function', () => { // WHEN const { timeout } = new lambda.Function(stack, 'MyFunction', { handler: 'foo', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromAsset(path.join(__dirname, 'handler.zip')), }); @@ -2413,7 +2413,7 @@ describe('function', () => { const stack1 = new cdk.Stack(); const fn1 = new lambda.Function(stack1, 'MyFunction', { handler: 'foo', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromAsset(path.join(__dirname, 'handler.zip')), environment: { FOO: 'bar', @@ -2422,7 +2422,7 @@ describe('function', () => { const stack2 = new cdk.Stack(); const fn2 = new lambda.Function(stack2, 'MyFunction', { handler: 'foo', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromAsset(path.join(__dirname, 'handler.zip')), environment: { FOO: 'bear', @@ -2466,7 +2466,7 @@ describe('function', () => { new lambda.Function(stack, 'MyFunction', { vpc, handler: 'foo', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromAsset(path.join(__dirname, 'handler.zip')), filesystem: lambda.FileSystem.fromEfsAccessPoint(accessPoint, '/mnt/msg'), }); @@ -2521,7 +2521,7 @@ describe('function', () => { expect(() => { new lambda.Function(stack, 'MyFunction', { handler: 'foo', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromAsset(path.join(__dirname, 'handler.zip')), filesystem: lambda.FileSystem.fromEfsAccessPoint(accessPoint, '/mnt/msg'), }); @@ -2549,7 +2549,7 @@ describe('function', () => { vpc, handler: 'foo', securityGroups: [securityGroup], - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromAsset(path.join(__dirname, 'handler.zip')), filesystem: lambda.FileSystem.fromEfsAccessPoint(accessPoint, '/mnt/msg'), }); @@ -2713,7 +2713,7 @@ describe('function', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, codeSigningConfig, }); @@ -2747,7 +2747,7 @@ describe('function', () => { const stack = new cdk.Stack(); new lambda.Function(stack, 'MyFunction', { code: lambda.Code.fromInline('foo'), - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', architectures: [lambda.Architecture.ARM_64], @@ -2762,7 +2762,7 @@ describe('function', () => { const stack = new cdk.Stack(); new lambda.Function(stack, 'MyFunction', { code: lambda.Code.fromInline('foo'), - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', architecture: lambda.Architecture.ARM_64, @@ -2777,7 +2777,7 @@ describe('function', () => { const stack = new cdk.Stack(); expect(() => new lambda.Function(stack, 'MyFunction', { code: lambda.Code.fromInline('foo'), - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', architecture: lambda.Architecture.ARM_64, @@ -2789,7 +2789,7 @@ describe('function', () => { const stack = new cdk.Stack(); expect(() => new lambda.Function(stack, 'MyFunction', { code: lambda.Code.fromInline('foo'), - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', architectures: [lambda.Architecture.X86_64, lambda.Architecture.ARM_64], @@ -2800,7 +2800,7 @@ describe('function', () => { const stack = new cdk.Stack(); const fn = new lambda.Function(stack, 'MyFunction', { code: lambda.Code.fromInline('foo'), - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', architecture: lambda.Architecture.ARM_64, }); @@ -2811,7 +2811,7 @@ describe('function', () => { const stack = new cdk.Stack(); expect(() => new lambda.Function(stack, 'MyFunction', { code: lambda.Code.fromInline('foo'), - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', functionName: 'a'.repeat(65), })).toThrow(/Function name can not be longer than 64 characters/); @@ -2824,7 +2824,7 @@ describe('function', () => { new lambda.Function(stack, `foo${invalidChar}`, { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, functionName: `foo${invalidChar}`, }); }).toThrow(/can contain only letters, numbers, hyphens, or underscores with no spaces./); @@ -2840,7 +2840,7 @@ describe('function', () => { new lambda.Function(stack, 'foo', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, functionName: tokenizedFunctionName, }); }).not.toThrow(); @@ -2850,7 +2850,7 @@ describe('function', () => { const stack = new cdk.Stack(); expect(() => new lambda.Function(stack, 'MyFunction', { code: lambda.Code.fromInline('foo'), - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', description: 'a'.repeat(257), })).toThrow(/Function description can not be longer than 256 characters/); @@ -2865,7 +2865,7 @@ describe('function', () => { new lambda.Function(stack, 'foo', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, description: tokenizedFunctionDescription, }); }).not.toThrow(); @@ -2878,7 +2878,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); // WHEN @@ -2902,7 +2902,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); // WHEN @@ -2951,7 +2951,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); fn.addFunctionUrl(); @@ -2985,7 +2985,7 @@ describe('function', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.fromInline('xxx'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); const sourceArnA = 'some-arn-a'; const sourceArnB = 'some-arn-b'; @@ -3059,7 +3059,7 @@ describe('function', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, adotInstrumentation: { layerVersion: lambda.AdotLayerVersion.fromJavaSdkLayerVersion(AdotLambdaLayerJavaSdkVersion.V1_19_0), execWrapper: lambda.AdotLambdaExecWrapper.REGULAR_HANDLER, @@ -3146,7 +3146,7 @@ test('throws if ephemeral storage size is out of bound', () => { expect(() => new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'bar', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, ephemeralStorageSize: Size.mebibytes(511), })).toThrow(/Ephemeral storage size must be between 512 and 10240 MB/); }); @@ -3156,7 +3156,7 @@ test('set ephemeral storage to desired size', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'bar', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, ephemeralStorageSize: Size.mebibytes(1024), }); @@ -3165,7 +3165,7 @@ test('set ephemeral storage to desired size', () => { { Code: { ZipFile: 'foo' }, Handler: 'bar', - Runtime: 'nodejs14.x', + Runtime: 'nodejs16.x', EphemeralStorage: { Size: 1024, }, @@ -3179,7 +3179,7 @@ test('ephemeral storage allows unresolved tokens', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'bar', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, ephemeralStorageSize: Size.mebibytes(Lazy.number({ produce: () => 1024 })), }); }).not.toThrow(); @@ -3191,7 +3191,7 @@ test('FunctionVersionUpgrade adds new description to function', () => { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'bar', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, description: 'my description', }); @@ -3202,7 +3202,7 @@ test('FunctionVersionUpgrade adds new description to function', () => { { Code: { ZipFile: 'foo' }, Handler: 'bar', - Runtime: 'nodejs14.x', + Runtime: 'nodejs16.x', Description: 'my description version-hash:54f18c47346ed84843c2dac547de81fa', }, }); diff --git a/packages/aws-cdk-lib/aws-lambda/test/integ.autoscaling.lit.ts b/packages/aws-cdk-lib/aws-lambda/test/integ.autoscaling.lit.ts index 5c760da9b0bc6..a80cad59be167 100644 --- a/packages/aws-cdk-lib/aws-lambda/test/integ.autoscaling.lit.ts +++ b/packages/aws-cdk-lib/aws-lambda/test/integ.autoscaling.lit.ts @@ -15,7 +15,7 @@ class TestStack extends cdk.Stack { const fn = new lambda.Function(this, 'MyLambda', { code: new lambda.InlineCode('exports.handler = async () => { console.log(\'hello world\'); };'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); const version = fn.currentVersion; diff --git a/packages/aws-cdk-lib/aws-lambda/test/integ.layer-version.lit.ts b/packages/aws-cdk-lib/aws-lambda/test/integ.layer-version.lit.ts index c6a5dab44ab41..70cc8c75d3801 100644 --- a/packages/aws-cdk-lib/aws-lambda/test/integ.layer-version.lit.ts +++ b/packages/aws-cdk-lib/aws-lambda/test/integ.layer-version.lit.ts @@ -12,7 +12,7 @@ const awsAccountId = stack.account; /// !show const layer = new lambda.LayerVersion(stack, 'MyLayer', { code: lambda.Code.fromAsset(path.join(__dirname, 'layer-code')), - compatibleRuntimes: [lambda.Runtime.NODEJS_14_X], + compatibleRuntimes: [lambda.Runtime.NODEJS_16_X], license: 'Apache-2.0', description: 'A layer to test the L2 construct', }); @@ -26,7 +26,7 @@ layer.addPermission('remote-account-grant', { accountId: awsAccountId }); new lambda.Function(stack, 'MyLayeredLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, layers: [layer], }); /// !hide diff --git a/packages/aws-cdk-lib/aws-lambda/test/lambda-insights.test.ts b/packages/aws-cdk-lib/aws-lambda/test/lambda-insights.test.ts index c7fff4e0f100a..f35658b4079ba 100644 --- a/packages/aws-cdk-lib/aws-lambda/test/lambda-insights.test.ts +++ b/packages/aws-cdk-lib/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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, architecture, insightsVersion, }); diff --git a/packages/aws-cdk-lib/aws-lambda/test/lambda-version.test.ts b/packages/aws-cdk-lib/aws-lambda/test/lambda-version.test.ts index 3bb09f32477bb..d8b7db9da664e 100644 --- a/packages/aws-cdk-lib/aws-lambda/test/lambda-version.test.ts +++ b/packages/aws-cdk-lib/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_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromInline('foo'), }); @@ -160,7 +160,7 @@ describe('lambda version', () => { const app = new cdk.App(); const stack = new cdk.Stack(app, 'Stack'); const fn = new lambda.Function(stack, 'Fn', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromInline('foo'), }); @@ -168,7 +168,7 @@ describe('lambda version', () => { // WHEN new lambda.Function(stack, 'OtherFn', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromInline('foo'), environment: { @@ -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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); const version = new lambda.Version(stack, 'Version', { lambda: fn, diff --git a/packages/aws-cdk-lib/aws-lambda/test/layers.test.ts b/packages/aws-cdk-lib/aws-lambda/test/layers.test.ts index 4f04e61d0f23f..7d4d8fd8e9f3e 100644 --- a/packages/aws-cdk-lib/aws-lambda/test/layers.test.ts +++ b/packages/aws-cdk-lib/aws-lambda/test/layers.test.ts @@ -15,7 +15,7 @@ describe('layers', () => { // WHEN new lambda.LayerVersion(stack, 'LayerVersion', { code, - compatibleRuntimes: [lambda.Runtime.NODEJS_14_X], + compatibleRuntimes: [lambda.Runtime.NODEJS_16_X], }); // THEN @@ -24,7 +24,7 @@ describe('layers', () => { S3Bucket: stack.resolve(bucket.bucketName), S3Key: 'ObjectKey', }, - CompatibleRuntimes: ['nodejs14.x'], + CompatibleRuntimes: ['nodejs16.x'], }); }); @@ -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_14_X], + compatibleRuntimes: [lambda.Runtime.NODEJS_16_X], }); // WHEN diff --git a/packages/aws-cdk-lib/aws-lambda/test/singleton-lambda.test.ts b/packages/aws-cdk-lib/aws-lambda/test/singleton-lambda.test.ts index b9d119fbd2a96..93d197053555f 100644 --- a/packages/aws-cdk-lib/aws-lambda/test/singleton-lambda.test.ts +++ b/packages/aws-cdk-lib/aws-lambda/test/singleton-lambda.test.ts @@ -248,7 +248,7 @@ describe('singleton lambda', () => { const singleton = new lambda.SingletonFunction(stack, 'Singleton', { uuid: '84c0de93-353f-4217-9b0b-45b6c993251a', code: new lambda.InlineCode('foo'), - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', }); @@ -276,7 +276,7 @@ describe('singleton lambda', () => { const singleton = new lambda.SingletonFunction(stack, 'Singleton', { uuid: '84c0de93-353f-4217-9b0b-45b6c993251a', code: new lambda.InlineCode('foo'), - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', securityGroups: [securityGroup], vpc: vpc, diff --git a/packages/aws-cdk-lib/aws-lambda/test/vpc-lambda.test.ts b/packages/aws-cdk-lib/aws-lambda/test/vpc-lambda.test.ts index a38d852ac023b..cc12cf96b3c8e 100644 --- a/packages/aws-cdk-lib/aws-lambda/test/vpc-lambda.test.ts +++ b/packages/aws-cdk-lib/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_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); // WHEN @@ -208,7 +208,7 @@ describe('lambda + vpc', () => { allowPublicSubnet: true, code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, vpc, vpcSubnets: { subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS }, }); @@ -272,7 +272,7 @@ describe('lambda + vpc', () => { new lambda.Function(stack, 'IsolatedLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, vpc, vpcSubnets: { subnetType: ec2.SubnetType.PUBLIC }, }); @@ -333,7 +333,7 @@ describe('lambda + vpc', () => { new lambda.Function(stack, 'Function', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, vpcSubnets: { subnetType: ec2.SubnetType.PRIVATE }, }); }).toThrow('Cannot configure \'vpcSubnets\' without configuring a VPC'); diff --git a/packages/aws-cdk-lib/aws-logs-destinations/test/lambda.test.ts b/packages/aws-cdk-lib/aws-logs-destinations/test/lambda.test.ts index 1680e29aeba92..da7e1baa38f56 100644 --- a/packages/aws-cdk-lib/aws-logs-destinations/test/lambda.test.ts +++ b/packages/aws-cdk-lib/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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); logGroup = new logs.LogGroup(stack, 'LogGroup'); }); diff --git a/packages/aws-cdk-lib/aws-rds/test/instance.test.ts b/packages/aws-cdk-lib/aws-rds/test/instance.test.ts index dc0c2ef29b583..b0f8bcf5308f8 100644 --- a/packages/aws-cdk-lib/aws-rds/test/instance.test.ts +++ b/packages/aws-cdk-lib/aws-rds/test/instance.test.ts @@ -531,7 +531,7 @@ describe('instance', () => { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.fromInline('dummy'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); // WHEN diff --git a/packages/aws-cdk-lib/aws-rds/test/integ.instance.lit.ts b/packages/aws-cdk-lib/aws-rds/test/integ.instance.lit.ts index 32e3b8682ca49..c152328eab8b9 100644 --- a/packages/aws-cdk-lib/aws-rds/test/integ.instance.lit.ts +++ b/packages/aws-cdk-lib/aws-rds/test/integ.instance.lit.ts @@ -86,7 +86,7 @@ class DatabaseInstanceStack extends cdk.Stack { const fn = new lambda.Function(this, 'Function', { code: lambda.Code.fromInline('exports.handler = (event) => console.log(event);'), handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); const availabilityRule = instance.onEvent('Availability', { target: new targets.LambdaFunction(fn) }); diff --git a/packages/aws-cdk-lib/aws-s3-deployment/test/content.test.ts b/packages/aws-cdk-lib/aws-s3-deployment/test/content.test.ts index cfa7a01c5f464..138624d5b57f0 100644 --- a/packages/aws-cdk-lib/aws-s3-deployment/test/content.test.ts +++ b/packages/aws-cdk-lib/aws-s3-deployment/test/content.test.ts @@ -84,7 +84,7 @@ test('json-encoded string', () => { test('markers are returned in the source config', () => { const stack = new Stack(); - const handler = new lambda.Function(stack, 'Handler', { runtime: lambda.Runtime.NODEJS_14_X, code: lambda.Code.fromInline('foo'), handler: 'index.handler' }); + const handler = new lambda.Function(stack, 'Handler', { runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('foo'), handler: 'index.handler' }); const actual = Source.data('file1.txt', `boom-${stack.account}`).bind(stack, { handlerRole: handler.role! }); expect(actual.markers).toStrictEqual({ '<>': { Ref: 'AWS::AccountId' }, diff --git a/packages/aws-cdk-lib/aws-s3-notifications/test/lambda/lambda.test.ts b/packages/aws-cdk-lib/aws-s3-notifications/test/lambda/lambda.test.ts index c05820c48e5aa..2cd403a6b619a 100644 --- a/packages/aws-cdk-lib/aws-s3-notifications/test/lambda/lambda.test.ts +++ b/packages/aws-cdk-lib/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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromInline('foo'), }); const fn2 = new lambda.Function(stack, 'MyFunction2', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromInline('foo'), }); diff --git a/packages/aws-cdk-lib/aws-secretsmanager/test/rotation-schedule.test.ts b/packages/aws-cdk-lib/aws-secretsmanager/test/rotation-schedule.test.ts index 2452c751c7830..c8adc23f2ab98 100644 --- a/packages/aws-cdk-lib/aws-secretsmanager/test/rotation-schedule.test.ts +++ b/packages/aws-cdk-lib/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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('export.handler = event => event;'), handler: 'index.handler', }); @@ -47,7 +47,7 @@ test('create a rotation schedule without immediate rotation', () => { // GIVEN const secret = new secretsmanager.Secret(stack, 'Secret'); const rotationLambda = new lambda.Function(stack, 'Lambda', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('export.handler = event => event;'), handler: 'index.handler', }); @@ -75,7 +75,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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('export.handler = event => event;'), handler: 'index.handler', }); @@ -134,7 +134,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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('export.handler = event => event;'), handler: 'index.handler', }); @@ -186,7 +186,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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('export.handler = event => event;'), handler: 'index.handler', }); @@ -598,7 +598,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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('export.handler = event => event;'), handler: 'index.handler', }); diff --git a/packages/aws-cdk-lib/aws-secretsmanager/test/secret.test.ts b/packages/aws-cdk-lib/aws-secretsmanager/test/secret.test.ts index 628649d7ee4be..960aa86faeeb0 100644 --- a/packages/aws-cdk-lib/aws-secretsmanager/test/secret.test.ts +++ b/packages/aws-cdk-lib/aws-secretsmanager/test/secret.test.ts @@ -1177,7 +1177,7 @@ test('add a rotation schedule to an attached secret', () => { }), }); const rotationLambda = new lambda.Function(stack, 'Lambda', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('export.handler = event => event;'), handler: 'index.handler', }); diff --git a/packages/aws-cdk-lib/aws-ses-actions/test/actions.test.ts b/packages/aws-cdk-lib/aws-ses-actions/test/actions.test.ts index 696dece51137d..0cfbb90a3c935 100644 --- a/packages/aws-cdk-lib/aws-ses-actions/test/actions.test.ts +++ b/packages/aws-cdk-lib/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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); rule.addAction(new actions.Lambda({ diff --git a/packages/aws-cdk-lib/aws-ses/lib/receipt-rule.ts b/packages/aws-cdk-lib/aws-ses/lib/receipt-rule.ts index b8e973e5d21d3..ae45be5339f48 100644 --- a/packages/aws-cdk-lib/aws-ses/lib/receipt-rule.ts +++ b/packages/aws-cdk-lib/aws-ses/lib/receipt-rule.ts @@ -172,7 +172,7 @@ export class DropSpamReceiptRule extends Construct { super(scope, id); const fn = new lambda.SingletonFunction(this, 'Function', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromAsset(path.join(__dirname, 'drop-spam-handler')), uuid: '224e77f9-a32e-4b4d-ac32-983477abba16', diff --git a/packages/aws-cdk-lib/aws-sns-subscriptions/test/subs.test.ts b/packages/aws-cdk-lib/aws-sns-subscriptions/test/subs.test.ts index c72bd8f601093..6600bfb3f3a5e 100644 --- a/packages/aws-cdk-lib/aws-sns-subscriptions/test/subs.test.ts +++ b/packages/aws-cdk-lib/aws-sns-subscriptions/test/subs.test.ts @@ -1235,7 +1235,7 @@ test('importing SQS queue and specify this as subscription', () => { test('lambda subscription', () => { const func = new lambda.Function(stack, 'MyFunc', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromInline('exports.handler = function(e, c, cb) { return cb() }'), }); @@ -1295,7 +1295,7 @@ test('lambda subscription', () => { 'Arn', ], }, - 'Runtime': 'nodejs14.x', + 'Runtime': 'nodejs16.x', }, 'DependsOn': [ 'MyFuncServiceRole54065130', @@ -1346,7 +1346,7 @@ test('lambda subscription, cross region env agnostic', () => { displayName: 'displayName', }); const func = new lambda.Function(lambdaStack, 'MyFunc', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromInline('exports.handler = function(e, c, cb) { return cb() }'), }); @@ -1399,7 +1399,7 @@ test('lambda subscription, cross region env agnostic', () => { ], }, 'Handler': 'index.handler', - 'Runtime': 'nodejs14.x', + 'Runtime': 'nodejs16.x', }, 'DependsOn': [ 'MyFuncServiceRole54065130', @@ -1460,7 +1460,7 @@ test('lambda subscription, cross region', () => { displayName: 'displayName', }); const func = new lambda.Function(lambdaStack, 'MyFunc', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromInline('exports.handler = function(e, c, cb) { return cb() }'), }); @@ -1513,7 +1513,7 @@ test('lambda subscription, cross region', () => { ], }, 'Handler': 'index.handler', - 'Runtime': 'nodejs14.x', + 'Runtime': 'nodejs16.x', }, 'DependsOn': [ 'MyFuncServiceRole54065130', @@ -1746,7 +1746,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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromInline('exports.handler = function(e, c, cb) { return cb() }'), }); @@ -1862,7 +1862,7 @@ test('multiple subscriptions', () => { 'Arn', ], }, - 'Runtime': 'nodejs14.x', + 'Runtime': 'nodejs16.x', }, 'DependsOn': [ 'MyFuncServiceRole54065130', @@ -1914,7 +1914,7 @@ test('throws with mutliple subscriptions of the same subscriber', () => { test('with filter policy', () => { const func = new lambda.Function(stack, 'MyFunc', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromInline('exports.handler = function(e, c, cb) { return cb() }'), }); @@ -1969,7 +1969,7 @@ test('with filter policy', () => { test('with filter policy scope MessageBody', () => { const func = new lambda.Function(stack, 'MyFunc', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromInline('exports.handler = function(e, c, cb) { return cb() }'), }); @@ -2040,7 +2040,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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromInline('exports.handler = function(e, c, cb) { return cb() }'), }); @@ -2055,7 +2055,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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.handler', code: lambda.Code.fromInline('exports.handler = function(e, c, cb) { return cb() }'), }); diff --git a/packages/aws-cdk-lib/aws-stepfunctions-tasks/lib/evaluate-expression.ts b/packages/aws-cdk-lib/aws-stepfunctions-tasks/lib/evaluate-expression.ts index 16ccfa7585ecc..c901dd3971984 100644 --- a/packages/aws-cdk-lib/aws-stepfunctions-tasks/lib/evaluate-expression.ts +++ b/packages/aws-cdk-lib/aws-stepfunctions-tasks/lib/evaluate-expression.ts @@ -95,6 +95,7 @@ export class EvaluateExpression extends sfn.TaskStateBase { } function createEvalFn(runtime: lambda.Runtime | undefined, scope: Construct) { + const NO_RUNTIME = Symbol.for('no-runtime'); const lambdaPurpose = 'Eval'; const nodeJsGuids = { @@ -103,37 +104,23 @@ function createEvalFn(runtime: lambda.Runtime | undefined, scope: Construct) { [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', - }; - // UUID used when using the default node runtime, which is a token and different - // pre region. - let uuid; - if (runtime) { - switch (runtime?.name) { - case lambda.Runtime.NODEJS_18_X.name: - case lambda.Runtime.NODEJS_16_X.name: - case lambda.Runtime.NODEJS_14_X.name: - case lambda.Runtime.NODEJS_12_X.name: - case lambda.Runtime.NODEJS_10_X.name: - uuid = nodeJsGuids[runtime.name]; - break; - } - } else { - uuid = '41256dc5-4457-4273-8ed9-17bc818694e5'; - } + // UUID used when falling back to the default node runtime, which is a token and might be different per region + [NO_RUNTIME]: '41256dc5-4457-4273-8ed9-17bc818694e5', + }; - if (uuid) { - return new lambda.SingletonFunction(scope, 'EvalFunction', { - runtime: runtime ?? lambda.Runtime.NODEJS_18_X, - uuid, - handler: 'index.handler', - lambdaPurpose, - code: lambda.Code.fromAsset(path.join(__dirname, 'eval-nodejs-handler'), { - exclude: ['*.ts'], - }), - }); + const uuid = nodeJsGuids[runtime?.name ?? NO_RUNTIME]; + if (!uuid) { + throw new Error(`The runtime ${runtime?.name} is currently not supported.`); } - // Runtime always defined here - throw new Error(`The runtime ${runtime?.name} is currently not supported.`); + return new lambda.SingletonFunction(scope, 'EvalFunction', { + runtime: runtime ?? lambda.Runtime.NODEJS_18_X, + uuid, + handler: 'index.handler', + lambdaPurpose, + code: lambda.Code.fromAsset(path.join(__dirname, 'eval-nodejs-handler'), { + exclude: ['*.ts'], + }), + }); } diff --git a/packages/aws-cdk-lib/aws-stepfunctions-tasks/test/lambda/invoke.test.ts b/packages/aws-cdk-lib/aws-stepfunctions-tasks/test/lambda/invoke.test.ts index cd15ed6e3bffc..0b40caa859c05 100644 --- a/packages/aws-cdk-lib/aws-stepfunctions-tasks/test/lambda/invoke.test.ts +++ b/packages/aws-cdk-lib/aws-stepfunctions-tasks/test/lambda/invoke.test.ts @@ -17,7 +17,7 @@ describe('LambdaInvoke', () => { lambdaFunction = new lambda.Function(stack, 'Fn', { code: lambda.Code.fromInline('foo'), handler: 'handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); }); diff --git a/packages/aws-cdk-lib/core/lib/custom-resource-provider/custom-resource-provider.ts b/packages/aws-cdk-lib/core/lib/custom-resource-provider/custom-resource-provider.ts index 5901724caae22..f472a44cf7751 100644 --- a/packages/aws-cdk-lib/core/lib/custom-resource-provider/custom-resource-provider.ts +++ b/packages/aws-cdk-lib/core/lib/custom-resource-provider/custom-resource-provider.ts @@ -65,7 +65,7 @@ export interface CustomResourceProviderProps { * @example * const provider = CustomResourceProvider.getOrCreateProvider(this, 'Custom::MyCustomResourceType', { * codeDirectory: `${__dirname}/my-handler`, - * runtime: CustomResourceProviderRuntime.NODEJS_14_X, + * runtime: CustomResourceProviderRuntime.NODEJS_16_X, * policyStatements: [ * { * Effect: 'Allow', @@ -120,7 +120,7 @@ export enum CustomResourceProviderRuntime { /** * Node.js 12.x * - * @deprecated Use `NODEJS_14_X` + * @deprecated Use `NODEJS_12_X` */ NODEJS_12 = 'deprecated_nodejs12.x', diff --git a/packages/aws-cdk-lib/core/test/custom-resource-provider/custom-resource-provider.test.ts b/packages/aws-cdk-lib/core/test/custom-resource-provider/custom-resource-provider.test.ts index 81a6ad56b8594..da9ec6f7369d7 100644 --- a/packages/aws-cdk-lib/core/test/custom-resource-provider/custom-resource-provider.test.ts +++ b/packages/aws-cdk-lib/core/test/custom-resource-provider/custom-resource-provider.test.ts @@ -26,7 +26,7 @@ describe('custom resource provider', () => { // WHEN const cr = CustomResourceProvider.getOrCreateProvider(stack, 'Custom:MyResourceType', { codeDirectory: TEST_HANDLER, - runtime: CustomResourceProviderRuntime.NODEJS_14_X, + runtime: CustomResourceProviderRuntime.NODEJS_16_X, }); cr.addToRolePolicy({ Action: 's3:GetBucket', @@ -103,7 +103,7 @@ describe('custom resource provider', () => { // WHEN const cr = CustomResourceProvider.getOrCreateProvider(stack, 'Custom:MyResourceType', { codeDirectory: TEST_HANDLER, - runtime: CustomResourceProviderRuntime.NODEJS_14_X, + runtime: CustomResourceProviderRuntime.NODEJS_16_X, }); cr.addToRolePolicy({ Action: 's3:GetBucket', @@ -164,7 +164,7 @@ describe('custom resource provider', () => { // WHEN CustomResourceProvider.getOrCreate(stack, 'Custom:MyResourceType', { codeDirectory: TEST_HANDLER, - runtime: CustomResourceProviderRuntime.NODEJS_14_X, + runtime: CustomResourceProviderRuntime.NODEJS_16_X, }); // THEN @@ -250,7 +250,7 @@ describe('custom resource provider', () => { 'Arn', ], }, - Runtime: 'nodejs14.x', + Runtime: 'nodejs16.x', }, DependsOn: [ 'CustomMyResourceTypeCustomResourceProviderRoleBD5E655F', @@ -284,7 +284,7 @@ describe('custom resource provider', () => { // WHEN CustomResourceProvider.getOrCreate(stack, 'Custom:MyResourceType', { codeDirectory: TEST_HANDLER, - runtime: CustomResourceProviderRuntime.NODEJS_14_X, + runtime: CustomResourceProviderRuntime.NODEJS_16_X, }); // Then @@ -326,7 +326,7 @@ describe('custom resource provider', () => { // WHEN CustomResourceProvider.getOrCreate(stack, 'Custom:MyResourceType', { codeDirectory: TEST_HANDLER, - runtime: CustomResourceProviderRuntime.NODEJS_14_X, + runtime: CustomResourceProviderRuntime.NODEJS_16_X, }); // THEN -- no exception @@ -343,7 +343,7 @@ describe('custom resource provider', () => { // WHEN CustomResourceProvider.getOrCreate(stack, 'Custom:MyResourceType', { codeDirectory: TEST_HANDLER, - runtime: CustomResourceProviderRuntime.NODEJS_14_X, + runtime: CustomResourceProviderRuntime.NODEJS_16_X, policyStatements: [ { statement1: 123 }, { statement2: { foo: 111 } }, @@ -370,7 +370,7 @@ describe('custom resource provider', () => { // WHEN const provider = CustomResourceProvider.getOrCreateProvider(stack, 'Custom:MyResourceType', { codeDirectory: TEST_HANDLER, - runtime: CustomResourceProviderRuntime.NODEJS_14_X, + runtime: CustomResourceProviderRuntime.NODEJS_16_X, policyStatements: [ { statement1: 123 }, { statement2: { foo: 111 } }, @@ -397,7 +397,7 @@ describe('custom resource provider', () => { // WHEN CustomResourceProvider.getOrCreate(stack, 'Custom:MyResourceType', { codeDirectory: TEST_HANDLER, - runtime: CustomResourceProviderRuntime.NODEJS_14_X, + runtime: CustomResourceProviderRuntime.NODEJS_16_X, memorySize: Size.gibibytes(2), timeout: Duration.minutes(5), description: 'veni vidi vici', @@ -419,7 +419,7 @@ describe('custom resource provider', () => { // WHEN CustomResourceProvider.getOrCreate(stack, 'Custom:MyResourceType', { codeDirectory: TEST_HANDLER, - runtime: CustomResourceProviderRuntime.NODEJS_14_X, + runtime: CustomResourceProviderRuntime.NODEJS_16_X, environment: { B: 'b', A: 'a', @@ -445,7 +445,7 @@ describe('custom resource provider', () => { // WHEN const cr = CustomResourceProvider.getOrCreateProvider(stack, 'Custom:MyResourceType', { codeDirectory: TEST_HANDLER, - runtime: CustomResourceProviderRuntime.NODEJS_14_X, + runtime: CustomResourceProviderRuntime.NODEJS_16_X, }); // THEN @@ -466,12 +466,12 @@ describe('custom resource provider', () => { expect(rt).toEqual(CustomResourceProviderRuntime.NODEJS_16_X); }); - test('returns node14 for iso region', () => { + test('returns node16 for iso region', () => { const app = new App(); const stack = new Stack(app, 'MyStack', { env: { region: 'us-iso-east-1' } }); const rt = builtInCustomResourceProviderNodeRuntime(stack); - expect(rt).toEqual(CustomResourceProviderRuntime.NODEJS_14_X); + expect(rt).toEqual(CustomResourceProviderRuntime.NODEJS_16_X); }); }); }); diff --git a/packages/aws-cdk-lib/custom-resources/test/aws-custom-resource/aws-custom-resource.test.ts b/packages/aws-cdk-lib/custom-resources/test/aws-custom-resource/aws-custom-resource.test.ts index 50e015deddec5..9a7e84ac3613a 100644 --- a/packages/aws-cdk-lib/custom-resources/test/aws-custom-resource/aws-custom-resource.test.ts +++ b/packages/aws-cdk-lib/custom-resources/test/aws-custom-resource/aws-custom-resource.test.ts @@ -1290,12 +1290,12 @@ describe('builtInCustomResourceNodeRuntime', () => { expect(rt).toEqual(lambda.Runtime.NODEJS_16_X); }); - test('returns node14 for iso region', () => { + test('returns node16 for iso region', () => { const app = new App(); const stack = new Stack(app, 'MyStack', { env: { region: 'us-iso-east-1' } }); const rt = builtInCustomResourceNodeRuntime(stack); - expect(rt).toEqual(lambda.Runtime.NODEJS_14_X); + expect(rt).toEqual(lambda.Runtime.NODEJS_16_X); }); }); diff --git a/packages/aws-cdk-lib/custom-resources/test/provider-framework/integration-test-fixtures/s3-file.ts b/packages/aws-cdk-lib/custom-resources/test/provider-framework/integration-test-fixtures/s3-file.ts index 62c6a3d85ae74..7d2c5bae11978 100644 --- a/packages/aws-cdk-lib/custom-resources/test/provider-framework/integration-test-fixtures/s3-file.ts +++ b/packages/aws-cdk-lib/custom-resources/test/provider-framework/integration-test-fixtures/s3-file.ts @@ -78,7 +78,7 @@ class S3FileProvider extends Construct { this.provider = new cr.Provider(this, 's3file-provider', { onEventHandler: new lambda.Function(this, 's3file-on-event', { code: lambda.Code.fromAsset(path.join(__dirname, 's3-file-handler')), - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, handler: 'index.onEvent', initialPolicy: [ new iam.PolicyStatement({ diff --git a/packages/aws-cdk-lib/custom-resources/test/provider-framework/provider.test.ts b/packages/aws-cdk-lib/custom-resources/test/provider-framework/provider.test.ts index aa164cb5fa1d0..16176d6285588 100644 --- a/packages/aws-cdk-lib/custom-resources/test/provider-framework/provider.test.ts +++ b/packages/aws-cdk-lib/custom-resources/test/provider-framework/provider.test.ts @@ -22,12 +22,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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }), isCompleteHandler: new lambda.Function(stack, 'IsComplete', { code: lambda.Code.fromInline('foo'), handler: 'index.isComplete', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }), vpc: vpc, vpcSubnets: { subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS }, @@ -90,12 +90,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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }), isCompleteHandler: new lambda.Function(stack, 'IsComplete', { code: lambda.Code.fromInline('foo'), handler: 'index.isComplete', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }), vpc: vpc, vpcSubnets: { subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS }, @@ -142,7 +142,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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }), }); @@ -174,7 +174,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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); // WHEN @@ -248,7 +248,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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }); // THEN @@ -304,7 +304,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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }), logRetention: logs.RetentionDays.ONE_WEEK, }); @@ -335,7 +335,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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }), }); @@ -354,7 +354,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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }), role: new iam.Role(stack, 'MyRole', { assumedBy: new iam.ServicePrincipal('lambda.amazonaws.com'), @@ -382,7 +382,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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }), }); @@ -409,7 +409,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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }), providerFunctionName, }); @@ -434,7 +434,7 @@ describe('environment encryption', () => { 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_14_X, + runtime: lambda.Runtime.NODEJS_16_X, }), providerFunctionEnvEncryption: key, }); diff --git a/packages/aws-cdk-lib/custom-resources/test/provider-framework/waiter-state-machine.test.ts b/packages/aws-cdk-lib/custom-resources/test/provider-framework/waiter-state-machine.test.ts index 94d25cfd8323c..9d7fe2245c019 100644 --- a/packages/aws-cdk-lib/custom-resources/test/provider-framework/waiter-state-machine.test.ts +++ b/packages/aws-cdk-lib/custom-resources/test/provider-framework/waiter-state-machine.test.ts @@ -12,12 +12,12 @@ describe('state machine', () => { const isCompleteHandler = new lambdaFn(stack, 'isComplete', { code: Code.fromInline('foo'), - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, handler: 'index.handler', }); const timeoutHandler = new lambdaFn(stack, 'isTimeout', { code: Code.fromInline('foo'), - runtime: Runtime.NODEJS_14_X, + runtime: Runtime.NODEJS_16_X, handler: 'index.handler', }); const interval = Duration.hours(2); diff --git a/packages/aws-cdk-lib/region-info/build-tools/fact-tables.ts b/packages/aws-cdk-lib/region-info/build-tools/fact-tables.ts index 834329ba8bf61..f4281b31be95b 100644 --- a/packages/aws-cdk-lib/region-info/build-tools/fact-tables.ts +++ b/packages/aws-cdk-lib/region-info/build-tools/fact-tables.ts @@ -126,8 +126,8 @@ export const CR_DEFAULT_RUNTIME_MAP: Record = { [Partition.Default]: 'nodejs16.x', [Partition.Cn]: 'nodejs16.x', [Partition.UsGov]: 'nodejs16.x', - [Partition.UsIso]: 'nodejs14.x', - [Partition.UsIsoB]: 'nodejs14.x', + [Partition.UsIso]: 'nodejs16.x', + [Partition.UsIsoB]: 'nodejs16.x', }; // https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-access-logs.html#access-logging-bucket-permissions diff --git a/packages/aws-cdk-lib/triggers/test/triggers.test.ts b/packages/aws-cdk-lib/triggers/test/triggers.test.ts index 703dbe70eaa82..20b7fbd7be518 100644 --- a/packages/aws-cdk-lib/triggers/test/triggers.test.ts +++ b/packages/aws-cdk-lib/triggers/test/triggers.test.ts @@ -11,7 +11,7 @@ test('minimal trigger function', () => { // WHEN new triggers.TriggerFunction(stack, 'MyTrigger', { handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('foo'), }); @@ -33,7 +33,7 @@ test('before/after', () => { // WHEN const myTrigger = new triggers.TriggerFunction(stack, 'MyTrigger', { - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('zoo'), handler: 'index.handler', @@ -73,13 +73,13 @@ test('multiple functions', () => { // WHEN new triggers.TriggerFunction(stack, 'MyTrigger', { handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('foo'), }); new triggers.TriggerFunction(stack, 'MySecondTrigger', { handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('bar'), }); @@ -95,7 +95,7 @@ test('minimal trigger', () => { const stack = new Stack(); const func = new lambda.Function(stack, 'MyFunction', { handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('foo'), }); @@ -117,7 +117,7 @@ test('trigger with optional properties', () => { const stack = new Stack(); const func = new lambda.Function(stack, 'MyFunction', { handler: 'index.handler', - runtime: lambda.Runtime.NODEJS_14_X, + runtime: lambda.Runtime.NODEJS_16_X, code: lambda.Code.fromInline('foo'), }); diff --git a/packages/aws-cdk/test/api/hotswap/lambda-functions-inline-hotswap-deployments.test.ts b/packages/aws-cdk/test/api/hotswap/lambda-functions-inline-hotswap-deployments.test.ts index 562a007b86d8d..3dc9a5a7762f9 100644 --- a/packages/aws-cdk/test/api/hotswap/lambda-functions-inline-hotswap-deployments.test.ts +++ b/packages/aws-cdk/test/api/hotswap/lambda-functions-inline-hotswap-deployments.test.ts @@ -31,7 +31,7 @@ describe.each([HotswapMode.FALL_BACK, HotswapMode.HOTSWAP_ONLY])('these tests do Code: { ZipFile: 'exports.handler = () => {return true}', }, - Runtime: 'nodejs14.x', + Runtime: 'nodejs16.x', FunctionName: 'my-function', }, }, @@ -47,7 +47,7 @@ describe.each([HotswapMode.FALL_BACK, HotswapMode.HOTSWAP_ONLY])('these tests do Code: { ZipFile: newCode, }, - Runtime: 'nodejs14.x', + Runtime: 'nodejs16.x', FunctionName: 'my-function', }, },