Skip to content

Commit

Permalink
fix: change Node 10 to 14 everywhere
Browse files Browse the repository at this point in the history
This is a backport of #20595.
  • Loading branch information
rix0rrr committed Sep 29, 2022
1 parent 8db36ed commit f469cd6
Show file tree
Hide file tree
Showing 34 changed files with 185 additions and 185 deletions.
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 @@ -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 @@ -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
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 @@ -121,7 +121,7 @@ describe('given an AutoScalingGroup and no role', () => {
// GIVEN
const fn = new lambda.Function(stack, 'Fn', {
code: lambda.Code.fromInline('foo'),
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
handler: 'index.index',
});

Expand Down Expand Up @@ -165,7 +165,7 @@ describe('given an AutoScalingGroup and no role', () => {
const key = new kms.Key(stack, 'key');
const fn = new lambda.Function(stack, 'Fn', {
code: lambda.Code.fromInline('foo'),
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
handler: 'index.index',
});

Expand Down Expand Up @@ -297,7 +297,7 @@ describe('given an AutoScalingGroup and a role', () => {
// GIVEN
const fn = new lambda.Function(stack, 'Fn', {
code: lambda.Code.fromInline('foo'),
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
handler: 'index.index',
});
const myrole = new iam.Role(stack, 'MyRole', {
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-cloudfront/test/distribution.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ describe('with Lambda@Edge functions', () => {

beforeEach(() => {
lambdaFunction = new lambda.Function(stack, 'Function', {
runtime: lambda.Runtime.NODEJS,
runtime: lambda.Runtime.NODEJS_14_X,
code: lambda.Code.fromInline('whatever'),
handler: 'index.handler',
});
Expand Down Expand Up @@ -826,7 +826,7 @@ describe('with Lambda@Edge functions', () => {

test('with removable env vars', () => {
const envLambdaFunction = new lambda.Function(stack, 'EnvFunction', {
runtime: lambda.Runtime.NODEJS,
runtime: lambda.Runtime.NODEJS_14_X,
code: lambda.Code.fromInline('whateverwithenv'),
handler: 'index.handler',
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ added the ellipsis so a user would know there was more to r...`,
const lambdaFunction = new lambda.Function(stack, 'Lambda', {
code: lambda.Code.fromInline('foo'),
handler: 'index.handler',
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
});

new CloudFrontWebDistribution(stack, 'AnAmazingWebsiteProbably', {
Expand Down Expand Up @@ -890,7 +890,7 @@ added the ellipsis so a user would know there was more to r...`,
const lambdaFunction = new lambda.Function(stack, 'Lambda', {
code: lambda.Code.fromInline('foo'),
handler: 'index.handler',
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
});
lambdaFunction.addEnvironment('KEY', 'value', { removeInEdge: true });

Expand Down Expand Up @@ -928,7 +928,7 @@ added the ellipsis so a user would know there was more to r...`,
const lambdaFunction = new lambda.Function(stack, 'Lambda', {
code: lambda.Code.fromInline('foo'),
handler: 'index.handler',
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
environment: {
KEY: 'value',
},
Expand Down Expand Up @@ -1324,7 +1324,7 @@ added the ellipsis so a user would know there was more to r...`,
const fn = new lambda.Function(stack, 'Lambda', {
code: lambda.Code.fromInline('foo'),
handler: 'index.handler',
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
});
const lambdaVersion = new lambda.Version(stack, 'LambdaVersion', { lambda: fn });

Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-cloudtrail/test/cloudtrail.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ describe('cloudtrail', () => {
test('for Lambda function data event', () => {
const stack = getTestStack();
const lambdaFunction = new lambda.Function(stack, 'LambdaFunction', {
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
handler: 'hello.handler',
code: lambda.Code.fromInline('exports.handler = {}'),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function mockFunction(stack: cdk.Stack, id: string) {
return new lambda.Function(stack, id, {
code: lambda.Code.fromInline('mock'),
handler: 'index.handler',
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
});
}
function mockAlias(stack: cdk.Stack) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function mockFunction(stack: cdk.Stack, id: string) {
return new lambda.Function(stack, id, {
code: lambda.Code.fromInline('mock'),
handler: 'index.handler',
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
});
}
function mockAlias(stack: cdk.Stack) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ function stackIncludingLambdaInvokeCodePipeline(props: HelperProps, app?: App) {
lambda: new lambda.Function(stack, 'Lambda', {
code: lambda.Code.fromCfnParameters(),
handler: 'index.handler',
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
}),
userParameters: props.userParams,
userParametersString: props.userParamsString,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ describe('pipeline', () => {
const lambdaFun = new lambda.Function(stack, 'Function', {
code: new lambda.InlineCode('bla'),
handler: 'index.handler',
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
});

const pipeline = new codepipeline.Pipeline(stack, 'Pipeline');
Expand Down
8 changes: 4 additions & 4 deletions packages/@aws-cdk/aws-config/test/rule.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('rule', () => {
const fn = new lambda.Function(stack, 'Function', {
code: lambda.AssetCode.fromInline('foo'),
handler: 'index.handler',
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
});

// WHEN
Expand Down Expand Up @@ -202,7 +202,7 @@ describe('rule', () => {
const fn = new lambda.Function(stack, 'Function', {
code: lambda.AssetCode.fromInline('foo'),
handler: 'index.handler',
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
});

// THEN
Expand All @@ -219,7 +219,7 @@ describe('rule', () => {
const fn = new lambda.Function(stack, 'Function', {
code: lambda.AssetCode.fromInline('foo'),
handler: 'index.handler',
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
});

// THEN
Expand All @@ -238,7 +238,7 @@ describe('rule', () => {
const fn = new lambda.Function(stack, 'Function', {
code: lambda.Code.fromInline('dummy'),
handler: 'index.handler',
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
});

// WHEN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class ImportCertificates extends CoreConstruct {

const serviceToken = CustomResourceProvider.getOrCreate(this, IMPORT_CERTIFICATES_RESOURCE_TYPE, {
codeDirectory: path.join(__dirname, 'import-certificates-handler'),
runtime: CustomResourceProviderRuntime.NODEJS_12,
runtime: CustomResourceProviderRuntime.NODEJS_14_X,
policyStatements: [{
Effect: 'Allow',
Action: ['acm:ImportCertificate', 'acm:DeleteCertificate'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ beforeEach(() => {
const lambdaProps = {
code: new lambda.InlineCode('foo'),
handler: 'index.handler',
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
};

test('event bus as destination', () => {
Expand Down
Loading

0 comments on commit f469cd6

Please sign in to comment.