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

refactor(lambda): renamed the lambda.Runtime enum values from NodeJS to Nodejs #2815

Merged
merged 4 commits into from
Jun 12, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 packages/@aws-cdk/assets-docker/lib/adopted-repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class AdoptedRepository extends ecr.RepositoryBase {
super(scope, id);

const fn = new lambda.SingletonFunction(this, 'Function', {
runtime: lambda.Runtime.NodeJS810,
runtime: lambda.Runtime.Nodejs810,
lambdaPurpose: 'AdoptEcrRepository',
handler: 'handler.handler',
code: lambda.Code.asset(path.join(__dirname, 'adopt-repository')),
Expand Down
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
Expand Up @@ -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.NodeJS810,
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.NodeJS810,
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.NodeJS810,
runtime: lambda.Runtime.Nodejs810,
handler: 'index.handler',
code: lambda.Code.inline(`exports.handler = ${helloCode}`)
}));
Expand Down
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
Expand Up @@ -23,7 +23,7 @@ class Test extends cdk.Stack {
});

const handler = new lambda.Function(this, 'MyHandler', {
runtime: lambda.Runtime.NodeJS810,
runtime: lambda.Runtime.Nodejs810,
code: lambda.Code.inline(`exports.handler = ${handlerCode}`),
handler: 'index.handler',
});
Expand Down
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
Expand Up @@ -14,7 +14,7 @@ export = {
const handler = new lambda.Function(stack, 'handler', {
handler: 'index.handler',
code: lambda.Code.inline('boom'),
runtime: lambda.Runtime.NodeJS810,
runtime: lambda.Runtime.Nodejs810,
});

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

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

test.throws(() => new apigw.LambdaRestApi(stack, 'lambda-rest-api', {
Expand Down
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
Expand Up @@ -56,7 +56,7 @@ export = {
// GIVEN
const stack = new cdk.Stack();
const fn = new lambda.Function(stack, 'Handler', {
runtime: lambda.Runtime.NodeJS810,
runtime: lambda.Runtime.Nodejs810,
code: lambda.Code.inline('foo'),
handler: 'index.handler'
});
Expand Down Expand Up @@ -106,7 +106,7 @@ export = {
// GIVEN
const stack = new cdk.Stack();
const fn = new lambda.Function(stack, 'Handler', {
runtime: lambda.Runtime.NodeJS810,
runtime: lambda.Runtime.Nodejs810,
code: lambda.Code.inline('foo'),
handler: 'index.handler'
});
Expand All @@ -132,7 +132,7 @@ export = {
const api = new apigateway.RestApi(stack, 'test-api');

const handler = new lambda.Function(stack, 'MyFunc', {
runtime: lambda.Runtime.NodeJS810,
runtime: lambda.Runtime.Nodejs810,
handler: 'index.handler',
code: lambda.Code.inline(``)
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('given an AutoScalingGroup', () => {
// GIVEN
const fn = new lambda.Function(stack, 'Fn', {
code: lambda.Code.inline('foo'),
runtime: lambda.Runtime.NodeJS810,
runtime: lambda.Runtime.Nodejs810,
handler: 'index.index',
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export class DnsValidatedCertificate extends cdk.Construct implements ICertifica
const requestorFunction = new lambda.Function(this, 'CertificateRequestorFunction', {
code: lambda.Code.asset(path.resolve(__dirname, '..', 'lambda-packages', 'dns_validated_certificate_handler', 'lib')),
handler: 'index.certificateRequestHandler',
runtime: lambda.Runtime.NodeJS810,
runtime: lambda.Runtime.Nodejs810,
timeout: 15 * 60 // 15 minutes
});
requestorFunction.addToRolePolicy(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export class AwsCustomResource extends cdk.Construct {

const provider = new lambda.SingletonFunction(this, 'Provider', {
code: lambda.Code.asset(path.join(__dirname, 'aws-custom-resource-provider')),
runtime: lambda.Runtime.NodeJS10x,
runtime: lambda.Runtime.Nodejs10x,
handler: 'index.handler',
uuid: '679f53fa-c002-430c-b0da-5b7982bd2287',
lambdaPurpose: 'AWS'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const stack = new cdk.Stack(app, 'aws-cdk-codedeploy-lambda');
const handler = new lambda.Function(stack, `Handler`, {
code: lambda.Code.asset(path.join(__dirname, 'handler')),
handler: 'index.handler',
runtime: lambda.Runtime.NodeJS810,
runtime: lambda.Runtime.Nodejs810,
});
const version = handler.addVersion('1');
const blueGreenAlias = new lambda.Alias(stack, `Alias`, {
Expand All @@ -22,12 +22,12 @@ const blueGreenAlias = new lambda.Alias(stack, `Alias`, {
const preHook = new lambda.Function(stack, `PreHook`, {
code: lambda.Code.asset(path.join(__dirname, 'preHook')),
handler: 'index.handler',
runtime: lambda.Runtime.NodeJS810
runtime: lambda.Runtime.Nodejs810
});
const postHook = new lambda.Function(stack, `PostHook`, {
code: lambda.Code.asset(path.join(__dirname, 'postHook')),
handler: 'index.handler',
runtime: lambda.Runtime.NodeJS810
runtime: lambda.Runtime.Nodejs810
});

new codedeploy.LambdaDeploymentGroup(stack, 'BlueGreenDeployment', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function mockFunction(stack: cdk.Stack, id: string) {
return new lambda.Function(stack, id, {
code: lambda.Code.inline('mock'),
handler: 'index.handler',
runtime: lambda.Runtime.NodeJS810
runtime: lambda.Runtime.Nodejs810
});
}
function mockAlias(stack: cdk.Stack) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const lambdaCode = lambda.Code.cfnParameters();
new lambda.Function(lambdaStack, 'Lambda', {
code: lambdaCode,
handler: 'index.handler',
runtime: lambda.Runtime.NodeJS810,
runtime: lambda.Runtime.Nodejs810,
});
// other resources that your Lambda needs, added to the lambdaStack...

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const lambdaFun = new lambda.Function(stack, 'LambdaFun', {
};
`),
handler: 'index.handler',
runtime: lambda.Runtime.NodeJS810,
runtime: lambda.Runtime.Nodejs810,
});
const lambdaStage = pipeline.addStage({ name: 'Lambda' });
lambdaStage.addAction(new cpactions.LambdaInvokeAction({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ function stackIncludingLambdaInvokeCodePipeline(userParams: { [key: string]: any
lambda: new lambda.Function(stack, 'Lambda', {
code: lambda.Code.cfnParameters(),
handler: 'index.handler',
runtime: lambda.Runtime.NodeJS810,
runtime: lambda.Runtime.Nodejs810,
}),
userParameters: userParams,
}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ export = {
const lambdaFun = new lambda.Function(stack, 'Function', {
code: new lambda.InlineCode('bla'),
handler: 'index.handler',
runtime: lambda.Runtime.NodeJS810,
runtime: lambda.Runtime.Nodejs810,
});

const pipeline = new codepipeline.Pipeline(stack, 'Pipeline');
Expand Down
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
Expand Up @@ -28,7 +28,7 @@ export = {
const fn = new lambda.Function(stack, 'MyLambda', {
code: new lambda.InlineCode('foo'),
handler: 'index.handler',
runtime: lambda.Runtime.NodeJS810,
runtime: lambda.Runtime.Nodejs810,
});

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

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

// WHEN
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-config/test/integ.rule.lit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ConfigStack extends cdk.Stack {
const fn = new lambda.Function(this, 'CustomFunction', {
code: lambda.AssetCode.inline('exports.handler = (event) => console.log(event);'),
handler: 'index.handler',
runtime: lambda.Runtime.NodeJS810
runtime: lambda.Runtime.Nodejs810
});

const customRule = new config.CustomRule(this, 'Custom', {
Expand Down
8 changes: 4 additions & 4 deletions packages/@aws-cdk/aws-config/test/test.rule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export = {
const fn = new lambda.Function(stack, 'Function', {
code: lambda.AssetCode.inline('foo'),
handler: 'index.handler',
runtime: lambda.Runtime.NodeJS810
runtime: lambda.Runtime.Nodejs810
});

// WHEN
Expand Down Expand Up @@ -210,7 +210,7 @@ export = {
const fn = new lambda.Function(stack, 'Function', {
code: lambda.AssetCode.inline('foo'),
handler: 'index.handler',
runtime: lambda.Runtime.NodeJS810
runtime: lambda.Runtime.Nodejs810
});

// WHEN
Expand All @@ -231,7 +231,7 @@ export = {
const fn = new lambda.Function(stack, 'Function', {
code: lambda.AssetCode.inline('foo'),
handler: 'index.handler',
runtime: lambda.Runtime.NodeJS810
runtime: lambda.Runtime.Nodejs810
});

// THEN
Expand All @@ -252,7 +252,7 @@ export = {
const fn = new lambda.Function(stack, 'Function', {
code: lambda.Code.inline('dummy'),
handler: 'index.handler',
runtime: lambda.Runtime.NodeJS810
runtime: lambda.Runtime.Nodejs810
});

// WHEN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class GlobalTableCoordinator extends cdk.Stack {
code: lambda.Code.asset(path.resolve(__dirname, "../", "lambda-packages", "aws-global-table-coordinator", "lib")),
description: "Lambda to make DynamoDB a global table",
handler: "index.handler",
runtime: lambda.Runtime.NodeJS810,
runtime: lambda.Runtime.Nodejs810,
timeout: 300,
uuid: "D38B65A6-6B54-4FB6-9BAD-9CD40A6DAC12",
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.NodeJS810,
runtime: lambda.Runtime.Nodejs810,
handler: 'index.handler',
code: lambda.Code.inline(`exports.handler = ${handler.toString()}`)
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export class TestFunction extends lambda.Function {
super(scope, id, {
handler: 'index.handler',
code: lambda.Code.inline(`exports.handler = ${handler.toString()}`),
runtime: lambda.Runtime.NodeJS810
runtime: lambda.Runtime.Nodejs810
});
}
}
Expand Down
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-lambda-event-sources/test/test.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export = {
const handler = new lambda.Function(stack, 'MyFunc', {
code: lambda.Code.inline('boom'),
handler: 'index.handler',
runtime: lambda.Runtime.NodeJS,
runtime: lambda.Runtime.Nodejs,
});

// WHEN
Expand All @@ -37,7 +37,7 @@ export = {
const handler = new lambda.Function(stack, 'MyFunc', {
code: lambda.Code.inline('boom'),
handler: 'index.handler',
runtime: lambda.Runtime.NodeJS,
runtime: lambda.Runtime.Nodejs,
});

// WHEN
Expand Down Expand Up @@ -74,7 +74,7 @@ export = {
const handler = new lambda.Function(stack, 'MyFunc', {
code: lambda.Code.inline('boom'),
handler: 'index.handler',
runtime: lambda.Runtime.NodeJS,
runtime: lambda.Runtime.Nodejs,
});

// WHEN
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-lambda/lib/log-retention.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class LogRetention extends cdk.Construct {
// Custom resource provider
const provider = new SingletonFunction(this, 'Provider', {
code: Code.asset(path.join(__dirname, 'log-retention-provider')),
runtime: Runtime.NodeJS810,
runtime: Runtime.Nodejs810,
handler: 'index.handler',
uuid: 'aae0aa3c-5b4d-4f87-b02d-85b201efdd8a',
lambdaPurpose: 'LogRetention',
Expand Down
16 changes: 8 additions & 8 deletions packages/@aws-cdk/aws-lambda/lib/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ export class Runtime {
/** A list of all known `Runtime`'s. */
public static readonly All = new Array<Runtime>();

/** @deprecated Use `NodeJS810` or `NodeJS10x` */
public static readonly NodeJS = new Runtime('nodejs', RuntimeFamily.NodeJS, { supportsInlineCode: true });
/** @deprecated Use `NodeJS810` or `NodeJS10x` */
public static readonly NodeJS43 = new Runtime('nodejs4.3', RuntimeFamily.NodeJS, { supportsInlineCode: true });
/** @deprecated Use `NodeJS810` or `NodeJS10x` */
public static readonly NodeJS610 = new Runtime('nodejs6.10', RuntimeFamily.NodeJS, { supportsInlineCode: true });
public static readonly NodeJS810 = new Runtime('nodejs8.10', RuntimeFamily.NodeJS, { supportsInlineCode: true });
public static readonly NodeJS10x = new Runtime('nodejs10.x', RuntimeFamily.NodeJS, { supportsInlineCode: false });
/** @deprecated Use `Nodejs810` or `Nodejs10x` */
public static readonly Nodejs = new Runtime('nodejs', RuntimeFamily.NodeJS, { supportsInlineCode: true });
/** @deprecated Use `Nodejs810` or `Nodejs10x` */
public static readonly Nodejs43 = new Runtime('nodejs4.3', RuntimeFamily.NodeJS, { supportsInlineCode: true });
/** @deprecated Use `Nodejs810` or `Nodejs10x` */
public static readonly Nodejs610 = new Runtime('nodejs6.10', RuntimeFamily.NodeJS, { supportsInlineCode: true });
public static readonly Nodejs810 = new Runtime('nodejs8.10', RuntimeFamily.NodeJS, { supportsInlineCode: true });
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 });
Expand Down
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
Expand Up @@ -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.NodeJS810,
runtime: lambda.Runtime.Nodejs810,
});

fn.addToRolePolicy(new iam.PolicyStatement().addAllResources().addAction('*'));
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.accountId;
/// !show
const layer = new lambda.LayerVersion(stack, 'MyLayer', {
code: lambda.Code.directory(path.join(__dirname, 'layer-code')),
compatibleRuntimes: [lambda.Runtime.NodeJS810],
compatibleRuntimes: [lambda.Runtime.Nodejs810],
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.NodeJS810,
runtime: lambda.Runtime.Nodejs810,
layers: [layer],
});
/// !hide
Expand Down
Loading