Skip to content

Commit

Permalink
fix: replace all usages of node 8 with 10
Browse files Browse the repository at this point in the history
  • Loading branch information
nmussy committed Oct 24, 2019
1 parent 3af61c7 commit 00d7ebf
Show file tree
Hide file tree
Showing 11 changed files with 67 additions and 67 deletions.
8 changes: 4 additions & 4 deletions packages/@aws-cdk/aws-lambda/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ setting the `deadLetterQueueEnabled: true` configuration.
import lambda = require('@aws-cdk/aws-lambda');

const fn = new lambda.Function(this, 'MyFunction', {
runtime: lambda.Runtime.NODEJS_8_10,
runtime: lambda.Runtime.NODEJS_10_X,
handler: 'index.handler',
code: lambda.Code.fromInline('exports.handler = function(event, ctx, cb) { return cb(null, "hi"); }'),
deadLetterQueueEnabled: true
Expand All @@ -122,7 +122,7 @@ import sqs = require('@aws-cdk/aws-sqs');

const dlq = new sqs.Queue(this, 'DLQ');
const fn = new lambda.Function(this, 'MyFunction', {
runtime: lambda.Runtime.NODEJS_8_10,
runtime: lambda.Runtime.NODEJS_10_X,
handler: 'index.handler',
code: lambda.Code.fromInline('exports.handler = function(event, ctx, cb) { return cb(null, "hi"); }'),
deadLetterQueue: dlq
Expand All @@ -138,7 +138,7 @@ to learn more about AWS Lambdas and DLQs.
import lambda = require('@aws-cdk/aws-lambda');

const fn = new lambda.Function(this, 'MyFunction', {
runtime: lambda.Runtime.NODEJS_8_10,
runtime: lambda.Runtime.NODEJS_10_X,
handler: 'index.handler',
code: lambda.Code.fromInline('exports.handler = function(event, ctx, cb) { return cb(null, "hi"); }'),
tracing: lambda.Tracing.ACTIVE
Expand All @@ -153,7 +153,7 @@ to learn more about AWS Lambda's X-Ray support.
import lambda = require('@aws-cdk/aws-lambda');

const fn = new lambda.Function(this, 'MyFunction', {
runtime: lambda.Runtime.NODEJS_8_10,
runtime: lambda.Runtime.NODEJS_10_X,
handler: 'index.handler',
code: lambda.Code.fromInline('exports.handler = function(event, ctx, cb) { return cb(null, "hi"); }'),
reservedConcurrentExecutions: 100
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
}
},
"CompatibleRuntimes": [
"nodejs8.10"
"nodejs10.x"
],
"Description": "A layer to test the L2 construct",
"LicenseInfo": "Apache-2.0"
Expand Down Expand Up @@ -104,7 +104,7 @@
"Arn"
]
},
"Runtime": "nodejs8.10",
"Runtime": "nodejs10.x",
"Layers": [
{
"Ref": "MyLayer38944FA5"
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-lambda/test/integ.layer-version.lit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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_8_10],
compatibleRuntimes: [lambda.Runtime.NODEJS_10_X],
license: 'Apache-2.0',
description: 'A layer to test the L2 construct',
});
Expand All @@ -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_8_10,
runtime: lambda.Runtime.NODEJS_10_X,
layers: [layer],
});
/// !hide
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"Arn"
]
},
"Runtime": "nodejs8.10"
"Runtime": "nodejs10.x"
},
"DependsOn": [
"OneWeekServiceRole05A6F9F8"
Expand Down Expand Up @@ -227,7 +227,7 @@
"Arn"
]
},
"Runtime": "nodejs8.10"
"Runtime": "nodejs10.x"
},
"DependsOn": [
"OneMonthServiceRoleFBD1064F"
Expand Down Expand Up @@ -300,7 +300,7 @@
"Arn"
]
},
"Runtime": "nodejs8.10"
"Runtime": "nodejs10.x"
},
"DependsOn": [
"OneYearServiceRole24D47762"
Expand Down
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-lambda/test/integ.log-retention.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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_8_10,
runtime: lambda.Runtime.NODEJS_10_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_8_10,
runtime: lambda.Runtime.NODEJS_10_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_8_10,
runtime: lambda.Runtime.NODEJS_10_X,
logRetention: logs.RetentionDays.ONE_YEAR
});

