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

feat(lambda): add nodejs10x runtime and update tests #2544

Merged
merged 2 commits into from
May 20, 2019
Merged
Changes from all 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
Original file line number Diff line number Diff line change
@@ -54,7 +54,7 @@
"Arn"
]
},
"Runtime": "nodejs6.10"
"Runtime": "nodejs8.10"
},
"DependsOn": [
"BooksHandlerServiceRole5B6A8847"
@@ -270,7 +270,7 @@
"Arn"
]
},
"Runtime": "nodejs6.10"
"Runtime": "nodejs8.10"
},
"DependsOn": [
"BookHandlerServiceRole894768AD"
@@ -486,7 +486,7 @@
"Arn"
]
},
"Runtime": "nodejs6.10"
"Runtime": "nodejs8.10"
},
"DependsOn": [
"HelloServiceRole1E55EA16"
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-apigateway/test/integ.restapi.books.ts
Original file line number Diff line number Diff line change
@@ -7,19 +7,19 @@ class BookStack extends cdk.Stack {
super(scope, id);

const booksHandler = new apigw.LambdaIntegration(new lambda.Function(this, 'BooksHandler', {
runtime: lambda.Runtime.NodeJS610,
runtime: lambda.Runtime.NodeJS810,
handler: 'index.handler',
code: lambda.Code.inline(`exports.handler = ${echoHandlerCode}`)
}));

const bookHandler = new apigw.LambdaIntegration(new lambda.Function(this, 'BookHandler', {
runtime: lambda.Runtime.NodeJS610,
runtime: lambda.Runtime.NodeJS810,
handler: 'index.handler',
code: lambda.Code.inline(`exports.handler = ${echoHandlerCode}`)
}));

const hello = new apigw.LambdaIntegration(new lambda.Function(this, 'Hello', {
runtime: lambda.Runtime.NodeJS610,
runtime: lambda.Runtime.NodeJS810,
handler: 'index.handler',
code: lambda.Code.inline(`exports.handler = ${helloCode}`)
}));
Original file line number Diff line number Diff line change
@@ -384,7 +384,7 @@
"Arn"
]
},
"Runtime": "nodejs6.10"
"Runtime": "nodejs8.10"
},
"DependsOn": [
"MyHandlerServiceRoleFFA06653"
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-apigateway/test/integ.restapi.ts
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ class Test extends cdk.Stack {
});

