Skip to content

Commit

Permalink
feat(nodejs): Migrate away from NODEJS_10_X and NODEJS_12_X to NODEJS…
Browse files Browse the repository at this point in the history
…_14_X
  • Loading branch information
robertd committed Jun 2, 2022
1 parent e2768e8 commit d03872c
Show file tree
Hide file tree
Showing 438 changed files with 2,667 additions and 2,068 deletions.
2 changes: 1 addition & 1 deletion INTEGRATION_TESTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const stack = new cdk.Stack(app, 'aws-cdk-lambda-1');
const fn = new lambda.Function(stack, 'MyLambda', {
code: new lambda.InlineCode('foo'),
handler: 'index.handler',
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
});

app.synth();
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-apigateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ have to define your models and mappings for the request, response, and integrati

```ts
const hello = new lambda.Function(this, 'hello', {
runtime: lambda.Runtime.NODEJS_12_X,
runtime: lambda.Runtime.NODEJS_14_X,
handler: 'hello.handler',
code: lambda.Code.fromAsset('lambda')
});
Expand Down
18 changes: 9 additions & 9 deletions packages/@aws-cdk/aws-apigateway/test/authorizers/lambda.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('lambda authorizer', () => {
const func = new lambda.Function(stack, 'myfunction', {
handler: 'handler',
code: lambda.Code.fromInline('foo'),
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
});

const auth = new TokenAuthorizer(stack, 'myauthorizer', {
Expand Down Expand Up @@ -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_12_X,
runtime: lambda.Runtime.NODEJS_14_X,
});

const auth = new RequestAuthorizer(stack, 'myauthorizer', {
Expand Down Expand Up @@ -160,7 +160,7 @@ describe('lambda authorizer', () => {
const func = new lambda.Function(stack, 'myfunction', {
handler: 'handler',
code: lambda.Code.fromInline('foo'),
runtime: lambda.Runtime.NODEJS_12_X,
runtime: lambda.Runtime.NODEJS_14_X,
});

expect(() => new RequestAuthorizer(stack, 'myauthorizer', {
Expand All @@ -176,7 +176,7 @@ describe('lambda authorizer', () => {
const func = new lambda.Function(stack, 'myfunction', {
handler: 'handler',
code: lambda.Code.fromInline('foo'),
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
});

const auth = new TokenAuthorizer(stack, 'myauthorizer', {
Expand Down Expand Up @@ -249,7 +249,7 @@ describe('lambda authorizer', () => {
const func = new lambda.Function(stack, 'myfunction', {
handler: 'handler',
code: lambda.Code.fromInline('foo'),
runtime: lambda.Runtime.NODEJS_12_X,
runtime: lambda.Runtime.NODEJS_14_X,
});

const auth = new RequestAuthorizer(stack, 'myauthorizer', {
Expand Down Expand Up @@ -320,7 +320,7 @@ describe('lambda authorizer', () => {
const func = new lambda.Function(stack, 'myfunction', {
handler: 'handler',
code: lambda.Code.fromInline('foo'),
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
});

const role = new iam.Role(stack, 'authorizerassumerole', {
Expand Down Expand Up @@ -410,7 +410,7 @@ describe('lambda authorizer', () => {
const func = new lambda.Function(stack, 'myfunction', {
handler: 'handler',
code: lambda.Code.fromInline('foo'),
runtime: lambda.Runtime.NODEJS_12_X,
runtime: lambda.Runtime.NODEJS_14_X,
});

const role = new iam.Role(stack, 'authorizerassumerole', {
Expand Down Expand Up @@ -501,7 +501,7 @@ describe('lambda authorizer', () => {
const func = new lambda.Function(stack, 'myfunction', {
handler: 'handler',
code: lambda.Code.fromInline('foo'),
runtime: lambda.Runtime.NODEJS_12_X,
runtime: lambda.Runtime.NODEJS_14_X,
});
const auth = new TokenAuthorizer(stack, 'myauthorizer', {
handler: func,
Expand All @@ -515,7 +515,7 @@ describe('lambda authorizer', () => {
const func = new lambda.Function(stack, 'myfunction', {
handler: 'handler',
code: lambda.Code.fromInline('foo'),
runtime: lambda.Runtime.NODEJS_12_X,
runtime: lambda.Runtime.NODEJS_14_X,
});
const auth = new RequestAuthorizer(stack, 'myauthorizer', {
handler: func,
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-apigateway/test/cors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ describe('cors', () => {
const handler = new lambda.Function(stack, 'handler', {
handler: 'index.handler',
code: lambda.Code.fromInline('boom'),
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
});

// WHEN
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-apigateway/test/deployment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,12 @@ describe('deployment', () => {
const stack2 = new Stack();
const handler1 = new lambda.Function(stack1, 'handler1', {
code: lambda.Code.fromAsset(path.join(__dirname, 'lambda')),
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
handler: 'index.handler',
});
const handler2 = new lambda.Function(stack2, 'handler2', {
code: lambda.Code.fromAsset(path.join(__dirname, 'lambda')),
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
handler: 'index.handler',
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe('lambda', () => {
// GIVEN
const stack = new cdk.Stack();
const fn = new lambda.Function(stack, 'Handler', {
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
code: lambda.Code.fromInline('foo'),
handler: 'index.handler',
});
Expand Down Expand Up @@ -102,7 +102,7 @@ describe('lambda', () => {
// GIVEN
const stack = new cdk.Stack();
const fn = new lambda.Function(stack, 'Handler', {
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
code: lambda.Code.fromInline('foo'),
handler: 'index.handler',
});
Expand Down Expand Up @@ -138,7 +138,7 @@ describe('lambda', () => {
// GIVEN
const stack = new cdk.Stack();
const fn = new lambda.Function(stack, 'Handler', {
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
code: lambda.Code.fromInline('foo'),
handler: 'index.handler',
});
Expand All @@ -162,7 +162,7 @@ describe('lambda', () => {
const api = new apigateway.RestApi(stack, 'test-api');

const handler = new lambda.Function(stack, 'MyFunc', {
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
handler: 'index.handler',
code: lambda.Code.fromInline('loo'),
});
Expand Down Expand Up @@ -228,7 +228,7 @@ describe('lambda', () => {
});

const handler = new lambda.Function(stack, 'MyFunc', {
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
handler: 'index.handler',
code: lambda.Code.fromInline('loo'),
});
Expand All @@ -249,7 +249,7 @@ describe('lambda', () => {
const method = restapi.root.addMethod('ANY');
const handler = new lambda.Function(stack, 'MyFunc', {
functionName: 'ThisFunction',
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
handler: 'index.handler',
code: lambda.Code.fromInline('loo'),
});
Expand All @@ -269,7 +269,7 @@ describe('lambda', () => {
const restapi = new apigateway.RestApi(stack, 'RestApi');
const method = restapi.root.addMethod('ANY');
const handler = new lambda.Function(stack, 'MyFunc', {
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
handler: 'index.handler',
code: lambda.Code.fromInline('loo'),
});
Expand Down
12 changes: 6 additions & 6 deletions packages/@aws-cdk/aws-apigateway/test/lambda-api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('lambda api', () => {
const handler = new lambda.Function(stack, 'handler', {
handler: 'index.handler',
code: lambda.Code.fromInline('boom'),
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
});

// WHEN
Expand Down Expand Up @@ -73,7 +73,7 @@ describe('lambda api', () => {
const handler = new lambda.Function(stack, 'handler', {
handler: 'index.handler',
code: lambda.Code.fromInline('boom'),
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
});
const alias = new lambda.Alias(stack, 'alias', {
aliasName: 'my-alias',
Expand Down Expand Up @@ -138,7 +138,7 @@ describe('lambda api', () => {
const handler = new lambda.Function(stack, 'handler', {
handler: 'index.handler',
code: lambda.Code.fromInline('boom'),
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
});

// WHEN
Expand Down Expand Up @@ -175,7 +175,7 @@ describe('lambda api', () => {
const handler = new lambda.Function(stack, 'handler', {
handler: 'index.handler',
code: lambda.Code.fromInline('boom'),
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
});

expect(() => new apigw.LambdaRestApi(stack, 'lambda-rest-api', {
Expand All @@ -196,7 +196,7 @@ describe('lambda api', () => {
const handler = new lambda.Function(stack, 'handler', {
handler: 'index.handler',
code: lambda.Code.fromInline('boom'),
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
});

// WHEN
Expand Down Expand Up @@ -252,7 +252,7 @@ describe('lambda api', () => {
handler: new lambda.Function(stack, 'handler', {
handler: 'index.handler',
code: lambda.Code.fromInline('boom'),
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
}),
restApiName: cdk.PhysicalName.GENERATE_IF_NEEDED,
});
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-apigateway/test/method.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ describe('method', () => {
const func = new lambda.Function(stack, 'myfunction', {
handler: 'handler',
code: lambda.Code.fromInline('foo'),
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
});

const auth = new apigw.TokenAuthorizer(stack, 'myauthorizer1', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const authorizer = new HttpLambdaAuthorizer('LambdaAuthorizer', authHandler, {
});

const handler = new lambda.Function(stack, 'lambda', {
runtime: lambda.Runtime.NODEJS_12_X,
runtime: lambda.Runtime.NODEJS_14_X,
handler: 'index.handler',
code: lambda.AssetCode.fromAsset(path.join(__dirname, '../integ.lambda.handler')),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,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_12_X,
runtime: lambda.Runtime.NODEJS_14_X,
handler: 'index.handler',
code: lambda.AssetCode.fromAsset(path.join(__dirname, '../integ.user-pool.handler')),
});
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"version": "20.0.0",
"files": {
"74589072567ba0ad5a12f277a47a8c3b7b5151e9290901fae0a4ce72fe7e3a3a": {
"source": {
"path": "asset.74589072567ba0ad5a12f277a47a8c3b7b5151e9290901fae0a4ce72fe7e3a3a",
"packaging": "zip"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "74589072567ba0ad5a12f277a47a8c3b7b5151e9290901fae0a4ce72fe7e3a3a.zip",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
},
"1fd1c15cb7d5e2e36a11745fd10b4b7c3ca8eb30642b41954630413d2b913cda": {
"source": {
"path": "asset.1fd1c15cb7d5e2e36a11745fd10b4b7c3ca8eb30642b41954630413d2b913cda.handler",
"packaging": "zip"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "1fd1c15cb7d5e2e36a11745fd10b4b7c3ca8eb30642b41954630413d2b913cda.zip",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
},
"4eca206174995529e6f14fd5d16aaf201875882e3a7cdf7c049110c2ae2772dd": {
"source": {
"path": "AuthorizerInteg.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "4eca206174995529e6f14fd5d16aaf201875882e3a7cdf7c049110c2ae2772dd.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
}
},
"dockerImages": {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@
]
},
"Handler": "index.handler",
"Runtime": "nodejs12.x"
"Runtime": "nodejs14.x"
},
"DependsOn": [
"lambdaServiceRole494E4CA6"
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"17.0.0"}
{"version":"20.0.0"}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "18.0.0",
"version": "20.0.0",
"testCases": {
"aws-apigatewayv2-authorizers/test/http/integ.lambda": {
"http/integ.lambda": {
"stacks": [
"AuthorizerInteg"
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "17.0.0",
"version": "20.0.0",
"artifacts": {
"Tree": {
"type": "cdk:tree",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"id": "Tree",
"path": "Tree",
"constructInfo": {
"fqn": "@aws-cdk/core.Construct",
"version": "0.0.0"
"fqn": "constructs.Construct",
"version": "10.0.9"
}
},
"AuthorizerInteg": {
Expand Down Expand Up @@ -473,8 +473,8 @@
}
},
"constructInfo": {
"fqn": "@aws-cdk/core.Construct",
"version": "0.0.0"
"fqn": "constructs.Construct",
"version": "10.0.9"
}
},
"1fd1c15cb7d5e2e36a11745fd10b4b7c3ca8eb30642b41954630413d2b913cda": {
Expand Down Expand Up @@ -507,14 +507,14 @@
}
},
"constructInfo": {
"fqn": "@aws-cdk/core.Construct",
"version": "0.0.0"
"fqn": "constructs.Construct",
"version": "10.0.9"
}
}
},
"constructInfo": {
"fqn": "@aws-cdk/core.Construct",
"version": "0.0.0"
"fqn": "constructs.Construct",
"version": "10.0.9"
}
},
"lambda": {
Expand Down Expand Up @@ -647,7 +647,7 @@
]
},
"handler": "index.handler",
"runtime": "nodejs12.x"
"runtime": "nodejs14.x"
}
},
"constructInfo": {
Expand Down
Loading

0 comments on commit d03872c

Please sign in to comment.