Expand Down
16 changes: 8 additions & 8 deletions packages/@aws-cdk/aws-lambda/test/test.alias.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export = {
const fn = new lambda.Function(stack, 'MyLambda', {
code: new lambda.InlineCode('hello()'),
handler: 'index.hello',
runtime: lambda.Runtime.NODEJS_8_10,
runtime: lambda.Runtime.NODEJS_10_X,
});

const version = fn.addVersion('1');
Expand Down Expand Up @@ -45,7 +45,7 @@ export = {
const fn = new lambda.Function(stack, 'MyLambda', {
code: new lambda.InlineCode('hello()'),
handler: 'index.hello',
runtime: lambda.Runtime.NODEJS_8_10,
runtime: lambda.Runtime.NODEJS_10_X,
});

new lambda.Alias(stack, 'Alias', {
Expand All @@ -68,7 +68,7 @@ export = {
const fn = new lambda.Function(stack, 'MyLambda', {
code: new lambda.InlineCode('hello()'),
handler: 'index.hello',
runtime: lambda.Runtime.NODEJS_8_10,
runtime: lambda.Runtime.NODEJS_10_X,
});

const version = fn.addVersion('NewVersion');
Expand Down Expand Up @@ -96,7 +96,7 @@ export = {
const fn = new lambda.Function(stack, 'MyLambda', {
code: new lambda.InlineCode('hello()'),
handler: 'index.hello',
runtime: lambda.Runtime.NODEJS_8_10,
runtime: lambda.Runtime.NODEJS_10_X,
});

const version1 = fn.addVersion('1');
Expand Down Expand Up @@ -129,7 +129,7 @@ export = {
const fn = new lambda.Function(stack, 'MyLambda', {
code: new lambda.InlineCode('hello()'),
handler: 'index.hello',
runtime: lambda.Runtime.NODEJS_8_10,
runtime: lambda.Runtime.NODEJS_10_X,
});

const version = fn.addVersion('1');
Expand Down Expand Up @@ -160,7 +160,7 @@ export = {
const fn = new lambda.Function(stack, 'MyLambda', {
code: new lambda.InlineCode('hello()'),
handler: 'index.hello',
runtime: lambda.Runtime.NODEJS_8_10,
runtime: lambda.Runtime.NODEJS_10_X,
});

const version = fn.addVersion('1');
Expand Down Expand Up @@ -205,7 +205,7 @@ export = {
const fn = new lambda.Function(stack, 'MyLambda', {
code: new lambda.InlineCode('hello()'),
handler: 'index.hello',
runtime: lambda.Runtime.NODEJS_8_10,
runtime: lambda.Runtime.NODEJS_10_X,
});

const version = fn.addVersion('1');
Expand All @@ -224,7 +224,7 @@ export = {
const fn = new lambda.Function(stack, 'MyLambda', {
code: new lambda.InlineCode('hello()'),
handler: 'index.hello',
runtime: lambda.Runtime.NODEJS_8_10,
runtime: lambda.Runtime.NODEJS_10_X,
});

const version = fn.addVersion('1');
Expand Down
14 changes: 7 additions & 7 deletions packages/@aws-cdk/aws-lambda/test/test.code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export = {
},
'fails if larger than 4096 bytes'(test: Test) {
test.throws(
() => defineFunction(lambda.Code.fromInline(generateRandomString(4097)), lambda.Runtime.NODEJS_8_10),
() => defineFunction(lambda.Code.fromInline(generateRandomString(4097)), lambda.Runtime.NODEJS_10_X),
/Lambda source is too large, must be <= 4096 but is 4097/);
test.done();
}
Expand All @@ -40,13 +40,13 @@ export = {
// WHEN
new lambda.Function(stack, 'Func1', {
handler: 'foom',
runtime: lambda.Runtime.NODEJS_8_10,
runtime: lambda.Runtime.NODEJS_10_X,
code: directoryAsset
});

new lambda.Function(stack, 'Func2', {
handler: 'foom',
runtime: lambda.Runtime.NODEJS_8_10,
runtime: lambda.Runtime.NODEJS_10_X,
code: directoryAsset
});

Expand All @@ -69,7 +69,7 @@ export = {
// WHEN
new lambda.Function(stack, 'Func1', {
code: lambda.Code.fromAsset(location),
runtime: lambda.Runtime.NODEJS_8_10,
runtime: lambda.Runtime.NODEJS_10_X,
handler: 'foom',
});

Expand All @@ -90,7 +90,7 @@ export = {
const code = new lambda.CfnParametersCode();
new lambda.Function(stack, 'Function', {
code,
runtime: lambda.Runtime.NODEJS_8_10,
runtime: lambda.Runtime.NODEJS_10_X,
handler: 'index.handler',
});

Expand Down Expand Up @@ -144,7 +144,7 @@ export = {

new lambda.Function(stack, 'Function', {
code,
runtime: lambda.Runtime.NODEJS_8_10,
runtime: lambda.Runtime.NODEJS_10_X,
handler: 'index.handler',
});

Expand Down Expand Up @@ -189,7 +189,7 @@ export = {
},
};

function defineFunction(code: lambda.Code, runtime: lambda.Runtime = lambda.Runtime.NODEJS_8_10) {
function defineFunction(code: lambda.Code, runtime: lambda.Runtime = lambda.Runtime.NODEJS_10_X) {
const stack = new cdk.Stack();
return new lambda.Function(stack, 'Func', {
handler: 'foom',
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-lambda/test/test.function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export = testCase({
// WHEN/THEN
test.throws(() => new lambda.Function(stack, 'fn', {
handler: 'foo',
runtime: lambda.Runtime.NODEJS_8_10,
runtime: lambda.Runtime.NODEJS_10_X,
code: lambda.Code.fromInline('')
}), /Lambda inline code cannot be empty/);
test.done();
Expand Down
Loading

0 comments on commit 00d7ebf

Please sign in to comment.