const handler = new lambda.Function(this, 'MyHandler', {
runtime: lambda.Runtime.NodeJS610,
runtime: lambda.Runtime.NodeJS810,
code: lambda.Code.inline(`exports.handler = ${handlerCode}`),
handler: 'index.handler',
});
8 changes: 4 additions & 4 deletions packages/@aws-cdk/aws-apigateway/test/test.lambda-api.ts
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ export = {
const handler = new lambda.Function(stack, 'handler', {
handler: 'index.handler',
code: lambda.Code.inline('boom'),
runtime: lambda.Runtime.NodeJS610,
runtime: lambda.Runtime.NodeJS810,
});

// WHEN
@@ -78,7 +78,7 @@ export = {
const handler = new lambda.Function(stack, 'handler', {
handler: 'index.handler',
code: lambda.Code.inline('boom'),
runtime: lambda.Runtime.NodeJS610,
runtime: lambda.Runtime.NodeJS810,
});
const alias = new lambda.Alias(stack, 'alias', {
aliasName: 'my-alias',
@@ -145,7 +145,7 @@ export = {
const handler = new lambda.Function(stack, 'handler', {
handler: 'index.handler',
code: lambda.Code.inline('boom'),
runtime: lambda.Runtime.NodeJS610,
runtime: lambda.Runtime.NodeJS810,
});

// WHEN
@@ -184,7 +184,7 @@ export = {
const handler = new lambda.Function(stack, 'handler', {
handler: 'index.handler',
code: lambda.Code.inline('boom'),
runtime: lambda.Runtime.NodeJS610,
runtime: lambda.Runtime.NodeJS810,
});

test.throws(() => new apigw.LambdaRestApi(stack, 'lambda-rest-api', {
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-apigateway/test/test.lambda.ts
Original file line number Diff line number Diff line change
@@ -56,7 +56,7 @@ export = {
// GIVEN
const stack = new cdk.Stack();
const fn = new lambda.Function(stack, 'Handler', {
runtime: lambda.Runtime.NodeJS610,
runtime: lambda.Runtime.NodeJS810,
code: lambda.Code.inline('foo'),
handler: 'index.handler'
});
@@ -106,7 +106,7 @@ export = {
// GIVEN
const stack = new cdk.Stack();
const fn = new lambda.Function(stack, 'Handler', {
runtime: lambda.Runtime.NodeJS610,
runtime: lambda.Runtime.NodeJS810,
code: lambda.Code.inline('foo'),
handler: 'index.handler'
});
@@ -132,7 +132,7 @@ export = {
const api = new apigateway.RestApi(stack, 'test-api');

const handler = new lambda.Function(stack, 'MyFunc', {
runtime: lambda.Runtime.NodeJS610,
runtime: lambda.Runtime.NodeJS810,
handler: 'index.handler',
code: lambda.Code.inline(``)
});
Original file line number Diff line number Diff line change
@@ -658,7 +658,7 @@
"Arn"
]
},
"Runtime": "nodejs6.10"
"Runtime": "nodejs8.10"
},
"DependsOn": [
"LambdaFunServiceRoleDefaultPolicy217FED83",
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ const lambdaFun = new lambda.Function(stack, 'LambdaFun', {
};
`),
handler: 'index.handler',
runtime: lambda.Runtime.NodeJS610,
runtime: lambda.Runtime.NodeJS810,
});
const lambdaStage = pipeline.addStage({ name: 'Lambda' });
lambdaStage.addAction(new cpactions.LambdaInvokeAction({
Original file line number Diff line number Diff line change
@@ -434,7 +434,7 @@ export = {
const lambdaFun = new lambda.Function(stack, 'Function', {
code: new lambda.InlineCode('bla'),
handler: 'index.handler',
runtime: lambda.Runtime.NodeJS43,
runtime: lambda.Runtime.NodeJS810,
});

const pipeline = new codepipeline.Pipeline(stack, 'Pipeline');
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-cognito/test/test.user-pool.ts
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ export = {
const fn = new lambda.Function(stack, 'MyLambda', {
code: new lambda.InlineCode('foo'),
handler: 'index.handler',
runtime: lambda.Runtime.NodeJS610,
runtime: lambda.Runtime.NodeJS810,
});

// WHEN
@@ -56,7 +56,7 @@ export = {
const fn = new lambda.Function(stack, 'MyLambda', {
code: new lambda.InlineCode('foo'),
handler: 'index.handler',
runtime: lambda.Runtime.NodeJS610,
runtime: lambda.Runtime.NodeJS810,
});

// WHEN
@@ -93,7 +93,7 @@ export = {
const fn = new lambda.Function(stack, 'MyLambda', {
code: new lambda.InlineCode('foo'),
handler: 'index.handler',
runtime: lambda.Runtime.NodeJS610,
runtime: lambda.Runtime.NodeJS810,
});

// WHEN
Original file line number Diff line number Diff line change
@@ -54,7 +54,7 @@
"Arn"
]
},
"Runtime": "nodejs6.10"
"Runtime": "nodejs8.10"
},
"DependsOn": [
"MyFuncServiceRole54065130"
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ const app = new cdk.App();
const stack = new cdk.Stack(app, 'lambda-events');

const fn = new lambda.Function(stack, 'MyFunc', {
runtime: lambda.Runtime.NodeJS610,
runtime: lambda.Runtime.NodeJS810,
handler: 'index.handler',
code: lambda.Code.inline(`exports.handler = ${handler.toString()}`)
});
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-lambda/lib/runtime.ts
Original file line number Diff line number Diff line change
@@ -30,6 +30,7 @@ export class Runtime {
public static readonly NodeJS43 = new Runtime('nodejs4.3', RuntimeFamily.NodeJS, { supportsInlineCode: true });
public static readonly NodeJS610 = new Runtime('nodejs6.10', RuntimeFamily.NodeJS, { supportsInlineCode: true });
public static readonly NodeJS810 = new Runtime('nodejs8.10', RuntimeFamily.NodeJS, { supportsInlineCode: true });
robertd marked this conversation as resolved.
Show resolved Hide resolved
public static readonly NodeJS10x = new Runtime('nodejs10.x', RuntimeFamily.NodeJS, { supportsInlineCode: false });
public static readonly Python27 = new Runtime('python2.7', RuntimeFamily.Python, { supportsInlineCode: true });
public static readonly Python36 = new Runtime('python3.6', RuntimeFamily.Python, { supportsInlineCode: true });
public static readonly Python37 = new Runtime('python3.7', RuntimeFamily.Python, { supportsInlineCode: true });
Original file line number Diff line number Diff line change
@@ -99,7 +99,7 @@
"Arn"
]
},
"Runtime": "nodejs6.10"
"Runtime": "nodejs8.10"
},
"DependsOn": [
"MyFunctionServiceRole3C357FF2"
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ const bucketA = new s3.Bucket(stack, 'MyBucket', {
});

const fn = new lambda.Function(stack, 'MyFunction', {
runtime: lambda.Runtime.NodeJS610,
runtime: lambda.Runtime.NodeJS810,
handler: 'index.handler',
code: lambda.Code.inline(`exports.handler = ${handler.toString()}`)
});
Original file line number Diff line number Diff line change
@@ -75,7 +75,7 @@
"Arn"
]
},
"Runtime": "nodejs6.10"
"Runtime": "nodejs8.10"
},
"DependsOn": [
"MyLambdaServiceRoleDefaultPolicy5BBC6F68",
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-lambda/test/integ.lambda.ts
Original file line number Diff line number Diff line change
@@ -9,7 +9,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.NodeJS610,
runtime: lambda.Runtime.NodeJS810,
});

fn.addToRolePolicy(new iam.PolicyStatement().addAllResources().addAction('*'));
14 changes: 7 additions & 7 deletions packages/@aws-cdk/aws-lambda/test/test.alias.ts
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ export = {
const fn = new lambda.Function(stack, 'MyLambda', {
code: new lambda.InlineCode('hello()'),
handler: 'index.hello',
runtime: lambda.Runtime.NodeJS610,
runtime: lambda.Runtime.NodeJS810,
});

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

const version = fn.newVersion();
@@ -73,7 +73,7 @@ export = {
const fn = new lambda.Function(stack, 'MyLambda', {
code: new lambda.InlineCode('hello()'),
handler: 'index.hello',
runtime: lambda.Runtime.NodeJS610,
runtime: lambda.Runtime.NodeJS810,
});

const version1 = fn.addVersion('1');
@@ -106,7 +106,7 @@ export = {
const fn = new lambda.Function(stack, 'MyLambda', {
code: new lambda.InlineCode('hello()'),
handler: 'index.hello',
runtime: lambda.Runtime.NodeJS610,
runtime: lambda.Runtime.NodeJS810,
});

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

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

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

const version = fn.addVersion('1');
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-lambda/test/test.code.ts
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ export = {
},
'fails if larger than 4096 bytes'(test: Test) {
test.throws(
() => defineFunction(lambda.Code.inline(generateRandomString(4097)), lambda.Runtime.NodeJS610),
() => defineFunction(lambda.Code.inline(generateRandomString(4097)), lambda.Runtime.NodeJS810),
/Lambda source is too large, must be <= 4096 but is 4097/);
test.done();
}
Loading