Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(lambda): Migrate NODEJS_10_X to NODEJS_14_X #20568

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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 @@ -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