diff --git a/packages/@aws-cdk/aws-apigateway/test/integ.restapi.books.ts b/packages/@aws-cdk/aws-apigateway/test/integ.restapi.books.ts index e5d3e3345bed8..fc64709ec26fc 100644 --- a/packages/@aws-cdk/aws-apigateway/test/integ.restapi.books.ts +++ b/packages/@aws-cdk/aws-apigateway/test/integ.restapi.books.ts @@ -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.NODEJS_8_10, 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.NODEJS_8_10, 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.NODEJS_8_10, handler: 'index.handler', code: lambda.Code.inline(`exports.handler = ${helloCode}`) })); diff --git a/packages/@aws-cdk/aws-apigateway/test/integ.restapi.ts b/packages/@aws-cdk/aws-apigateway/test/integ.restapi.ts index aa244f1d45021..2dc0441b0599d 100644 --- a/packages/@aws-cdk/aws-apigateway/test/integ.restapi.ts +++ b/packages/@aws-cdk/aws-apigateway/test/integ.restapi.ts @@ -23,7 +23,7 @@ class Test extends cdk.Stack { }); const handler = new lambda.Function(this, 'MyHandler', { - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, code: lambda.Code.inline(`exports.handler = ${handlerCode}`), handler: 'index.handler', }); diff --git a/packages/@aws-cdk/aws-apigateway/test/test.lambda-api.ts b/packages/@aws-cdk/aws-apigateway/test/test.lambda-api.ts index 9bf1ae57126bb..0314b62e4cb8e 100644 --- a/packages/@aws-cdk/aws-apigateway/test/test.lambda-api.ts +++ b/packages/@aws-cdk/aws-apigateway/test/test.lambda-api.ts @@ -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.NODEJS_8_10, }); // WHEN @@ -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.NODEJS_8_10, }); 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.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, }); // WHEN @@ -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.NODEJS_8_10, }); test.throws(() => new apigw.LambdaRestApi(stack, 'lambda-rest-api', { diff --git a/packages/@aws-cdk/aws-apigateway/test/test.lambda.ts b/packages/@aws-cdk/aws-apigateway/test/test.lambda.ts index 1fae98e3a2cf3..fbcbe381dc714 100644 --- a/packages/@aws-cdk/aws-apigateway/test/test.lambda.ts +++ b/packages/@aws-cdk/aws-apigateway/test/test.lambda.ts @@ -10,7 +10,7 @@ export = { const stack = new cdk.Stack(); const api = new apigateway.RestApi(stack, 'my-api'); const handler = new lambda.Function(stack, 'Handler', { - runtime: lambda.Runtime.Python27, + runtime: lambda.Runtime.PYTHON_2_7, handler: 'boom', code: lambda.Code.inline('foo') }); @@ -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.NODEJS_8_10, 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.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, 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.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, handler: 'index.handler', code: lambda.Code.inline(``) }); diff --git a/packages/@aws-cdk/aws-autoscaling-hooktargets/test/hooks.test.ts b/packages/@aws-cdk/aws-autoscaling-hooktargets/test/hooks.test.ts index d816281a14c76..e74076ffadce7 100644 --- a/packages/@aws-cdk/aws-autoscaling-hooktargets/test/hooks.test.ts +++ b/packages/@aws-cdk/aws-autoscaling-hooktargets/test/hooks.test.ts @@ -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.NODEJS_8_10, handler: 'index.index', }); diff --git a/packages/@aws-cdk/aws-certificatemanager/lib/dns-validated-certificate.ts b/packages/@aws-cdk/aws-certificatemanager/lib/dns-validated-certificate.ts index 9860ce600da7a..8893c3899b896 100644 --- a/packages/@aws-cdk/aws-certificatemanager/lib/dns-validated-certificate.ts +++ b/packages/@aws-cdk/aws-certificatemanager/lib/dns-validated-certificate.ts @@ -50,7 +50,7 @@ export class DnsValidatedCertificate extends cdk.Resource implements ICertificat 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.NODEJS_8_10, timeout: cdk.Duration.minutes(15) }); requestorFunction.addToRolePolicy(new iam.PolicyStatement({ diff --git a/packages/@aws-cdk/aws-cloudformation/lib/aws-custom-resource.ts b/packages/@aws-cdk/aws-cloudformation/lib/aws-custom-resource.ts index 1160e984f0d12..d5a376c25645b 100644 --- a/packages/@aws-cdk/aws-cloudformation/lib/aws-custom-resource.ts +++ b/packages/@aws-cdk/aws-cloudformation/lib/aws-custom-resource.ts @@ -135,7 +135,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.NODEJS_10_X, handler: 'index.handler', uuid: '679f53fa-c002-430c-b0da-5b7982bd2287', lambdaPurpose: 'AWS' diff --git a/packages/@aws-cdk/aws-cloudformation/test/integ.trivial-lambda-resource.ts b/packages/@aws-cdk/aws-cloudformation/test/integ.trivial-lambda-resource.ts index 8b63b1afc79a3..d891e1758c59b 100644 --- a/packages/@aws-cdk/aws-cloudformation/test/integ.trivial-lambda-resource.ts +++ b/packages/@aws-cdk/aws-cloudformation/test/integ.trivial-lambda-resource.ts @@ -28,7 +28,7 @@ class DemoResource extends cdk.Construct { code: new lambda.InlineCode(fs.readFileSync('integ.trivial-lambda-provider.py', { encoding: 'utf-8' })), handler: 'index.main', timeout: cdk.Duration.minutes(5), - runtime: lambda.Runtime.Python27, + runtime: lambda.Runtime.PYTHON_2_7, })), properties: props }); diff --git a/packages/@aws-cdk/aws-cloudformation/test/test.resource.ts b/packages/@aws-cdk/aws-cloudformation/test/test.resource.ts index 980b0eccc1784..f6dcdffc09f11 100644 --- a/packages/@aws-cdk/aws-cloudformation/test/test.resource.ts +++ b/packages/@aws-cdk/aws-cloudformation/test/test.resource.ts @@ -202,7 +202,7 @@ class TestCustomResource extends cdk.Construct { const singletonLambda = new lambda.SingletonFunction(this, 'Lambda', { uuid: 'TestCustomResourceProvider', code: new lambda.InlineCode('def hello(): pass'), - runtime: lambda.Runtime.Python27, + runtime: lambda.Runtime.PYTHON_2_7, handler: 'index.hello', timeout: cdk.Duration.minutes(5), }); diff --git a/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-lambda-association.ts b/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-lambda-association.ts index 73cdca37b0f61..682c1a4dd2705 100644 --- a/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-lambda-association.ts +++ b/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-lambda-association.ts @@ -14,7 +14,7 @@ const sourceBucket = new s3.Bucket(stack, 'Bucket', { const lambdaFunction = new lambda.Function(stack, 'Lambda', { code: lambda.Code.inline('foo'), handler: 'index.handler', - runtime: lambda.Runtime.Nodejs810 + runtime: lambda.Runtime.NODEJS_8_10 }); const lambdaVersion = new lambda.Version(stack, 'LambdaVersion', { diff --git a/packages/@aws-cdk/aws-cloudwatch/lib/graph.ts b/packages/@aws-cdk/aws-cloudwatch/lib/graph.ts index 53b4aec1c8936..6c017e15265ab 100644 --- a/packages/@aws-cdk/aws-cloudwatch/lib/graph.ts +++ b/packages/@aws-cdk/aws-cloudwatch/lib/graph.ts @@ -103,7 +103,7 @@ export class AlarmWidget extends ConcreteWidget { properties: { view: 'timeSeries', title: this.props.title, - region: this.props.region || cdk.Aws.region, + region: this.props.region || cdk.Aws.REGION, annotations: { alarms: [this.props.alarm.alarmArn] }, @@ -176,7 +176,7 @@ export class GraphWidget extends ConcreteWidget { properties: { view: 'timeSeries', title: this.props.title, - region: this.props.region || cdk.Aws.region, + region: this.props.region || cdk.Aws.REGION, metrics: (this.props.left || []).map(m => metricJson(m, 'left')).concat( (this.props.right || []).map(m => metricJson(m, 'right'))), annotations: { @@ -223,7 +223,7 @@ export class SingleValueWidget extends ConcreteWidget { properties: { view: 'singleValue', title: this.props.title, - region: this.props.region || cdk.Aws.region, + region: this.props.region || cdk.Aws.REGION, metrics: this.props.metrics.map(m => metricJson(m, 'left')) } }]; diff --git a/packages/@aws-cdk/aws-codebuild/lib/cache.ts b/packages/@aws-cdk/aws-codebuild/lib/cache.ts index fb6cde55c6081..ac8edfe945840 100644 --- a/packages/@aws-cdk/aws-codebuild/lib/cache.ts +++ b/packages/@aws-cdk/aws-codebuild/lib/cache.ts @@ -63,7 +63,7 @@ export abstract class Cache { return { _toCloudFormation: () => ({ type: 'S3', - location: Fn.join('/', [bucket.bucketName, options && options.prefix || Aws.noValue]) + location: Fn.join('/', [bucket.bucketName, options && options.prefix || Aws.NO_VALUE]) }), _bind: (project) => { bucket.grantReadWrite(project); diff --git a/packages/@aws-cdk/aws-codebuild/lib/project.ts b/packages/@aws-cdk/aws-codebuild/lib/project.ts index aee2638f74dba..91feef13f27ce 100644 --- a/packages/@aws-cdk/aws-codebuild/lib/project.ts +++ b/packages/@aws-cdk/aws-codebuild/lib/project.ts @@ -865,13 +865,13 @@ export class Project extends ProjectBase { } this.role.addToPolicy(new iam.PolicyStatement({ - resources: [`arn:aws:ec2:${Aws.region}:${Aws.accountId}:network-interface/*`], + resources: [`arn:aws:ec2:${Aws.REGION}:${Aws.ACCOUNT_ID}:network-interface/*`], actions: ['ec2:CreateNetworkInterfacePermission'], conditions: { StringEquals: { 'ec2:Subnet': props.vpc .selectSubnets(props.subnetSelection).subnetIds - .map(si => `arn:aws:ec2:${Aws.region}:${Aws.accountId}:subnet/${si}`), + .map(si => `arn:aws:ec2:${Aws.REGION}:${Aws.ACCOUNT_ID}:subnet/${si}`), 'ec2:AuthorizedService': 'codebuild.amazonaws.com' }, }, diff --git a/packages/@aws-cdk/aws-codedeploy/lib/lambda/deployment-config.ts b/packages/@aws-cdk/aws-codedeploy/lib/lambda/deployment-config.ts index 5dd4146c0b8d1..58f338138414a 100644 --- a/packages/@aws-cdk/aws-codedeploy/lib/lambda/deployment-config.ts +++ b/packages/@aws-cdk/aws-codedeploy/lib/lambda/deployment-config.ts @@ -39,15 +39,15 @@ export interface LambdaDeploymentConfigImportProps { * @resource AWS::CodeDeploy::DeploymentConfig */ export class LambdaDeploymentConfig { - public static readonly AllAtOnce = deploymentConfig('CodeDeployDefault.LambdaAllAtOnce'); - public static readonly Canary10Percent30Minutes = deploymentConfig('CodeDeployDefault.LambdaCanary10Percent30Minutes'); - public static readonly Canary10Percent5Minutes = deploymentConfig('CodeDeployDefault.LambdaCanary10Percent5Minutes'); - public static readonly Canary10Percent10Minutes = deploymentConfig('CodeDeployDefault.LambdaCanary10Percent10Minutes'); - public static readonly Canary10Percent15Minutes = deploymentConfig('CodeDeployDefault.LambdaCanary10Percent15Minutes'); - public static readonly Linear10PercentEvery10Minutes = deploymentConfig('CodeDeployDefault.LambdaLinear10PercentEvery10Minutes'); - public static readonly Linear10PercentEvery1Minute = deploymentConfig('CodeDeployDefault.LambdaLinear10PercentEvery1Minute'); - public static readonly Linear10PercentEvery2Minutes = deploymentConfig('CodeDeployDefault.LambdaLinear10PercentEvery2Minutes'); - public static readonly Linear10PercentEvery3Minutes = deploymentConfig('CodeDeployDefault.LambdaLinear10PercentEvery3Minutes'); + public static readonly ALL_AT_ONCE = deploymentConfig('CodeDeployDefault.LambdaAllAtOnce'); + public static readonly CANARY_10PERCENT_30MINUTES = deploymentConfig('CodeDeployDefault.LambdaCanary10Percent30Minutes'); + public static readonly CANARY_10PERCENT_5MINUTES = deploymentConfig('CodeDeployDefault.LambdaCanary10Percent5Minutes'); + public static readonly CANARY_10PERCENT_10MINUTES = deploymentConfig('CodeDeployDefault.LambdaCanary10Percent10Minutes'); + public static readonly CANARY_10PERCENT_15MINUTES = deploymentConfig('CodeDeployDefault.LambdaCanary10Percent15Minutes'); + public static readonly LINEAR_10PERCENT_EVERY_10MINUTES = deploymentConfig('CodeDeployDefault.LambdaLinear10PercentEvery10Minutes'); + public static readonly LINEAR_10PERCENT_EVERY_1MINUTE = deploymentConfig('CodeDeployDefault.LambdaLinear10PercentEvery1Minute'); + public static readonly LINEAR_10PERCENT_EVERY_2MINUTES = deploymentConfig('CodeDeployDefault.LambdaLinear10PercentEvery2Minutes'); + public static readonly LINEAR_10PERCENT_EVERY_3MINUTES = deploymentConfig('CodeDeployDefault.LambdaLinear10PercentEvery3Minutes'); /** * Import a custom Deployment Configuration for a Lambda Deployment Group defined outside the CDK. diff --git a/packages/@aws-cdk/aws-codedeploy/lib/lambda/deployment-group.ts b/packages/@aws-cdk/aws-codedeploy/lib/lambda/deployment-group.ts index d9387332b5d12..876fe2c3645f8 100644 --- a/packages/@aws-cdk/aws-codedeploy/lib/lambda/deployment-group.ts +++ b/packages/@aws-cdk/aws-codedeploy/lib/lambda/deployment-group.ts @@ -159,7 +159,7 @@ export class LambdaDeploymentGroup extends cdk.Resource implements ILambdaDeploy applicationName: this.application.applicationName, serviceRoleArn: this.role.roleArn, deploymentGroupName: this.physicalName, - deploymentConfigName: (props.deploymentConfig || LambdaDeploymentConfig.AllAtOnce).deploymentConfigName, + deploymentConfigName: (props.deploymentConfig || LambdaDeploymentConfig.ALL_AT_ONCE).deploymentConfigName, deploymentStyle: { deploymentType: 'BLUE_GREEN', deploymentOption: 'WITH_TRAFFIC_CONTROL' diff --git a/packages/@aws-cdk/aws-codedeploy/lib/server/deployment-config.ts b/packages/@aws-cdk/aws-codedeploy/lib/server/deployment-config.ts index 3351248eec9dd..f847e665789c2 100644 --- a/packages/@aws-cdk/aws-codedeploy/lib/server/deployment-config.ts +++ b/packages/@aws-cdk/aws-codedeploy/lib/server/deployment-config.ts @@ -79,9 +79,9 @@ export interface ServerDeploymentConfigProps { * @resource AWS::CodeDeploy::DeploymentConfig */ export class ServerDeploymentConfig extends cdk.Resource implements IServerDeploymentConfig { - public static readonly OneAtATime = deploymentConfig('CodeDeployDefault.OneAtATime'); - public static readonly HalfAtATime = deploymentConfig('CodeDeployDefault.HalfAtATime'); - public static readonly AllAtOnce = deploymentConfig('CodeDeployDefault.AllAtOnce'); + public static readonly ONE_AT_A_TIME = deploymentConfig('CodeDeployDefault.OneAtATime'); + public static readonly HALF_AT_A_TIME = deploymentConfig('CodeDeployDefault.HalfAtATime'); + public static readonly ALL_AT_ONCE = deploymentConfig('CodeDeployDefault.AllAtOnce'); /** * Import a custom Deployment Configuration for an EC2/on-premise Deployment Group defined either outside the CDK, diff --git a/packages/@aws-cdk/aws-codedeploy/lib/server/deployment-group.ts b/packages/@aws-cdk/aws-codedeploy/lib/server/deployment-group.ts index 3b4386546029f..98ffe94b0cc4f 100644 --- a/packages/@aws-cdk/aws-codedeploy/lib/server/deployment-group.ts +++ b/packages/@aws-cdk/aws-codedeploy/lib/server/deployment-group.ts @@ -75,7 +75,7 @@ abstract class ServerDeploymentGroupBase extends cdk.Resource implements IServer constructor(scope: cdk.Construct, id: string, deploymentConfig?: IServerDeploymentConfig, props?: cdk.ResourceProps) { super(scope, id, props); - this.deploymentConfig = deploymentConfig || ServerDeploymentConfig.OneAtATime; + this.deploymentConfig = deploymentConfig || ServerDeploymentConfig.ONE_AT_A_TIME; } } diff --git a/packages/@aws-cdk/aws-codedeploy/lib/utils.ts b/packages/@aws-cdk/aws-codedeploy/lib/utils.ts index ed06a4728c968..175f2897b40b6 100644 --- a/packages/@aws-cdk/aws-codedeploy/lib/utils.ts +++ b/packages/@aws-cdk/aws-codedeploy/lib/utils.ts @@ -4,15 +4,15 @@ import { CfnDeploymentGroup } from './codedeploy.generated'; import { AutoRollbackConfig } from './rollback-config'; export function arnForApplication(applicationName: string): string { - return `arn:${Aws.partition}:codedeploy:${Aws.region}:${Aws.accountId}:application:${applicationName}`; + return `arn:${Aws.PARTITION}:codedeploy:${Aws.REGION}:${Aws.ACCOUNT_ID}:application:${applicationName}`; } export function arnForDeploymentGroup(applicationName: string, deploymentGroupName: string): string { - return `arn:${Aws.partition}:codedeploy:${Aws.region}:${Aws.accountId}:deploymentgroup:${applicationName}/${deploymentGroupName}`; + return `arn:${Aws.PARTITION}:codedeploy:${Aws.REGION}:${Aws.ACCOUNT_ID}:deploymentgroup:${applicationName}/${deploymentGroupName}`; } export function arnForDeploymentConfig(name: string): string { - return `arn:${Aws.partition}:codedeploy:${Aws.region}:${Aws.accountId}:deploymentconfig:${name}`; + return `arn:${Aws.PARTITION}:codedeploy:${Aws.REGION}:${Aws.ACCOUNT_ID}:deploymentconfig:${name}`; } export function renderAlarmConfiguration(alarms: cloudwatch.IAlarm[], ignorePollAlarmFailure?: boolean): diff --git a/packages/@aws-cdk/aws-codedeploy/test/lambda/integ.deployment-group.ts b/packages/@aws-cdk/aws-codedeploy/test/lambda/integ.deployment-group.ts index 408648df5463d..00dd32508c571 100644 --- a/packages/@aws-cdk/aws-codedeploy/test/lambda/integ.deployment-group.ts +++ b/packages/@aws-cdk/aws-codedeploy/test/lambda/integ.deployment-group.ts @@ -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.NODEJS_8_10, }); const version = handler.addVersion('1'); const blueGreenAlias = new lambda.Alias(stack, `Alias`, { @@ -22,17 +22,17 @@ 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.NODEJS_8_10 }); 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.NODEJS_8_10 }); new codedeploy.LambdaDeploymentGroup(stack, 'BlueGreenDeployment', { alias: blueGreenAlias, - deploymentConfig: codedeploy.LambdaDeploymentConfig.Linear10PercentEvery1Minute, + deploymentConfig: codedeploy.LambdaDeploymentConfig.LINEAR_10PERCENT_EVERY_1MINUTE, alarms: [ new cloudwatch.Alarm(stack, 'BlueGreenErrors', { comparisonOperator: cloudwatch.ComparisonOperator.GREATER_THAN_THRESHOLD, diff --git a/packages/@aws-cdk/aws-codedeploy/test/lambda/test.deployment-group.ts b/packages/@aws-cdk/aws-codedeploy/test/lambda/test.deployment-group.ts index f175110511ad9..a9095766e7e34 100644 --- a/packages/@aws-cdk/aws-codedeploy/test/lambda/test.deployment-group.ts +++ b/packages/@aws-cdk/aws-codedeploy/test/lambda/test.deployment-group.ts @@ -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.NODEJS_8_10 }); } function mockAlias(stack: cdk.Stack) { @@ -32,7 +32,7 @@ export = { new codedeploy.LambdaDeploymentGroup(stack, 'MyDG', { application, alias, - deploymentConfig: LambdaDeploymentConfig.AllAtOnce + deploymentConfig: LambdaDeploymentConfig.ALL_AT_ONCE }); expect(stack).to(haveResource('AWS::CodeDeploy::DeploymentGroup', { @@ -118,7 +118,7 @@ export = { new codedeploy.LambdaDeploymentGroup(stack, 'MyDG', { application, alias, - deploymentConfig: LambdaDeploymentConfig.AllAtOnce, + deploymentConfig: LambdaDeploymentConfig.ALL_AT_ONCE, deploymentGroupName: 'test', }); @@ -139,7 +139,7 @@ export = { new codedeploy.LambdaDeploymentGroup(stack, 'MyDG', { application, alias, - deploymentConfig: LambdaDeploymentConfig.AllAtOnce, + deploymentConfig: LambdaDeploymentConfig.ALL_AT_ONCE, role: serviceRole }); @@ -177,7 +177,7 @@ export = { new codedeploy.LambdaDeploymentGroup(stack, 'MyDG', { application, alias, - deploymentConfig: LambdaDeploymentConfig.Linear10PercentEvery1Minute + deploymentConfig: LambdaDeploymentConfig.LINEAR_10PERCENT_EVERY_1MINUTE }); expect(stack).to(haveResource('AWS::CodeDeploy::DeploymentGroup', { @@ -212,7 +212,7 @@ export = { new codedeploy.LambdaDeploymentGroup(stack, 'MyDG', { application, alias, - deploymentConfig: codedeploy.LambdaDeploymentConfig.AllAtOnce, + deploymentConfig: codedeploy.LambdaDeploymentConfig.ALL_AT_ONCE, alarms: [new cloudwatch.Alarm(stack, 'Failures', { metric: alias.metricErrors(), comparisonOperator: cloudwatch.ComparisonOperator.GREATER_THAN_THRESHOLD, @@ -247,7 +247,7 @@ export = { const group = new codedeploy.LambdaDeploymentGroup(stack, 'MyDG', { alias, preHook: mockFunction(stack, 'PreHook'), - deploymentConfig: LambdaDeploymentConfig.AllAtOnce + deploymentConfig: LambdaDeploymentConfig.ALL_AT_ONCE }); test.throws(() => group.addPreHook(mockFunction(stack, 'PreHook2'))); test.done(); @@ -258,7 +258,7 @@ export = { const group = new codedeploy.LambdaDeploymentGroup(stack, 'MyDG', { alias, postHook: mockFunction(stack, 'PostHook'), - deploymentConfig: LambdaDeploymentConfig.AllAtOnce + deploymentConfig: LambdaDeploymentConfig.ALL_AT_ONCE }); test.throws(() => group.addPostHook(mockFunction(stack, 'PostHook2'))); test.done(); @@ -271,7 +271,7 @@ export = { application, alias, preHook: mockFunction(stack, 'PreHook'), - deploymentConfig: LambdaDeploymentConfig.AllAtOnce + deploymentConfig: LambdaDeploymentConfig.ALL_AT_ONCE }); expect(stack).to(haveResourceLike('AWS::Lambda::Alias', { @@ -319,7 +319,7 @@ export = { const group = new codedeploy.LambdaDeploymentGroup(stack, 'MyDG', { application, alias, - deploymentConfig: LambdaDeploymentConfig.AllAtOnce + deploymentConfig: LambdaDeploymentConfig.ALL_AT_ONCE }); group.addPreHook(mockFunction(stack, 'PreHook')); @@ -369,7 +369,7 @@ export = { application, alias, postHook: mockFunction(stack, 'PostHook'), - deploymentConfig: LambdaDeploymentConfig.AllAtOnce + deploymentConfig: LambdaDeploymentConfig.ALL_AT_ONCE }); expect(stack).to(haveResourceLike('AWS::Lambda::Alias', { @@ -417,7 +417,7 @@ export = { const group = new codedeploy.LambdaDeploymentGroup(stack, 'MyDG', { application, alias, - deploymentConfig: LambdaDeploymentConfig.AllAtOnce + deploymentConfig: LambdaDeploymentConfig.ALL_AT_ONCE }); group.addPostHook(mockFunction(stack, 'PostHook')); @@ -467,7 +467,7 @@ export = { application, alias, postHook: mockFunction(stack, 'PostHook'), - deploymentConfig: LambdaDeploymentConfig.AllAtOnce, + deploymentConfig: LambdaDeploymentConfig.ALL_AT_ONCE, ignorePollAlarmsFailure: true, alarms: [new cloudwatch.Alarm(stack, 'Failures', { metric: alias.metricErrors(), @@ -499,7 +499,7 @@ export = { application, alias, postHook: mockFunction(stack, 'PostHook'), - deploymentConfig: LambdaDeploymentConfig.AllAtOnce, + deploymentConfig: LambdaDeploymentConfig.ALL_AT_ONCE, autoRollback: { failedDeployment: false } @@ -532,7 +532,7 @@ export = { application, alias, postHook: mockFunction(stack, 'PostHook'), - deploymentConfig: LambdaDeploymentConfig.AllAtOnce, + deploymentConfig: LambdaDeploymentConfig.ALL_AT_ONCE, autoRollback: { stoppedDeployment: true } @@ -558,7 +558,7 @@ export = { application, alias, postHook: mockFunction(stack, 'PostHook'), - deploymentConfig: LambdaDeploymentConfig.AllAtOnce, + deploymentConfig: LambdaDeploymentConfig.ALL_AT_ONCE, autoRollback: { deploymentInAlarm: false }, diff --git a/packages/@aws-cdk/aws-codedeploy/test/server/integ.deployment-group.ts b/packages/@aws-cdk/aws-codedeploy/test/server/integ.deployment-group.ts index 52c71cb1a4be4..c846512f4181b 100644 --- a/packages/@aws-cdk/aws-codedeploy/test/server/integ.deployment-group.ts +++ b/packages/@aws-cdk/aws-codedeploy/test/server/integ.deployment-group.ts @@ -23,7 +23,7 @@ elb.addListener({ }); new codedeploy.ServerDeploymentGroup(stack, 'CodeDeployGroup', { - deploymentConfig: codedeploy.ServerDeploymentConfig.AllAtOnce, + deploymentConfig: codedeploy.ServerDeploymentConfig.ALL_AT_ONCE, autoScalingGroups: [asg], loadBalancer: codedeploy.LoadBalancer.classic(elb), alarms: [ diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-deployed-through-codepipeline.lit.ts b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-deployed-through-codepipeline.lit.ts index 32dd9a5c2a5bc..aa8f35885471d 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-deployed-through-codepipeline.lit.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-deployed-through-codepipeline.lit.ts @@ -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.NODEJS_8_10, }); // other resources that your Lambda needs, added to the lambdaStack... diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-pipeline.ts b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-pipeline.ts index 982a550c42652..898b45ab85504 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-pipeline.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.lambda-pipeline.ts @@ -34,7 +34,7 @@ const lambdaFun = new lambda.Function(stack, 'LambdaFun', { }; `), handler: 'index.handler', - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, }); const lambdaStage = pipeline.addStage({ stageName: 'Lambda' }); lambdaStage.addAction(new cpactions.LambdaInvokeAction({ diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-cfn-wtih-action-role.ts b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-cfn-wtih-action-role.ts index fd5a458adcbaa..75b4f3e59ff28 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-cfn-wtih-action-role.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-cfn-wtih-action-role.ts @@ -26,7 +26,7 @@ const sourceStage = { }; const role = new iam.Role(stack, 'ActionRole', { - assumedBy: new iam.AccountPrincipal(cdk.Aws.accountId) + assumedBy: new iam.AccountPrincipal(cdk.Aws.ACCOUNT_ID) }); role.addToPolicy(new iam.PolicyStatement({ actions: ['sqs:*'], diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/lambda/test.lambda-invoke-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/test/lambda/test.lambda-invoke-action.ts index 737df4a578e10..8c44fe8d86de9 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/lambda/test.lambda-invoke-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/lambda/test.lambda-invoke-action.ts @@ -34,7 +34,7 @@ export = { 'properly resolves any Tokens passed in userParameters'(test: Test) { const stack = stackIncludingLambdaInvokeCodePipeline({ - key: Lazy.stringValue({ produce: () => Aws.region }), + key: Lazy.stringValue({ produce: () => Aws.REGION }), }); expect(stack).to(haveResourceLike('AWS::CodePipeline::Pipeline', { @@ -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.NODEJS_8_10, }), userParameters: userParams, }), diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/test.pipeline.ts b/packages/@aws-cdk/aws-codepipeline-actions/test/test.pipeline.ts index 7a37e4eef7791..82709290c4418 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/test.pipeline.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/test.pipeline.ts @@ -54,7 +54,7 @@ export = { const stack = new Stack(undefined, 'StackName'); new codepipeline.Pipeline(stack, 'Pipeline', { - pipelineName: Aws.stackName, + pipelineName: Aws.STACK_NAME, }); expect(stack, true).to(haveResourceLike('AWS::CodePipeline::Pipeline', { @@ -432,7 +432,7 @@ export = { const lambdaFun = new lambda.Function(stack, 'Function', { code: new lambda.InlineCode('bla'), handler: 'index.handler', - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, }); const pipeline = new codepipeline.Pipeline(stack, 'Pipeline'); diff --git a/packages/@aws-cdk/aws-cognito/test/test.user-pool.ts b/packages/@aws-cdk/aws-cognito/test/test.user-pool.ts index e009fabb58dc2..601eb0d5dde44 100644 --- a/packages/@aws-cdk/aws-cognito/test/test.user-pool.ts +++ b/packages/@aws-cdk/aws-cognito/test/test.user-pool.ts @@ -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.NODEJS_8_10, }); // WHEN @@ -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.NODEJS_8_10, }); // WHEN @@ -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.NODEJS_8_10, }); // WHEN diff --git a/packages/@aws-cdk/aws-config/test/integ.rule.lit.ts b/packages/@aws-cdk/aws-config/test/integ.rule.lit.ts index 4332f24458dca..2433d9887b3be 100644 --- a/packages/@aws-cdk/aws-config/test/integ.rule.lit.ts +++ b/packages/@aws-cdk/aws-config/test/integ.rule.lit.ts @@ -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.NODEJS_8_10 }); const customRule = new config.CustomRule(this, 'Custom', { diff --git a/packages/@aws-cdk/aws-config/test/test.rule.ts b/packages/@aws-cdk/aws-config/test/test.rule.ts index d904b9542d732..f32d10c7c560f 100644 --- a/packages/@aws-cdk/aws-config/test/test.rule.ts +++ b/packages/@aws-cdk/aws-config/test/test.rule.ts @@ -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.NODEJS_8_10 }); // WHEN @@ -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.NODEJS_8_10 }); // WHEN @@ -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.NODEJS_8_10 }); // THEN @@ -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.NODEJS_8_10 }); // WHEN diff --git a/packages/@aws-cdk/aws-dynamodb-global/lib/global-table-coordinator.ts b/packages/@aws-cdk/aws-dynamodb-global/lib/global-table-coordinator.ts index b3ea3abe223a9..b14fa6fff9718 100644 --- a/packages/@aws-cdk/aws-dynamodb-global/lib/global-table-coordinator.ts +++ b/packages/@aws-cdk/aws-dynamodb-global/lib/global-table-coordinator.ts @@ -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.NODEJS_8_10, timeout: cdk.Duration.minutes(5), uuid: "D38B65A6-6B54-4FB6-9BAD-9CD40A6DAC12", }); diff --git a/packages/@aws-cdk/aws-dynamodb/lib/table.ts b/packages/@aws-cdk/aws-dynamodb/lib/table.ts index 4881675e3dfc6..ac14172dd7130 100644 --- a/packages/@aws-cdk/aws-dynamodb/lib/table.ts +++ b/packages/@aws-cdk/aws-dynamodb/lib/table.ts @@ -430,7 +430,7 @@ export class Table extends Resource { actions, resourceArns: [ this.tableArn, - Lazy.stringValue({ produce: () => this.hasIndex ? `${this.tableArn}/index/*` : Aws.noValue }) + Lazy.stringValue({ produce: () => this.hasIndex ? `${this.tableArn}/index/*` : Aws.NO_VALUE }) ], scope: this, }); diff --git a/packages/@aws-cdk/aws-ec2/lib/vpc-endpoint.ts b/packages/@aws-cdk/aws-ec2/lib/vpc-endpoint.ts index aa950c344dc28..df1a1edb3d9c7 100644 --- a/packages/@aws-cdk/aws-ec2/lib/vpc-endpoint.ts +++ b/packages/@aws-cdk/aws-ec2/lib/vpc-endpoint.ts @@ -87,7 +87,7 @@ export interface IGatewayVpcEndpointService { * An AWS service for a gateway VPC endpoint. */ export class GatewayVpcEndpointAwsService implements IGatewayVpcEndpointService { - public static readonly DynamoDb = new GatewayVpcEndpointAwsService('dynamodb'); + public static readonly DYNAMODB = new GatewayVpcEndpointAwsService('dynamodb'); public static readonly S3 = new GatewayVpcEndpointAwsService('s3'); /** @@ -96,7 +96,7 @@ export class GatewayVpcEndpointAwsService implements IGatewayVpcEndpointService public readonly name: string; constructor(name: string, prefix?: string) { - this.name = `${prefix || 'com.amazonaws'}.${Aws.region}.${name}`; + this.name = `${prefix || 'com.amazonaws'}.${Aws.REGION}.${name}`; } } @@ -206,43 +206,43 @@ export interface IInterfaceVpcEndpointService { * An AWS service for an interface VPC endpoint. */ export class InterfaceVpcEndpointAwsService implements IInterfaceVpcEndpointService { - public static readonly SageMakerNotebook = new InterfaceVpcEndpointAwsService('notebook', 'aws.sagemaker'); - public static readonly CloudFormation = new InterfaceVpcEndpointAwsService('cloudformation'); - public static readonly CloudTrail = new InterfaceVpcEndpointAwsService('cloudtrail'); - public static readonly CodeBuild = new InterfaceVpcEndpointAwsService('codebuild'); - public static readonly CodeBuildFips = new InterfaceVpcEndpointAwsService('codebuil-fips'); - public static readonly CodeCommit = new InterfaceVpcEndpointAwsService('codecommit'); - public static readonly CodeCommitFips = new InterfaceVpcEndpointAwsService('codecommit-fips'); - public static readonly CodePipeline = new InterfaceVpcEndpointAwsService('codepipeline'); - public static readonly Config = new InterfaceVpcEndpointAwsService('config'); - public static readonly Ec2 = new InterfaceVpcEndpointAwsService('ec2'); - public static readonly Ec2Messages = new InterfaceVpcEndpointAwsService('ec2messages'); - public static readonly Ecr = new InterfaceVpcEndpointAwsService('ecr.api'); - public static readonly EcrDocker = new InterfaceVpcEndpointAwsService('ecr.dkr'); - public static readonly Ecs = new InterfaceVpcEndpointAwsService('ecs'); - public static readonly EcsAgent = new InterfaceVpcEndpointAwsService('ecs-agent'); - public static readonly EcsTelemetry = new InterfaceVpcEndpointAwsService('ecs-telemetry'); - public static readonly ElasticInferenceRuntime = new InterfaceVpcEndpointAwsService('elastic-inference.runtime'); - public static readonly ElasticLoadBalancing = new InterfaceVpcEndpointAwsService('elasticloadbalancing'); - public static readonly CloudWatchEvents = new InterfaceVpcEndpointAwsService('events'); - public static readonly ApiGateway = new InterfaceVpcEndpointAwsService('execute-api'); - public static readonly CodeCommitGit = new InterfaceVpcEndpointAwsService('git-codecommit'); - public static readonly CodeCommitGitFips = new InterfaceVpcEndpointAwsService('git-codecommit-fips'); - public static readonly KinesisStreams = new InterfaceVpcEndpointAwsService('kinesis-streams'); - public static readonly Kms = new InterfaceVpcEndpointAwsService('kms'); - public static readonly CloudWatchLogs = new InterfaceVpcEndpointAwsService('logs'); - public static readonly CloudWatch = new InterfaceVpcEndpointAwsService('monitoring'); - public static readonly SageMakerApi = new InterfaceVpcEndpointAwsService('sagemaker.api'); - public static readonly SageMakerRuntime = new InterfaceVpcEndpointAwsService('sagemaker.runtime'); - public static readonly SageMakerRuntimeFips = new InterfaceVpcEndpointAwsService('sagemaker.runtime-fips'); - public static readonly SecretsManager = new InterfaceVpcEndpointAwsService('secretsmanager'); - public static readonly ServiceCatalog = new InterfaceVpcEndpointAwsService('servicecatalog'); - public static readonly Sns = new InterfaceVpcEndpointAwsService('sns'); - public static readonly Sqs = new InterfaceVpcEndpointAwsService('sqs'); - public static readonly Ssm = new InterfaceVpcEndpointAwsService('ssm'); - public static readonly SsmMessages = new InterfaceVpcEndpointAwsService('ssmmessages'); - public static readonly Sts = new InterfaceVpcEndpointAwsService('sts'); - public static readonly Transfer = new InterfaceVpcEndpointAwsService('transfer.server'); + public static readonly SAGEMAKER_NOTEBOOK = new InterfaceVpcEndpointAwsService('notebook', 'aws.sagemaker'); + public static readonly CLOUDFORMATION = new InterfaceVpcEndpointAwsService('cloudformation'); + public static readonly CLOUDTRAIL = new InterfaceVpcEndpointAwsService('cloudtrail'); + public static readonly CODEBUILD = new InterfaceVpcEndpointAwsService('codebuild'); + public static readonly CODEBUILD_FIPS = new InterfaceVpcEndpointAwsService('codebuil-fips'); + public static readonly CODECOMMIT = new InterfaceVpcEndpointAwsService('codecommit'); + public static readonly CODECOMMIT_FIPS = new InterfaceVpcEndpointAwsService('codecommit-fips'); + public static readonly CODEPIPELINE = new InterfaceVpcEndpointAwsService('codepipeline'); + public static readonly CONFIG = new InterfaceVpcEndpointAwsService('config'); + public static readonly EC2 = new InterfaceVpcEndpointAwsService('ec2'); + public static readonly EC2_MESSAGES = new InterfaceVpcEndpointAwsService('ec2messages'); + public static readonly ECR = new InterfaceVpcEndpointAwsService('ecr.api'); + public static readonly ECR_DOCKER = new InterfaceVpcEndpointAwsService('ecr.dkr'); + public static readonly ECS = new InterfaceVpcEndpointAwsService('ecs'); + public static readonly ECS_AGENT = new InterfaceVpcEndpointAwsService('ecs-agent'); + public static readonly ECS_TELEMETRY = new InterfaceVpcEndpointAwsService('ecs-telemetry'); + public static readonly ELASTIC_INFERENCE_RUNTIME = new InterfaceVpcEndpointAwsService('elastic-inference.runtime'); + public static readonly ELASTIC_LOAD_BALANCING = new InterfaceVpcEndpointAwsService('elasticloadbalancing'); + public static readonly CLOUDWATCH_EVENTS = new InterfaceVpcEndpointAwsService('events'); + public static readonly APIGATEWAY = new InterfaceVpcEndpointAwsService('execute-api'); + public static readonly CODECOMMIT_GIT = new InterfaceVpcEndpointAwsService('git-codecommit'); + public static readonly CODECOMMIT_GIT_FIPS = new InterfaceVpcEndpointAwsService('git-codecommit-fips'); + public static readonly KINESIS_STREAMS = new InterfaceVpcEndpointAwsService('kinesis-streams'); + public static readonly KMS = new InterfaceVpcEndpointAwsService('kms'); + public static readonly CLOUDWATCH_LOGS = new InterfaceVpcEndpointAwsService('logs'); + public static readonly CLOUDWATCH = new InterfaceVpcEndpointAwsService('monitoring'); + public static readonly SAGEMAKER_API = new InterfaceVpcEndpointAwsService('sagemaker.api'); + public static readonly SAGEMAKER_RUNTIME = new InterfaceVpcEndpointAwsService('sagemaker.runtime'); + public static readonly SAGEMAKER_RUNTIME_FIPS = new InterfaceVpcEndpointAwsService('sagemaker.runtime-fips'); + public static readonly SECRETS_MANAGER = new InterfaceVpcEndpointAwsService('secretsmanager'); + public static readonly SERVICE_CATALOG = new InterfaceVpcEndpointAwsService('servicecatalog'); + public static readonly SNS = new InterfaceVpcEndpointAwsService('sns'); + public static readonly SQS = new InterfaceVpcEndpointAwsService('sqs'); + public static readonly SSM = new InterfaceVpcEndpointAwsService('ssm'); + public static readonly SSM_MESSAGES = new InterfaceVpcEndpointAwsService('ssmmessages'); + public static readonly STS = new InterfaceVpcEndpointAwsService('sts'); + public static readonly TRANSFER = new InterfaceVpcEndpointAwsService('transfer.server'); /** * The name of the service. @@ -255,7 +255,7 @@ export class InterfaceVpcEndpointAwsService implements IInterfaceVpcEndpointServ public readonly port: number; constructor(name: string, prefix?: string, port?: number) { - this.name = `${prefix || 'com.amazonaws'}.${Aws.region}.${name}`; + this.name = `${prefix || 'com.amazonaws'}.${Aws.REGION}.${name}`; this.port = port || 443; } } diff --git a/packages/@aws-cdk/aws-ec2/lib/vpc.ts b/packages/@aws-cdk/aws-ec2/lib/vpc.ts index 73e4c8b2c5615..97ea7b16e14da 100644 --- a/packages/@aws-cdk/aws-ec2/lib/vpc.ts +++ b/packages/@aws-cdk/aws-ec2/lib/vpc.ts @@ -910,7 +910,7 @@ export class Vpc extends VpcBase { */ public addDynamoDbEndpoint(id: string, subnets?: SubnetSelection[]): GatewayVpcEndpoint { return new GatewayVpcEndpoint(this, id, { - service: GatewayVpcEndpointAwsService.DynamoDb, + service: GatewayVpcEndpointAwsService.DYNAMODB, vpc: this, subnets }); diff --git a/packages/@aws-cdk/aws-ec2/test/integ.vpc-endpoint.lit.ts b/packages/@aws-cdk/aws-ec2/test/integ.vpc-endpoint.lit.ts index a35d5276b3acd..6a99ef6437ec7 100644 --- a/packages/@aws-cdk/aws-ec2/test/integ.vpc-endpoint.lit.ts +++ b/packages/@aws-cdk/aws-ec2/test/integ.vpc-endpoint.lit.ts @@ -20,7 +20,7 @@ class VpcEndpointStack extends cdk.Stack { // Alternatively gateway endpoints can be added on the VPC const dynamoDbEndpoint = vpc.addGatewayEndpoint('DynamoDbEndpoint', { - service: ec2.GatewayVpcEndpointAwsService.DynamoDb + service: ec2.GatewayVpcEndpointAwsService.DYNAMODB }); // This allows to customize the endpoint policy @@ -33,7 +33,7 @@ class VpcEndpointStack extends cdk.Stack { // Add an interface endpoint const ecrDockerEndpoint = vpc.addInterfaceEndpoint('EcrDockerEndpoint', { - service: ec2.InterfaceVpcEndpointAwsService.EcrDocker + service: ec2.InterfaceVpcEndpointAwsService.ECR_DOCKER }); // When working with an interface endpoint, use the connections object to diff --git a/packages/@aws-cdk/aws-ec2/test/test.vpc-endpoint.ts b/packages/@aws-cdk/aws-ec2/test/test.vpc-endpoint.ts index 2f612324b883f..d6688fa14917f 100644 --- a/packages/@aws-cdk/aws-ec2/test/test.vpc-endpoint.ts +++ b/packages/@aws-cdk/aws-ec2/test/test.vpc-endpoint.ts @@ -244,7 +244,7 @@ export = { // WHEN vpc.addInterfaceEndpoint('EcrDocker', { - service: InterfaceVpcEndpointAwsService.EcrDocker + service: InterfaceVpcEndpointAwsService.ECR_DOCKER }); // THEN diff --git a/packages/@aws-cdk/aws-ecr-assets/lib/adopted-repository.ts b/packages/@aws-cdk/aws-ecr-assets/lib/adopted-repository.ts index 7a6eca11513a5..208c82540a94a 100644 --- a/packages/@aws-cdk/aws-ecr-assets/lib/adopted-repository.ts +++ b/packages/@aws-cdk/aws-ecr-assets/lib/adopted-repository.ts @@ -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.NODEJS_8_10, lambdaPurpose: 'AdoptEcrRepository', handler: 'handler.handler', code: lambda.Code.asset(path.join(__dirname, 'adopt-repository')), diff --git a/packages/@aws-cdk/aws-ecs/lib/drain-hook/instance-drain-hook.ts b/packages/@aws-cdk/aws-ecs/lib/drain-hook/instance-drain-hook.ts index 1b908568810bf..dc1132b92c866 100644 --- a/packages/@aws-cdk/aws-ecs/lib/drain-hook/instance-drain-hook.ts +++ b/packages/@aws-cdk/aws-ecs/lib/drain-hook/instance-drain-hook.ts @@ -48,7 +48,7 @@ export class InstanceDrainHook extends cdk.Construct { const fn = new lambda.Function(this, 'Function', { code: lambda.Code.inline(fs.readFileSync(path.join(__dirname, 'lambda-source', 'index.py'), { encoding: 'utf-8' })), handler: 'index.lambda_handler', - runtime: lambda.Runtime.Python36, + runtime: lambda.Runtime.PYTHON_3_6, // Timeout: some extra margin for additional API calls made by the Lambda, // up to a maximum of 15 minutes. timeout: cdk.Duration.seconds(Math.min(drainTime.toSeconds() + 10, 900)), diff --git a/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-service.ts b/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-service.ts index b851d3d58fb80..6d5b69f8e5a39 100644 --- a/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-service.ts +++ b/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-service.ts @@ -212,27 +212,27 @@ export class BuiltInAttributes { /** * The Instance ID of the instance */ - public static readonly InstanceId = 'instanceId'; + public static readonly INSTANCE_ID = 'instanceId'; /** * The AZ where the instance is running */ - public static readonly AvailabilityZone = 'attribute:ecs.availability-zone'; + public static readonly AVAILABILITY_ZONE = 'attribute:ecs.availability-zone'; /** * The AMI ID of the instance */ - public static readonly AmiId = 'attribute:ecs.ami-id'; + public static readonly AMI_ID = 'attribute:ecs.ami-id'; /** * The instance type */ - public static readonly InstanceType = 'attribute:ecs.instance-type'; + public static readonly INSTANCE_TYPE = 'attribute:ecs.instance-type'; /** * The OS type * * Either 'linux' or 'windows'. */ - public static readonly OsType = 'attribute:ecs.os-type'; + public static readonly OS_TYPE = 'attribute:ecs.os-type'; } diff --git a/packages/@aws-cdk/aws-ecs/lib/placement.ts b/packages/@aws-cdk/aws-ecs/lib/placement.ts index 05477b89e5fba..317f6527d7dff 100644 --- a/packages/@aws-cdk/aws-ecs/lib/placement.ts +++ b/packages/@aws-cdk/aws-ecs/lib/placement.ts @@ -26,7 +26,7 @@ export class PlacementStrategy { * Try to place tasks spread across instances */ public static spreadAcrossInstances() { - return new PlacementStrategy([{ type: 'spread', field: BuiltInAttributes.InstanceId }]); + return new PlacementStrategy([{ type: 'spread', field: BuiltInAttributes.INSTANCE_ID }]); } /** diff --git a/packages/@aws-cdk/aws-ecs/test/ec2/test.ec2-service.ts b/packages/@aws-cdk/aws-ecs/test/ec2/test.ec2-service.ts index 25dcbf13e4c2a..c71ae066b5a4e 100644 --- a/packages/@aws-cdk/aws-ecs/test/ec2/test.ec2-service.ts +++ b/packages/@aws-cdk/aws-ecs/test/ec2/test.ec2-service.ts @@ -415,7 +415,7 @@ export = { taskDefinition }); - service.addPlacementStrategies(PlacementStrategy.spreadAcross(BuiltInAttributes.AvailabilityZone)); + service.addPlacementStrategies(PlacementStrategy.spreadAcross(BuiltInAttributes.AVAILABILITY_ZONE)); // THEN expect(stack).to(haveResource("AWS::ECS::Service", { @@ -449,7 +449,7 @@ export = { // THEN test.throws(() => { - service.addPlacementStrategies(PlacementStrategy.spreadAcross(BuiltInAttributes.AvailabilityZone)); + service.addPlacementStrategies(PlacementStrategy.spreadAcross(BuiltInAttributes.AVAILABILITY_ZONE)); }); test.done(); diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/imported.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/imported.ts index f94898074cca7..f3043cbc2f494 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/imported.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/imported.ts @@ -24,6 +24,6 @@ export abstract class ImportedTargetGroupBase extends cdk.Construct implements I super(scope, id); this.targetGroupArn = props.targetGroupArn; - this.loadBalancerArns = props.loadBalancerArns || cdk.Aws.noValue; + this.loadBalancerArns = props.loadBalancerArns || cdk.Aws.NO_VALUE; } } diff --git a/packages/@aws-cdk/aws-events-targets/test/lambda/integ.events.ts b/packages/@aws-cdk/aws-events-targets/test/lambda/integ.events.ts index 6b6b5708cef45..3ecb79f1f4950 100644 --- a/packages/@aws-cdk/aws-events-targets/test/lambda/integ.events.ts +++ b/packages/@aws-cdk/aws-events-targets/test/lambda/integ.events.ts @@ -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.NODEJS_8_10, handler: 'index.handler', code: lambda.Code.inline(`exports.handler = ${handler.toString()}`) }); diff --git a/packages/@aws-cdk/aws-events-targets/test/lambda/lambda.test.ts b/packages/@aws-cdk/aws-events-targets/test/lambda/lambda.test.ts index ff7e41837b526..b2696f39e486d 100644 --- a/packages/@aws-cdk/aws-events-targets/test/lambda/lambda.test.ts +++ b/packages/@aws-cdk/aws-events-targets/test/lambda/lambda.test.ts @@ -61,6 +61,6 @@ function newTestLambda(scope: cdk.Construct) { return new lambda.Function(scope, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'bar', - runtime: lambda.Runtime.Python27 + runtime: lambda.Runtime.PYTHON_2_7 }); } diff --git a/packages/@aws-cdk/aws-glue/lib/data-format.ts b/packages/@aws-cdk/aws-glue/lib/data-format.ts index db95b25133ff9..a6c51b0aa4e22 100644 --- a/packages/@aws-cdk/aws-glue/lib/data-format.ts +++ b/packages/@aws-cdk/aws-glue/lib/data-format.ts @@ -9,7 +9,7 @@ export class InputFormat { * * @see https://hadoop.apache.org/docs/stable/api/org/apache/hadoop/mapred/TextInputFormat.html */ - public static readonly TextInputFormat = new InputFormat('org.apache.hadoop.mapred.TextInputFormat'); + public static readonly TEXT_INPUT_FORMAT = new InputFormat('org.apache.hadoop.mapred.TextInputFormat'); constructor(public readonly className: string) {} } @@ -23,7 +23,7 @@ export class OutputFormat { * * @see https://hive.apache.org/javadocs/r2.2.0/api/org/apache/hadoop/hive/ql/io/HiveIgnoreKeyTextOutputFormat.html */ - public static readonly HiveIgnoreKeyTextOutputFormat = new OutputFormat('org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'); + public static readonly HIVE_IGNORE_KEY_TEXT_OUTPUT_FORMAT = new OutputFormat('org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'); constructor(public readonly className: string) {} } @@ -37,12 +37,12 @@ export class SerializationLibrary { /** * @see https://cwiki.apache.org/confluence/display/Hive/LanguageManual+DDL#LanguageManualDDL-JSON */ - public static readonly HiveJson = new SerializationLibrary('org.apache.hive.hcatalog.data.JsonSerDe'); + public static readonly HIVE_JSON = new SerializationLibrary('org.apache.hive.hcatalog.data.JsonSerDe'); /** * @see https://github.com/rcongiu/Hive-JSON-Serde */ - public static readonly OpenXJson = new SerializationLibrary('org.openx.data.jsonserde.JsonSerDe'); + public static readonly OPENX_JSON = new SerializationLibrary('org.openx.data.jsonserde.JsonSerDe'); constructor(public readonly className: string) {} } @@ -76,8 +76,8 @@ export namespace DataFormat { * @see https://docs.aws.amazon.com/athena/latest/ug/json.html */ export const Json: DataFormat = { - inputFormat: InputFormat.TextInputFormat, - outputFormat: OutputFormat.HiveIgnoreKeyTextOutputFormat, - serializationLibrary: SerializationLibrary.OpenXJson + inputFormat: InputFormat.TEXT_INPUT_FORMAT, + outputFormat: OutputFormat.HIVE_IGNORE_KEY_TEXT_OUTPUT_FORMAT, + serializationLibrary: SerializationLibrary.OPENX_JSON }; } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-glue/lib/schema.ts b/packages/@aws-cdk/aws-glue/lib/schema.ts index cbbad9a50c974..a14ee1b4f38d1 100644 --- a/packages/@aws-cdk/aws-glue/lib/schema.ts +++ b/packages/@aws-cdk/aws-glue/lib/schema.ts @@ -39,12 +39,12 @@ export interface Type { * @see https://docs.aws.amazon.com/athena/latest/ug/data-types.html */ export class Schema { - public static readonly boolean: Type = { + public static readonly BOOLEAN: Type = { isPrimitive: true, inputString: 'boolean' }; - public static readonly binary: Type = { + public static readonly BINARY: Type = { isPrimitive: true, inputString: 'binary' }; @@ -52,17 +52,17 @@ export class Schema { /** * A 64-bit signed INTEGER in two’s complement format, with a minimum value of -2^63 and a maximum value of 2^63-1. */ - public static readonly bigint: Type = { + public static readonly BIG_INT: Type = { isPrimitive: true, inputString: 'bigint' }; - public static readonly double: Type = { + public static readonly DOUBLE: Type = { isPrimitive: true, inputString: 'double' }; - public static readonly float: Type = { + public static readonly FLOAT: Type = { isPrimitive: true, inputString: 'float' }; @@ -70,7 +70,7 @@ export class Schema { /** * A 32-bit signed INTEGER in two’s complement format, with a minimum value of -2^31 and a maximum value of 2^31-1. */ - public static readonly integer: Type = { + public static readonly INTEGER: Type = { isPrimitive: true, inputString: 'int' }; @@ -78,7 +78,7 @@ export class Schema { /** * A 16-bit signed INTEGER in two’s complement format, with a minimum value of -2^15 and a maximum value of 2^15-1. */ - public static readonly smallint: Type = { + public static readonly SMALL_INT: Type = { isPrimitive: true, inputString: 'smallint' }; @@ -86,7 +86,7 @@ export class Schema { /** * A 8-bit signed INTEGER in two’s complement format, with a minimum value of -2^7 and a maximum value of 2^7-1 */ - public static readonly tinyint: Type = { + public static readonly TINY_INT: Type = { isPrimitive: true, inputString: 'tinyint' }; @@ -94,7 +94,7 @@ export class Schema { /** * Date type. */ - public static readonly date: Type = { + public static readonly DATE: Type = { isPrimitive: true, inputString: 'date' }; @@ -102,7 +102,7 @@ export class Schema { /** * Timestamp type (date and time). */ - public static readonly timestamp: Type = { + public static readonly TIMESTAMP: Type = { isPrimitive: true, inputString: 'timestamp' }; @@ -110,7 +110,7 @@ export class Schema { /** * Arbitrary-length string type. */ - public static readonly string: Type = { + public static readonly STRING: Type = { isPrimitive: true, inputString: 'string' }; diff --git a/packages/@aws-cdk/aws-glue/test/integ.table.ts b/packages/@aws-cdk/aws-glue/test/integ.table.ts index f6c96477d4fa2..c6905076cadb3 100644 --- a/packages/@aws-cdk/aws-glue/test/integ.table.ts +++ b/packages/@aws-cdk/aws-glue/test/integ.table.ts @@ -17,27 +17,27 @@ const ordinaryTable = new glue.Table(stack, 'MyTable', { tableName: 'my_table', columns: [{ name: 'col1', - type: glue.Schema.string + type: glue.Schema.STRING }, { name: 'col2', - type: glue.Schema.string, + type: glue.Schema.STRING, comment: 'col2 comment' }, { name: 'col3', - type: glue.Schema.array(glue.Schema.string) + type: glue.Schema.array(glue.Schema.STRING) }, { name: 'col4', - type: glue.Schema.map(glue.Schema.string, glue.Schema.string) + type: glue.Schema.map(glue.Schema.STRING, glue.Schema.STRING) }, { name: 'col5', type: glue.Schema.struct([{ name: 'col1', - type: glue.Schema.string + type: glue.Schema.STRING }]) }], partitionKeys: [{ name: 'year', - type: glue.Schema.smallint + type: glue.Schema.SMALL_INT }], dataFormat: glue.DataFormat.Json }); @@ -47,27 +47,27 @@ const encryptedTable = new glue.Table(stack, 'MyEncryptedTable', { tableName: 'my_encrypted_table', columns: [{ name: 'col1', - type: glue.Schema.string + type: glue.Schema.STRING }, { name: 'col2', - type: glue.Schema.string, + type: glue.Schema.STRING, comment: 'col2 comment' }, { name: 'col3', - type: glue.Schema.array(glue.Schema.string) + type: glue.Schema.array(glue.Schema.STRING) }, { name: 'col4', - type: glue.Schema.map(glue.Schema.string, glue.Schema.string) + type: glue.Schema.map(glue.Schema.STRING, glue.Schema.STRING) }, { name: 'col5', type: glue.Schema.struct([{ name: 'col1', - type: glue.Schema.string + type: glue.Schema.STRING }]) }], partitionKeys: [{ name: 'year', - type: glue.Schema.smallint + type: glue.Schema.SMALL_INT }], dataFormat: glue.DataFormat.Json, encryption: glue.TableEncryption.KMS, diff --git a/packages/@aws-cdk/aws-glue/test/test.schema.ts b/packages/@aws-cdk/aws-glue/test/test.schema.ts index c333eb780cc1b..5158420c9c0d2 100644 --- a/packages/@aws-cdk/aws-glue/test/test.schema.ts +++ b/packages/@aws-cdk/aws-glue/test/test.schema.ts @@ -4,50 +4,50 @@ import { Schema } from '../lib'; export = { 'boolean type'(test: Test) { - test.equals(Schema.boolean.inputString, 'boolean'); - test.equals(Schema.boolean.isPrimitive, true); + test.equals(Schema.BOOLEAN.inputString, 'boolean'); + test.equals(Schema.BOOLEAN.isPrimitive, true); test.done(); }, 'binary type'(test: Test) { - test.equals(Schema.binary.inputString, 'binary'); - test.equals(Schema.binary.isPrimitive, true); + test.equals(Schema.BINARY.inputString, 'binary'); + test.equals(Schema.BINARY.isPrimitive, true); test.done(); }, 'bigint type'(test: Test) { - test.equals(Schema.bigint.inputString, 'bigint'); - test.equals(Schema.bigint.isPrimitive, true); + test.equals(Schema.BIG_INT.inputString, 'bigint'); + test.equals(Schema.BIG_INT.isPrimitive, true); test.done(); }, 'double type'(test: Test) { - test.equals(Schema.double.inputString, 'double'); - test.equals(Schema.double.isPrimitive, true); + test.equals(Schema.DOUBLE.inputString, 'double'); + test.equals(Schema.DOUBLE.isPrimitive, true); test.done(); }, 'float type'(test: Test) { - test.equals(Schema.float.inputString, 'float'); - test.equals(Schema.float.isPrimitive, true); + test.equals(Schema.FLOAT.inputString, 'float'); + test.equals(Schema.FLOAT.isPrimitive, true); test.done(); }, 'integer type'(test: Test) { - test.equals(Schema.integer.inputString, 'int'); - test.equals(Schema.integer.isPrimitive, true); + test.equals(Schema.INTEGER.inputString, 'int'); + test.equals(Schema.INTEGER.isPrimitive, true); test.done(); }, 'smallint type'(test: Test) { - test.equals(Schema.smallint.inputString, 'smallint'); - test.equals(Schema.smallint.isPrimitive, true); + test.equals(Schema.SMALL_INT.inputString, 'smallint'); + test.equals(Schema.SMALL_INT.isPrimitive, true); test.done(); }, 'tinyint type'(test: Test) { - test.equals(Schema.tinyint.inputString, 'tinyint'); - test.equals(Schema.tinyint.isPrimitive, true); + test.equals(Schema.TINY_INT.inputString, 'tinyint'); + test.equals(Schema.TINY_INT.isPrimitive, true); test.done(); }, @@ -61,20 +61,20 @@ export = { // TODO: decimal bounds 'date type'(test: Test) { - test.equals(Schema.date.inputString, 'date'); - test.equals(Schema.date.isPrimitive, true); + test.equals(Schema.DATE.inputString, 'date'); + test.equals(Schema.DATE.isPrimitive, true); test.done(); }, 'timestamp type'(test: Test) { - test.equals(Schema.timestamp.inputString, 'timestamp'); - test.equals(Schema.timestamp.isPrimitive, true); + test.equals(Schema.TIMESTAMP.inputString, 'timestamp'); + test.equals(Schema.TIMESTAMP.isPrimitive, true); test.done(); }, 'string type'(test: Test) { - test.equals(Schema.string.inputString, 'string'); - test.equals(Schema.string.isPrimitive, true); + test.equals(Schema.STRING.inputString, 'string'); + test.equals(Schema.STRING.isPrimitive, true); test.done(); }, @@ -117,7 +117,7 @@ export = { }, 'array'(test: Test) { - const type = Schema.array(Schema.string); + const type = Schema.array(Schema.STRING); test.equals(type.inputString, 'array'); test.equals(type.isPrimitive, false); test.done(); @@ -132,7 +132,7 @@ export = { 'array'(test: Test) { const type = Schema.array( - Schema.array(Schema.string)); + Schema.array(Schema.STRING)); test.equals(type.inputString, 'array>'); test.equals(type.isPrimitive, false); test.done(); @@ -140,7 +140,7 @@ export = { 'array'(test: Test) { const type = Schema.array( - Schema.map(Schema.string, Schema.string)); + Schema.map(Schema.STRING, Schema.STRING)); test.equals(type.inputString, 'array>'); test.equals(type.isPrimitive, false); test.done(); @@ -150,7 +150,7 @@ export = { const type = Schema.array( Schema.struct([{ name: 'key', - type: Schema.string + type: Schema.STRING }])); test.equals(type.inputString, 'array>'); test.equals(type.isPrimitive, false); @@ -159,8 +159,8 @@ export = { 'map'(test: Test) { const type = Schema.map( - Schema.string, - Schema.string + Schema.STRING, + Schema.STRING ); test.equals(type.inputString, 'map'); test.equals(type.isPrimitive, false); @@ -169,8 +169,8 @@ export = { 'map'(test: Test) { const type = Schema.map( - Schema.integer, - Schema.string + Schema.INTEGER, + Schema.STRING ); test.equals(type.inputString, 'map'); test.equals(type.isPrimitive, false); @@ -190,7 +190,7 @@ export = { 'map'(test: Test) { const type = Schema.map( Schema.char(1), - Schema.array(Schema.string) + Schema.array(Schema.STRING) ); test.equals(type.inputString, 'map>'); test.equals(type.isPrimitive, false); @@ -201,8 +201,8 @@ export = { const type = Schema.map( Schema.char(1), Schema.map( - Schema.string, - Schema.string) + Schema.STRING, + Schema.STRING) ); test.equals(type.inputString, 'map>'); test.equals(type.isPrimitive, false); @@ -214,7 +214,7 @@ export = { Schema.char(1), Schema.struct([{ name: 'key', - type: Schema.string + type: Schema.STRING }]) ); test.equals(type.inputString, 'map>'); @@ -224,19 +224,19 @@ export = { 'map throws if keyType is non-primitive'(test: Test) { test.throws(() => Schema.map( - Schema.array(Schema.string), - Schema.string + Schema.array(Schema.STRING), + Schema.STRING )); test.throws(() => Schema.map( - Schema.map(Schema.string, Schema.string), - Schema.string + Schema.map(Schema.STRING, Schema.STRING), + Schema.STRING )); test.throws(() => Schema.map( Schema.struct([{ name: 'key', - type: Schema.string + type: Schema.STRING }]), - Schema.string + Schema.STRING )); test.done(); }, @@ -244,22 +244,22 @@ export = { 'struct type'(test: Test) { const type = Schema.struct([{ name: 'primitive', - type: Schema.string + type: Schema.STRING }, { name: 'with_comment', - type: Schema.string, + type: Schema.STRING, comment: 'this has a comment' }, { name: 'array', - type: Schema.array(Schema.string) + type: Schema.array(Schema.STRING) }, { name: 'map', - type: Schema.map(Schema.string, Schema.string) + type: Schema.map(Schema.STRING, Schema.STRING) }, { name: 'nested_struct', type: Schema.struct([{ name: 'nested', - type: Schema.string, + type: Schema.STRING, comment: 'nested comment' }]) }]); diff --git a/packages/@aws-cdk/aws-glue/test/test.table.ts b/packages/@aws-cdk/aws-glue/test/test.table.ts index e49f09ffb9da5..3b2a4cfecefae 100644 --- a/packages/@aws-cdk/aws-glue/test/test.table.ts +++ b/packages/@aws-cdk/aws-glue/test/test.table.ts @@ -20,7 +20,7 @@ export = { tableName: 'table', columns: [{ name: 'col', - type: glue.Schema.string + type: glue.Schema.STRING }], dataFormat: glue.DataFormat.Json, }); @@ -91,11 +91,11 @@ export = { tableName: 'table', columns: [{ name: 'col', - type: glue.Schema.string + type: glue.Schema.STRING }], partitionKeys: [{ name: 'year', - type: glue.Schema.smallint + type: glue.Schema.SMALL_INT }], dataFormat: glue.DataFormat.Json, }); @@ -167,7 +167,7 @@ export = { tableName: 'table', columns: [{ name: 'col', - type: glue.Schema.string + type: glue.Schema.STRING }], compressed: true, dataFormat: glue.DataFormat.Json, @@ -234,7 +234,7 @@ export = { tableName: 'table', columns: [{ name: 'col', - type: glue.Schema.string + type: glue.Schema.STRING }], encryption: glue.TableEncryption.S3_MANAGED, dataFormat: glue.DataFormat.Json, @@ -313,7 +313,7 @@ export = { tableName: 'table', columns: [{ name: 'col', - type: glue.Schema.string + type: glue.Schema.STRING }], encryption: glue.TableEncryption.KMS, dataFormat: glue.DataFormat.Json, @@ -443,7 +443,7 @@ export = { tableName: 'table', columns: [{ name: 'col', - type: glue.Schema.string + type: glue.Schema.STRING }], encryption: glue.TableEncryption.KMS, encryptionKey, @@ -573,7 +573,7 @@ export = { tableName: 'table', columns: [{ name: 'col', - type: glue.Schema.string + type: glue.Schema.STRING }], encryption: glue.TableEncryption.KMS_MANAGED, dataFormat: glue.DataFormat.Json, @@ -652,7 +652,7 @@ export = { tableName: 'table', columns: [{ name: 'col', - type: glue.Schema.string + type: glue.Schema.STRING }], encryption: glue.TableEncryption.CLIENT_SIDE_KMS, dataFormat: glue.DataFormat.Json, @@ -764,7 +764,7 @@ export = { tableName: 'table', columns: [{ name: 'col', - type: glue.Schema.string + type: glue.Schema.STRING }], encryption: glue.TableEncryption.CLIENT_SIDE_KMS, encryptionKey, @@ -878,7 +878,7 @@ export = { tableName: 'table', columns: [{ name: 'col', - type: glue.Schema.string + type: glue.Schema.STRING }], bucket, encryption: glue.TableEncryption.CLIENT_SIDE_KMS, @@ -997,7 +997,7 @@ export = { tableName: 'table', columns: [{ name: 'col', - type: glue.Schema.string + type: glue.Schema.STRING }], dataFormat: glue.DataFormat.Json, }); @@ -1062,7 +1062,7 @@ export = { tableName: 'table', columns: [{ name: 'col', - type: glue.Schema.string + type: glue.Schema.STRING }], compressed: true, dataFormat: glue.DataFormat.Json, @@ -1168,7 +1168,7 @@ export = { tableName: 'table', columns: [{ name: 'col', - type: glue.Schema.string + type: glue.Schema.STRING }], compressed: true, dataFormat: glue.DataFormat.Json, @@ -1272,7 +1272,7 @@ export = { tableName: 'table', columns: [{ name: 'col', - type: glue.Schema.string + type: glue.Schema.STRING }], compressed: true, dataFormat: glue.DataFormat.Json, @@ -1393,10 +1393,10 @@ export = { tableName: 'name', columns: [{ name: 'col1', - type: glue.Schema.string + type: glue.Schema.STRING }, { name: 'col1', - type: glue.Schema.string + type: glue.Schema.STRING }] }); }, undefined, "column names and partition keys must be unique, but 'col1' is duplicated."); @@ -1409,14 +1409,14 @@ export = { tableName: 'name', columns: [{ name: 'col1', - type: glue.Schema.string + type: glue.Schema.STRING }], partitionKeys: [{ name: 'p1', - type: glue.Schema.string + type: glue.Schema.STRING }, { name: 'p1', - type: glue.Schema.string + type: glue.Schema.STRING }] }), undefined, "column names and partition keys must be unique, but 'p1' is duplicated"); @@ -1428,11 +1428,11 @@ export = { tableName: 'name', columns: [{ name: 'col1', - type: glue.Schema.string + type: glue.Schema.STRING }], partitionKeys: [{ name: 'col1', - type: glue.Schema.string + type: glue.Schema.STRING }] }), "column names and partition keys must be unique, but 'col1' is duplicated"); @@ -1444,7 +1444,7 @@ export = { tableName: 'name', columns: [{ name: 'col1', - type: glue.Schema.string + type: glue.Schema.STRING }], bucket: new s3.Bucket(new cdk.Stack(), 'Bucket'), encryption: glue.TableEncryption.KMS @@ -1457,7 +1457,7 @@ export = { tableName: 'name', columns: [{ name: 'col1', - type: glue.Schema.string + type: glue.Schema.STRING }], bucket: new s3.Bucket(new cdk.Stack(), 'Bucket'), encryption: undefined @@ -1470,7 +1470,7 @@ export = { tableName: 'name', columns: [{ name: 'col1', - type: glue.Schema.string + type: glue.Schema.STRING }], bucket: new s3.Bucket(new cdk.Stack(), 'Bucket'), encryption: undefined @@ -1483,7 +1483,7 @@ export = { tableName: 'name', columns: [{ name: 'col1', - type: glue.Schema.string + type: glue.Schema.STRING }], bucket: new s3.Bucket(new cdk.Stack(), 'Bucket'), encryption: glue.TableEncryption.CLIENT_SIDE_KMS diff --git a/packages/@aws-cdk/aws-lambda-event-sources/test/test-function.ts b/packages/@aws-cdk/aws-lambda-event-sources/test/test-function.ts index 242c6a2696074..498ad846e9b02 100644 --- a/packages/@aws-cdk/aws-lambda-event-sources/test/test-function.ts +++ b/packages/@aws-cdk/aws-lambda-event-sources/test/test-function.ts @@ -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.NODEJS_8_10 }); } } diff --git a/packages/@aws-cdk/aws-lambda-event-sources/test/test.api.ts b/packages/@aws-cdk/aws-lambda-event-sources/test/test.api.ts index a24bba25890ce..ab9947fcf98c5 100644 --- a/packages/@aws-cdk/aws-lambda-event-sources/test/test.api.ts +++ b/packages/@aws-cdk/aws-lambda-event-sources/test/test.api.ts @@ -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 @@ -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 @@ -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 diff --git a/packages/@aws-cdk/aws-lambda/lib/layers.ts b/packages/@aws-cdk/aws-lambda/lib/layers.ts index da6c28cc4736b..5ca09c0b6889d 100644 --- a/packages/@aws-cdk/aws-lambda/lib/layers.ts +++ b/packages/@aws-cdk/aws-lambda/lib/layers.ts @@ -131,7 +131,7 @@ export class LayerVersion extends LayerVersionBase { public static fromLayerVersionArn(scope: Construct, id: string, layerVersionArn: string): ILayerVersion { return LayerVersion.fromLayerVersionAttributes(scope, id, { layerVersionArn, - compatibleRuntimes: Runtime.All + compatibleRuntimes: Runtime.ALL }); } diff --git a/packages/@aws-cdk/aws-lambda/lib/log-retention.ts b/packages/@aws-cdk/aws-lambda/lib/log-retention.ts index f5f3a9ddf5f30..35731afd8a11f 100644 --- a/packages/@aws-cdk/aws-lambda/lib/log-retention.ts +++ b/packages/@aws-cdk/aws-lambda/lib/log-retention.ts @@ -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.NODEJS_8_10, handler: 'index.handler', uuid: 'aae0aa3c-5b4d-4f87-b02d-85b201efdd8a', lambdaPurpose: 'LogRetention', diff --git a/packages/@aws-cdk/aws-lambda/lib/runtime.ts b/packages/@aws-cdk/aws-lambda/lib/runtime.ts index 0b5ad65b21e75..fb11823582bc7 100644 --- a/packages/@aws-cdk/aws-lambda/lib/runtime.ts +++ b/packages/@aws-cdk/aws-lambda/lib/runtime.ts @@ -24,27 +24,27 @@ export enum RuntimeFamily { */ export class Runtime { /** A list of all known `Runtime`'s. */ - public static readonly All = new Array(); + public static readonly ALL = new Array(); /** @deprecated Use `Nodejs810` or `Nodejs10x` */ - public static readonly Nodejs = new Runtime('nodejs', RuntimeFamily.NODEJS, { supportsInlineCode: true }); + 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 }); + public static readonly NODEJS_4_3 = 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 }); - public static readonly Java8 = new Runtime('java8', RuntimeFamily.JAVA); - public static readonly DotNetCore1 = new Runtime('dotnetcore1.0', RuntimeFamily.DOTNET_CORE); + public static readonly NODEJS_6_10 = new Runtime('nodejs6.10', RuntimeFamily.NODEJS, { supportsInlineCode: true }); + public static readonly NODEJS_8_10 = new Runtime('nodejs8.10', RuntimeFamily.NODEJS, { supportsInlineCode: true }); + public static readonly NODEJS_10_X = new Runtime('nodejs10.x', RuntimeFamily.NODEJS, { supportsInlineCode: false }); + public static readonly PYTHON_2_7 = new Runtime('python2.7', RuntimeFamily.PYTHON, { supportsInlineCode: true }); + public static readonly PYTHON_3_6 = new Runtime('python3.6', RuntimeFamily.PYTHON, { supportsInlineCode: true }); + public static readonly PYTHON_3_7 = new Runtime('python3.7', RuntimeFamily.PYTHON, { supportsInlineCode: true }); + public static readonly JAVA_8 = new Runtime('java8', RuntimeFamily.JAVA); + public static readonly DOTNET_CORE_1 = new Runtime('dotnetcore1.0', RuntimeFamily.DOTNET_CORE); /** @deprecated Use `DotNetCore21` */ - public static readonly DotNetCore2 = new Runtime('dotnetcore2.0', RuntimeFamily.DOTNET_CORE); - public static readonly DotNetCore21 = new Runtime('dotnetcore2.1', RuntimeFamily.DOTNET_CORE); - public static readonly Go1x = new Runtime('go1.x', RuntimeFamily.GO); - public static readonly Ruby25 = new Runtime('ruby2.5', RuntimeFamily.RUBY, { supportsInlineCode: true }); - public static readonly Provided = new Runtime('provided', RuntimeFamily.OTHER); + public static readonly DOTNET_CORE_2 = new Runtime('dotnetcore2.0', RuntimeFamily.DOTNET_CORE); + public static readonly DOTNET_CORE_2_1 = new Runtime('dotnetcore2.1', RuntimeFamily.DOTNET_CORE); + public static readonly GO_1_X = new Runtime('go1.x', RuntimeFamily.GO); + public static readonly RUBY_2_5 = new Runtime('ruby2.5', RuntimeFamily.RUBY, { supportsInlineCode: true }); + public static readonly PROVIDED = new Runtime('provided', RuntimeFamily.OTHER); /** * The name of this runtime, as expected by the Lambda resource. @@ -67,7 +67,7 @@ export class Runtime { this.supportsInlineCode = !!props.supportsInlineCode; this.family = family; - Runtime.All.push(this); + Runtime.ALL.push(this); } public toString(): string { diff --git a/packages/@aws-cdk/aws-lambda/test/integ.assets.file.ts b/packages/@aws-cdk/aws-lambda/test/integ.assets.file.ts index 49b2259199982..43bf23daf2825 100644 --- a/packages/@aws-cdk/aws-lambda/test/integ.assets.file.ts +++ b/packages/@aws-cdk/aws-lambda/test/integ.assets.file.ts @@ -10,7 +10,7 @@ class TestStack extends cdk.Stack { new lambda.Function(this, 'MyLambda', { code: lambda.Code.asset(path.join(__dirname, 'handler.zip')), handler: 'index.main', - runtime: lambda.Runtime.Python36 + runtime: lambda.Runtime.PYTHON_3_6 }); /// !hide } diff --git a/packages/@aws-cdk/aws-lambda/test/integ.assets.lit.ts b/packages/@aws-cdk/aws-lambda/test/integ.assets.lit.ts index 0fa19e3986b49..a9bd1cd939e6c 100644 --- a/packages/@aws-cdk/aws-lambda/test/integ.assets.lit.ts +++ b/packages/@aws-cdk/aws-lambda/test/integ.assets.lit.ts @@ -10,7 +10,7 @@ class TestStack extends cdk.Stack { new lambda.Function(this, 'MyLambda', { code: lambda.Code.asset(path.join(__dirname, 'my-lambda-handler')), handler: 'index.main', - runtime: lambda.Runtime.Python36 + runtime: lambda.Runtime.PYTHON_3_6 }); /// !hide } diff --git a/packages/@aws-cdk/aws-lambda/test/integ.lambda.ts b/packages/@aws-cdk/aws-lambda/test/integ.lambda.ts index 3c62f6bf5566a..8efd676f0e620 100644 --- a/packages/@aws-cdk/aws-lambda/test/integ.lambda.ts +++ b/packages/@aws-cdk/aws-lambda/test/integ.lambda.ts @@ -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.NODEJS_8_10, }); fn.addToRolePolicy(new iam.PolicyStatement({ diff --git a/packages/@aws-cdk/aws-lambda/test/integ.layer-version.lit.ts b/packages/@aws-cdk/aws-lambda/test/integ.layer-version.lit.ts index f719e8730152f..dcfc057491e2e 100644 --- a/packages/@aws-cdk/aws-lambda/test/integ.layer-version.lit.ts +++ b/packages/@aws-cdk/aws-lambda/test/integ.layer-version.lit.ts @@ -12,7 +12,7 @@ const awsAccountId = stack.account; /// !show const layer = new lambda.LayerVersion(stack, 'MyLayer', { code: lambda.Code.asset(path.join(__dirname, 'layer-code')), - compatibleRuntimes: [lambda.Runtime.Nodejs810], + compatibleRuntimes: [lambda.Runtime.NODEJS_8_10], license: 'Apache-2.0', description: 'A layer to test the L2 construct', }); @@ -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.NODEJS_8_10, layers: [layer], }); /// !hide diff --git a/packages/@aws-cdk/aws-lambda/test/integ.log-retention.ts b/packages/@aws-cdk/aws-lambda/test/integ.log-retention.ts index c13e543d30937..405d0cb83d1b1 100644 --- a/packages/@aws-cdk/aws-lambda/test/integ.log-retention.ts +++ b/packages/@aws-cdk/aws-lambda/test/integ.log-retention.ts @@ -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.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, 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.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, 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.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, logRetention: logs.RetentionDays.ONE_YEAR }); diff --git a/packages/@aws-cdk/aws-lambda/test/integ.vpc-lambda.ts b/packages/@aws-cdk/aws-lambda/test/integ.vpc-lambda.ts index 9d66205b9868b..f377b3429cb68 100644 --- a/packages/@aws-cdk/aws-lambda/test/integ.vpc-lambda.ts +++ b/packages/@aws-cdk/aws-lambda/test/integ.vpc-lambda.ts @@ -10,7 +10,7 @@ const vpc = new ec2.Vpc(stack, 'VPC', { maxAZs: 2 }); new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('def main(event, context): pass'), handler: 'index.main', - runtime: lambda.Runtime.Python36, + runtime: lambda.Runtime.PYTHON_3_6, vpc }); diff --git a/packages/@aws-cdk/aws-lambda/test/test.alias.ts b/packages/@aws-cdk/aws-lambda/test/test.alias.ts index 1964cf5efbdd0..5dad1610b1c65 100644 --- a/packages/@aws-cdk/aws-lambda/test/test.alias.ts +++ b/packages/@aws-cdk/aws-lambda/test/test.alias.ts @@ -10,7 +10,7 @@ export = { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, }); 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.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, }); new lambda.Alias(stack, 'Alias', { @@ -68,7 +68,7 @@ export = { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, }); const version = fn.addVersion('NewVersion'); @@ -96,7 +96,7 @@ export = { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, }); const version1 = fn.addVersion('1'); @@ -129,7 +129,7 @@ export = { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, }); const version = fn.addVersion('1'); @@ -160,7 +160,7 @@ export = { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, }); const version = fn.addVersion('1'); @@ -210,7 +210,7 @@ export = { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, }); const version = fn.addVersion('1'); @@ -229,7 +229,7 @@ export = { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('hello()'), handler: 'index.hello', - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, }); const version = fn.addVersion('1'); diff --git a/packages/@aws-cdk/aws-lambda/test/test.code.ts b/packages/@aws-cdk/aws-lambda/test/test.code.ts index 890d068a5a138..2b5c2c11a928d 100644 --- a/packages/@aws-cdk/aws-lambda/test/test.code.ts +++ b/packages/@aws-cdk/aws-lambda/test/test.code.ts @@ -10,13 +10,13 @@ import lambda = require('../lib'); export = { 'lambda.Code.inline': { 'fails if used with unsupported runtimes'(test: Test) { - test.throws(() => defineFunction(lambda.Code.inline('boom'), lambda.Runtime.Go1x), /Inline source not allowed for go1\.x/); - test.throws(() => defineFunction(lambda.Code.inline('boom'), lambda.Runtime.Java8), /Inline source not allowed for java8/); + test.throws(() => defineFunction(lambda.Code.inline('boom'), lambda.Runtime.GO_1_X), /Inline source not allowed for go1\.x/); + test.throws(() => defineFunction(lambda.Code.inline('boom'), lambda.Runtime.JAVA_8), /Inline source not allowed for java8/); test.done(); }, 'fails if larger than 4096 bytes'(test: Test) { test.throws( - () => defineFunction(lambda.Code.inline(generateRandomString(4097)), lambda.Runtime.Nodejs810), + () => defineFunction(lambda.Code.inline(generateRandomString(4097)), lambda.Runtime.NODEJS_8_10), /Lambda source is too large, must be <= 4096 but is 4097/); test.done(); } @@ -40,13 +40,13 @@ export = { // WHEN new lambda.Function(stack, 'Func1', { handler: 'foom', - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, code: directoryAsset }); new lambda.Function(stack, 'Func2', { handler: 'foom', - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, code: directoryAsset }); @@ -74,7 +74,7 @@ export = { // WHEN new lambda.Function(stack, 'Func1', { code: lambda.Code.asset(location), - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, handler: 'foom', }); @@ -95,7 +95,7 @@ export = { const code = new lambda.CfnParametersCode(); new lambda.Function(stack, 'Function', { code, - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, handler: 'index.handler', }); @@ -149,7 +149,7 @@ export = { new lambda.Function(stack, 'Function', { code, - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, handler: 'index.handler', }); @@ -194,7 +194,7 @@ export = { }, }; -function defineFunction(code: lambda.Code, runtime: lambda.Runtime = lambda.Runtime.Nodejs810) { +function defineFunction(code: lambda.Code, runtime: lambda.Runtime = lambda.Runtime.NODEJS_8_10) { const stack = new cdk.Stack(); return new lambda.Function(stack, 'Func', { handler: 'foom', diff --git a/packages/@aws-cdk/aws-lambda/test/test.function.ts b/packages/@aws-cdk/aws-lambda/test/test.function.ts index 1cfdc3e90ec12..fe8fd84ad95c8 100644 --- a/packages/@aws-cdk/aws-lambda/test/test.function.ts +++ b/packages/@aws-cdk/aws-lambda/test/test.function.ts @@ -12,13 +12,13 @@ export = testCase({ const code = new lambda.S3Code(bucket, 'ObjectKey'); const func = new lambda.Function(stack, 'myFunc', { - runtime: lambda.Runtime.Python37, + runtime: lambda.Runtime.PYTHON_3_7, handler: 'index.handler', code, }); const layer = new lambda.LayerVersion(stack, 'myLayer', { code, - compatibleRuntimes: [lambda.Runtime.Nodejs] + compatibleRuntimes: [lambda.Runtime.NODEJS] }); // THEN @@ -34,13 +34,13 @@ export = testCase({ const code = new lambda.S3Code(bucket, 'ObjectKey'); const func = new lambda.Function(stack, 'myFunc', { - runtime: lambda.Runtime.Python37, + runtime: lambda.Runtime.PYTHON_3_7, handler: 'index.handler', code, }); const layer = new lambda.LayerVersion(stack, 'myLayer', { code, - compatibleRuntimes: [lambda.Runtime.Python37] + compatibleRuntimes: [lambda.Runtime.PYTHON_3_7] }); // THEN @@ -55,7 +55,7 @@ export = testCase({ const bucket = new s3.Bucket(stack, 'Bucket'); const code = new lambda.S3Code(bucket, 'ObjectKey'); - const runtime = lambda.Runtime.Python37; + const runtime = lambda.Runtime.PYTHON_3_7; const func = new lambda.Function(stack, 'myFunc', { runtime, handler: 'index.handler', diff --git a/packages/@aws-cdk/aws-lambda/test/test.lambda.ts b/packages/@aws-cdk/aws-lambda/test/test.lambda.ts index 576963b73b75f..09a36697952a9 100644 --- a/packages/@aws-cdk/aws-lambda/test/test.lambda.ts +++ b/packages/@aws-cdk/aws-lambda/test/test.lambda.ts @@ -16,7 +16,7 @@ export = { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, }); expect(stack).toMatch({ Resources: @@ -50,7 +50,7 @@ export = { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, initialPolicy: [new iam.PolicyStatement({ actions: ["*"], resources: ["*"] })] }); expect(stack).toMatch({ Resources: @@ -105,7 +105,7 @@ export = { test.throws(() => new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'bar', - runtime: lambda.Runtime.DotNetCore2 + runtime: lambda.Runtime.DOTNET_CORE_2 })); test.done(); }, @@ -210,7 +210,7 @@ export = { // WHEN const fn = new lambda.Function(stack, 'Function', { code: new lambda.InlineCode('test'), - runtime: lambda.Runtime.Python36, + runtime: lambda.Runtime.PYTHON_3_6, handler: 'index.test', role, initialPolicy: [ @@ -260,7 +260,7 @@ export = { new lambda.Function(stack, 'MyLambda', { code: lambda.Code.asset(path.join(__dirname, 'my-lambda-handler')), handler: 'index.handler', - runtime: lambda.Runtime.Python36 + runtime: lambda.Runtime.PYTHON_3_6 }); // THEN @@ -293,7 +293,7 @@ export = { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, functionName: 'OneFunctionToRuleThemAll', deadLetterQueueEnabled: true }); @@ -405,7 +405,7 @@ export = { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, deadLetterQueueEnabled: true, }); @@ -515,7 +515,7 @@ export = { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, deadLetterQueueEnabled: false, }); @@ -589,7 +589,7 @@ export = { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, deadLetterQueue: dlQueue, }); @@ -698,7 +698,7 @@ export = { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, deadLetterQueueEnabled: true, deadLetterQueue: dlQueue, }); @@ -808,7 +808,7 @@ export = { test.throws(() => new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, deadLetterQueueEnabled: false, deadLetterQueue: dlQueue, }), /deadLetterQueue defined but deadLetterQueueEnabled explicitly set to false/); @@ -822,7 +822,7 @@ export = { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, tracing: lambda.Tracing.ACTIVE }); @@ -880,7 +880,7 @@ export = { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, tracing: lambda.Tracing.PASS_THROUGH }); @@ -938,7 +938,7 @@ export = { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, tracing: lambda.Tracing.DISABLED }); @@ -995,7 +995,7 @@ export = { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.inline('xxx'), handler: 'index.handler', - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, }); // WHEN @@ -1024,7 +1024,7 @@ export = { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.inline('xxx'), handler: 'index.handler', - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, }); const service = new iam.ServicePrincipal('apigateway.amazonaws.com'); @@ -1052,7 +1052,7 @@ export = { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.inline('xxx'), handler: 'index.handler', - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, }); const account = new iam.AccountPrincipal('123456789012'); @@ -1080,7 +1080,7 @@ export = { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.inline('xxx'), handler: 'index.handler', - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, }); // THEN @@ -1101,7 +1101,7 @@ export = { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.inline('xxx'), handler: 'index.handler', - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, }); let bindTarget; @@ -1125,7 +1125,7 @@ export = { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.Ruby25, + runtime: lambda.Runtime.RUBY_2_5, }); expect(stack).toMatch({ Resources: @@ -1159,13 +1159,13 @@ export = { const stack = new cdk.Stack(undefined, 'TestStack'); const layer = lambda.LayerVersion.fromLayerVersionAttributes(stack, 'TestLayer', { layerVersionArn: 'arn:aws:...', - compatibleRuntimes: [lambda.Runtime.Nodejs810], + compatibleRuntimes: [lambda.Runtime.NODEJS_8_10], }); // THEN test.throws(() => new lambda.Function(stack, 'Function', { layers: [layer], - runtime: lambda.Runtime.Nodejs610, + runtime: lambda.Runtime.NODEJS_6_10, code: lambda.Code.inline('exports.main = function() { console.log("DONE"); }'), handler: 'index.main' }), @@ -1179,13 +1179,13 @@ export = { const stack = new cdk.Stack(undefined, 'TestStack'); const layers = new Array(6).fill(lambda.LayerVersion.fromLayerVersionAttributes(stack, 'TestLayer', { layerVersionArn: 'arn:aws:...', - compatibleRuntimes: [lambda.Runtime.Nodejs810], + compatibleRuntimes: [lambda.Runtime.NODEJS_8_10], })); // THEN test.throws(() => new lambda.Function(stack, 'Function', { layers, - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, code: lambda.Code.inline('exports.main = function() { console.log("DONE"); }'), handler: 'index.main' }), @@ -1203,7 +1203,7 @@ export = { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.Nodejs, + runtime: lambda.Runtime.NODEJS, environment: { SOME: 'Variable' } @@ -1221,7 +1221,7 @@ export = { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.Nodejs, + runtime: lambda.Runtime.NODEJS, environment: { SOME: 'Variable' } @@ -1246,7 +1246,7 @@ export = { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.Nodejs, + runtime: lambda.Runtime.NODEJS, reservedConcurrentExecutions: 10 }); @@ -1292,7 +1292,7 @@ export = { // WHEN new lambda.Function(stack, 'fn', { code: lambda.Code.inline('boom'), - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, handler: 'index.bam', events: [ new EventSource(), @@ -1306,7 +1306,7 @@ export = { }, 'Provided Runtime returns the right values'(test: Test) { - const rt = lambda.Runtime.Provided; + const rt = lambda.Runtime.PROVIDED; test.equal(rt.name, 'provided'); test.equal(rt.supportsInlineCode, false); @@ -1322,7 +1322,7 @@ export = { new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.Nodejs, + runtime: lambda.Runtime.NODEJS, logRetention: logs.RetentionDays.ONE_MONTH }); @@ -1350,6 +1350,6 @@ function newTestLambda(scope: cdk.Construct) { return new lambda.Function(scope, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'bar', - runtime: lambda.Runtime.Python27 + runtime: lambda.Runtime.PYTHON_2_7 }); } diff --git a/packages/@aws-cdk/aws-lambda/test/test.layers.ts b/packages/@aws-cdk/aws-lambda/test/test.layers.ts index 2f7164278ebee..58441f345cdff 100644 --- a/packages/@aws-cdk/aws-lambda/test/test.layers.ts +++ b/packages/@aws-cdk/aws-lambda/test/test.layers.ts @@ -14,7 +14,7 @@ export = testCase({ // WHEN new lambda.LayerVersion(stack, 'LayerVersion', { code, - compatibleRuntimes: [lambda.Runtime.Nodejs810] + compatibleRuntimes: [lambda.Runtime.NODEJS_8_10] }); // THEN @@ -36,7 +36,7 @@ export = testCase({ const code = new lambda.S3Code(bucket, 'ObjectKey'); const layer = new lambda.LayerVersion(stack, 'LayerVersion', { code, - compatibleRuntimes: [lambda.Runtime.Nodejs810] + compatibleRuntimes: [lambda.Runtime.NODEJS_8_10] }); // WHEN diff --git a/packages/@aws-cdk/aws-lambda/test/test.singleton-lambda.ts b/packages/@aws-cdk/aws-lambda/test/test.singleton-lambda.ts index e1997a1a8e630..54c27131f10d6 100644 --- a/packages/@aws-cdk/aws-lambda/test/test.singleton-lambda.ts +++ b/packages/@aws-cdk/aws-lambda/test/test.singleton-lambda.ts @@ -13,7 +13,7 @@ export = { new lambda.SingletonFunction(stack, `Singleton${i}`, { uuid: '84c0de93-353f-4217-9b0b-45b6c993251a', code: new lambda.InlineCode('def hello(): pass'), - runtime: lambda.Runtime.Python27, + runtime: lambda.Runtime.PYTHON_2_7, handler: 'index.hello', timeout: cdk.Duration.minutes(5), }); diff --git a/packages/@aws-cdk/aws-lambda/test/test.vpc-lambda.ts b/packages/@aws-cdk/aws-lambda/test/test.vpc-lambda.ts index 16eab5c38c1d8..ec2be4d31b6fb 100644 --- a/packages/@aws-cdk/aws-lambda/test/test.vpc-lambda.ts +++ b/packages/@aws-cdk/aws-lambda/test/test.vpc-lambda.ts @@ -21,7 +21,7 @@ export = { this.lambda = new lambda.Function(this.stack, 'Lambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, vpc: this.vpc, allowAllOutbound: false }); @@ -128,7 +128,7 @@ export = { const lambdaFn = new lambda.Function(stack, 'Lambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, }); // WHEN @@ -149,7 +149,7 @@ export = { new lambda.Function(stack, 'Lambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, vpc, vpcSubnets: { subnetType: ec2.SubnetType.PUBLIC } }); diff --git a/packages/@aws-cdk/aws-logs-destinations/test/lambda.test.ts b/packages/@aws-cdk/aws-logs-destinations/test/lambda.test.ts index 319a588522ae4..dc5f3e4a0a9d2 100644 --- a/packages/@aws-cdk/aws-logs-destinations/test/lambda.test.ts +++ b/packages/@aws-cdk/aws-logs-destinations/test/lambda.test.ts @@ -10,7 +10,7 @@ test('lambda can be used as metric subscription destination', () => { const fn = new lambda.Function(stack, 'MyLambda', { code: new lambda.InlineCode('foo'), handler: 'index.handler', - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, }); const logGroup = new logs.LogGroup(stack, 'LogGroup'); diff --git a/packages/@aws-cdk/aws-rds/lib/instance.ts b/packages/@aws-cdk/aws-rds/lib/instance.ts index 747b22ff024ca..e542888b2a76a 100644 --- a/packages/@aws-cdk/aws-rds/lib/instance.ts +++ b/packages/@aws-cdk/aws-rds/lib/instance.ts @@ -154,17 +154,17 @@ export abstract class DatabaseInstanceBase extends Resource implements IDatabase * secret rotation. */ export class DatabaseInstanceEngine extends DatabaseClusterEngine { - public static readonly MariaDb = new DatabaseInstanceEngine('mariadb', SecretRotationApplication.MariaDbRotationSingleUser); - public static readonly Mysql = new DatabaseInstanceEngine('mysql', SecretRotationApplication.MysqlRotationSingleUser); - public static readonly OracleEE = new DatabaseInstanceEngine('oracle-ee', SecretRotationApplication.OracleRotationSingleUser); - public static readonly OracleSE2 = new DatabaseInstanceEngine('oracle-se2', SecretRotationApplication.OracleRotationSingleUser); - public static readonly OracleSE1 = new DatabaseInstanceEngine('oracle-se1', SecretRotationApplication.OracleRotationSingleUser); - public static readonly OracleSE = new DatabaseInstanceEngine('oracle-se', SecretRotationApplication.OracleRotationSingleUser); - public static readonly Postgres = new DatabaseInstanceEngine('postgres', SecretRotationApplication.PostgresRotationSingleUser); - public static readonly SqlServerEE = new DatabaseInstanceEngine('sqlserver-ee', SecretRotationApplication.SqlServerRotationSingleUser); - public static readonly SqlServerSE = new DatabaseInstanceEngine('sqlserver-se', SecretRotationApplication.SqlServerRotationSingleUser); - public static readonly SqlServerEX = new DatabaseInstanceEngine('sqlserver-ex', SecretRotationApplication.SqlServerRotationSingleUser); - public static readonly SqlServerWeb = new DatabaseInstanceEngine('sqlserver-web', SecretRotationApplication.SqlServerRotationSingleUser); + public static readonly MARIADB = new DatabaseInstanceEngine('mariadb', SecretRotationApplication.MARIADB_ROTATION_SINGLE_USER); + public static readonly MYSQL = new DatabaseInstanceEngine('mysql', SecretRotationApplication.MYSQL_ROTATION_SINGLE_USER); + public static readonly ORACLE_EE = new DatabaseInstanceEngine('oracle-ee', SecretRotationApplication.ORACLE_ROTATION_SINGLE_USER); + public static readonly ORACLE_SE2 = new DatabaseInstanceEngine('oracle-se2', SecretRotationApplication.ORACLE_ROTATION_SINGLE_USER); + public static readonly ORACLE_SE1 = new DatabaseInstanceEngine('oracle-se1', SecretRotationApplication.ORACLE_ROTATION_SINGLE_USER); + public static readonly ORACLE_SE = new DatabaseInstanceEngine('oracle-se', SecretRotationApplication.ORACLE_ROTATION_SINGLE_USER); + public static readonly POSTGRES = new DatabaseInstanceEngine('postgres', SecretRotationApplication.POSTGRES_ROTATION_SINGLE_USER); + public static readonly SQL_SERVER_EE = new DatabaseInstanceEngine('sqlserver-ee', SecretRotationApplication.SQLSERVER_ROTATION_SINGLE_USER); + public static readonly SQL_SERVER_SE = new DatabaseInstanceEngine('sqlserver-se', SecretRotationApplication.SQLSERVER_ROTATION_SINGLE_USER); + public static readonly SQL_SERVER_EX = new DatabaseInstanceEngine('sqlserver-ex', SecretRotationApplication.SQLSERVER_ROTATION_SINGLE_USER); + public static readonly SQL_SERVER_WEB = new DatabaseInstanceEngine('sqlserver-web', SecretRotationApplication.SQLSERVER_ROTATION_SINGLE_USER); } /** diff --git a/packages/@aws-cdk/aws-rds/lib/props.ts b/packages/@aws-cdk/aws-rds/lib/props.ts index 9943f645f3ced..4585eef647fbf 100644 --- a/packages/@aws-cdk/aws-rds/lib/props.ts +++ b/packages/@aws-cdk/aws-rds/lib/props.ts @@ -9,9 +9,9 @@ import { SecretRotationApplication } from './secret-rotation'; * used for secret rotation. */ export class DatabaseClusterEngine { - public static readonly Aurora = new DatabaseClusterEngine('aurora', SecretRotationApplication.MysqlRotationSingleUser); - public static readonly AuroraMysql = new DatabaseClusterEngine('aurora-mysql', SecretRotationApplication.MysqlRotationSingleUser); - public static readonly AuroraPostgresql = new DatabaseClusterEngine('aurora-postgresql', SecretRotationApplication.PostgresRotationSingleUser); + public static readonly AURORA = new DatabaseClusterEngine('aurora', SecretRotationApplication.MYSQL_ROTATION_SINGLE_USER); + public static readonly AURORA_MYSQL = new DatabaseClusterEngine('aurora-mysql', SecretRotationApplication.MYSQL_ROTATION_SINGLE_USER); + public static readonly AURORA_POSTGRESQL = new DatabaseClusterEngine('aurora-postgresql', SecretRotationApplication.POSTGRES_ROTATION_SINGLE_USER); /** * The engine. diff --git a/packages/@aws-cdk/aws-rds/lib/secret-rotation.ts b/packages/@aws-cdk/aws-rds/lib/secret-rotation.ts index 8b27064fe7460..630521c85d187 100644 --- a/packages/@aws-cdk/aws-rds/lib/secret-rotation.ts +++ b/packages/@aws-cdk/aws-rds/lib/secret-rotation.ts @@ -8,20 +8,20 @@ import { Construct, Duration, Stack } from '@aws-cdk/core'; * A secret rotation serverless application. */ export class SecretRotationApplication { - public static readonly MariaDbRotationSingleUser = new SecretRotationApplication('SecretsManagerRDSMariaDBRotationSingleUser', '1.0.57'); - public static readonly MariaDBRotationMultiUser = new SecretRotationApplication('SecretsManagerRDSMariaDBRotationMultiUser', '1.0.57'); + public static readonly MARIADB_ROTATION_SINGLE_USER = new SecretRotationApplication('SecretsManagerRDSMariaDBRotationSingleUser', '1.0.57'); + public static readonly MARIADB_ROTATION_MULTI_USER = new SecretRotationApplication('SecretsManagerRDSMariaDBRotationMultiUser', '1.0.57'); - public static readonly MysqlRotationSingleUser = new SecretRotationApplication('SecretsManagerRDSMySQLRotationSingleUser', '1.0.85'); - public static readonly MysqlRotationMultiUser = new SecretRotationApplication('SecretsManagerRDSMySQLRotationMultiUser', '1.0.85'); + public static readonly MYSQL_ROTATION_SINGLE_USER = new SecretRotationApplication('SecretsManagerRDSMySQLRotationSingleUser', '1.0.85'); + public static readonly MYSQL_ROTATION_MULTI_USER = new SecretRotationApplication('SecretsManagerRDSMySQLRotationMultiUser', '1.0.85'); - public static readonly OracleRotationSingleUser = new SecretRotationApplication('SecretsManagerRDSOracleRotationSingleUser', '1.0.56'); - public static readonly OracleRotationMultiUser = new SecretRotationApplication('SecretsManagerRDSOracleRotationMultiUser', '1.0.56'); + public static readonly ORACLE_ROTATION_SINGLE_USER = new SecretRotationApplication('SecretsManagerRDSOracleRotationSingleUser', '1.0.56'); + public static readonly ORACLE_ROTATION_MULTI_USER = new SecretRotationApplication('SecretsManagerRDSOracleRotationMultiUser', '1.0.56'); - public static readonly PostgresRotationSingleUser = new SecretRotationApplication('SecretsManagerRDSPostgreSQLRotationSingleUser', '1.0.86'); - public static readonly PostgreSQLRotationMultiUser = new SecretRotationApplication('SecretsManagerRDSPostgreSQLRotationMultiUser ', '1.0.86'); + public static readonly POSTGRES_ROTATION_SINGLE_USER = new SecretRotationApplication('SecretsManagerRDSPostgreSQLRotationSingleUser', '1.0.86'); + public static readonly POSTGRES_ROTATION_MULTI_USER = new SecretRotationApplication('SecretsManagerRDSPostgreSQLRotationMultiUser ', '1.0.86'); - public static readonly SqlServerRotationSingleUser = new SecretRotationApplication('SecretsManagerRDSSQLServerRotationSingleUser', '1.0.57'); - public static readonly SqlServerRotationMultiUser = new SecretRotationApplication('SecretsManagerRDSSQLServerRotationMultiUser', '1.0.57'); + public static readonly SQLSERVER_ROTATION_SINGLE_USER = new SecretRotationApplication('SecretsManagerRDSSQLServerRotationSingleUser', '1.0.57'); + public static readonly SQLSERVER_ROTATION_MULTI_USER = new SecretRotationApplication('SecretsManagerRDSSQLServerRotationMultiUser', '1.0.57'); public readonly applicationId: string; public readonly semanticVersion: string; diff --git a/packages/@aws-cdk/aws-rds/test/integ.cluster-rotation.lit.ts b/packages/@aws-cdk/aws-rds/test/integ.cluster-rotation.lit.ts index d48c725ee0ac1..358684cd56830 100644 --- a/packages/@aws-cdk/aws-rds/test/integ.cluster-rotation.lit.ts +++ b/packages/@aws-cdk/aws-rds/test/integ.cluster-rotation.lit.ts @@ -9,7 +9,7 @@ const vpc = new ec2.Vpc(stack, 'VPC'); /// !show const cluster = new rds.DatabaseCluster(stack, 'Database', { - engine: rds.DatabaseClusterEngine.Aurora, + engine: rds.DatabaseClusterEngine.AURORA, masterUser: { username: 'admin' }, diff --git a/packages/@aws-cdk/aws-rds/test/integ.cluster.ts b/packages/@aws-cdk/aws-rds/test/integ.cluster.ts index f025ceda2435a..a2fd8e0c378cb 100644 --- a/packages/@aws-cdk/aws-rds/test/integ.cluster.ts +++ b/packages/@aws-cdk/aws-rds/test/integ.cluster.ts @@ -20,7 +20,7 @@ const params = new ClusterParameterGroup(stack, 'Params', { const kmsKey = new kms.Key(stack, 'DbSecurity'); const cluster = new DatabaseCluster(stack, 'Database', { - engine: DatabaseClusterEngine.Aurora, + engine: DatabaseClusterEngine.AURORA, masterUser: { username: 'admin', password: SecretValue.plainText('7959866cacc02c2d243ecfe177464fe6'), diff --git a/packages/@aws-cdk/aws-rds/test/integ.instance.lit.ts b/packages/@aws-cdk/aws-rds/test/integ.instance.lit.ts index e1f1ac3f6159c..2c7158fc871e9 100644 --- a/packages/@aws-cdk/aws-rds/test/integ.instance.lit.ts +++ b/packages/@aws-cdk/aws-rds/test/integ.instance.lit.ts @@ -25,7 +25,7 @@ class DatabaseInstanceStack extends cdk.Stack { /// Add XMLDB and OEM with option group const optionGroup = new rds.OptionGroup(this, 'OptionGroup', { - engine: rds.DatabaseInstanceEngine.OracleSE1, + engine: rds.DatabaseInstanceEngine.ORACLE_SE1, majorEngineVersion: '11.2', configurations: [ { @@ -44,7 +44,7 @@ class DatabaseInstanceStack extends cdk.Stack { // Database instance with production values const instance = new rds.DatabaseInstance(this, 'Instance', { - engine: rds.DatabaseInstanceEngine.OracleSE1, + engine: rds.DatabaseInstanceEngine.ORACLE_SE1, licenseModel: rds.LicenseModel.BRING_YOUR_OWN_LICENSE, instanceClass: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.MEDIUM), multiAz: true, @@ -85,7 +85,7 @@ class DatabaseInstanceStack extends cdk.Stack { const fn = new lambda.Function(this, 'Function', { code: lambda.Code.inline('exports.handler = (event) => console.log(event);'), handler: 'index.handler', - runtime: lambda.Runtime.Nodejs810 + runtime: lambda.Runtime.NODEJS_8_10 }); const availabilityRule = instance.onEvent('Availability', { target: new targets.LambdaFunction(fn) }); diff --git a/packages/@aws-cdk/aws-rds/test/test.cluster.ts b/packages/@aws-cdk/aws-rds/test/test.cluster.ts index 985110211c21a..e1078e47aa9ad 100644 --- a/packages/@aws-cdk/aws-rds/test/test.cluster.ts +++ b/packages/@aws-cdk/aws-rds/test/test.cluster.ts @@ -14,7 +14,7 @@ export = { // WHEN new DatabaseCluster(stack, 'Database', { - engine: DatabaseClusterEngine.Aurora, + engine: DatabaseClusterEngine.AURORA, masterUser: { username: 'admin', password: SecretValue.plainText('tooshort'), @@ -52,7 +52,7 @@ export = { // WHEN new DatabaseCluster(stack, 'Database', { - engine: DatabaseClusterEngine.Aurora, + engine: DatabaseClusterEngine.AURORA, instances: 1, masterUser: { username: 'admin', @@ -86,7 +86,7 @@ export = { // WHEN new DatabaseCluster(stack, 'Database', { - engine: DatabaseClusterEngine.Aurora, + engine: DatabaseClusterEngine.AURORA, instances: 1, masterUser: { username: 'admin', @@ -125,7 +125,7 @@ export = { } }); new DatabaseCluster(stack, 'Database', { - engine: DatabaseClusterEngine.Aurora, + engine: DatabaseClusterEngine.AURORA, masterUser: { username: 'admin', password: SecretValue.plainText('tooshort'), @@ -152,7 +152,7 @@ export = { // WHEN new DatabaseCluster(stack, 'Database', { - engine: DatabaseClusterEngine.AuroraMysql, + engine: DatabaseClusterEngine.AURORA_MYSQL, masterUser: { username: 'admin' }, @@ -209,7 +209,7 @@ export = { // WHEN new DatabaseCluster(stack, 'Database', { - engine: DatabaseClusterEngine.AuroraMysql, + engine: DatabaseClusterEngine.AURORA_MYSQL, masterUser: { username: 'admin' }, @@ -246,7 +246,7 @@ export = { // WHEN new DatabaseCluster(stack, 'Database', { - engine: DatabaseClusterEngine.Aurora, + engine: DatabaseClusterEngine.AURORA, masterUser: { username: 'admin', }, @@ -274,7 +274,7 @@ export = { // WHEN new DatabaseCluster(stack, 'Database', { - engine: DatabaseClusterEngine.AuroraMysql, + engine: DatabaseClusterEngine.AURORA_MYSQL, engineVersion: "5.7.mysql_aurora.2.04.4", masterUser: { username: 'admin' @@ -301,7 +301,7 @@ export = { // WHEN new DatabaseCluster(stack, 'Database', { - engine: DatabaseClusterEngine.AuroraPostgresql, + engine: DatabaseClusterEngine.AURORA_POSTGRESQL, engineVersion: "10.7", masterUser: { username: 'admin' @@ -328,7 +328,7 @@ export = { // WHEN const cluster = new DatabaseCluster(stack, 'Database', { - engine: DatabaseClusterEngine.Aurora, + engine: DatabaseClusterEngine.AURORA, masterUser: { username: 'admin', }, diff --git a/packages/@aws-cdk/aws-rds/test/test.instance.ts b/packages/@aws-cdk/aws-rds/test/test.instance.ts index 82589532e2acb..fc2c257014e2e 100644 --- a/packages/@aws-cdk/aws-rds/test/test.instance.ts +++ b/packages/@aws-cdk/aws-rds/test/test.instance.ts @@ -15,7 +15,7 @@ export = { // WHEN new rds.DatabaseInstance(stack, 'Instance', { - engine: rds.DatabaseInstanceEngine.OracleSE1, + engine: rds.DatabaseInstanceEngine.ORACLE_SE1, licenseModel: rds.LicenseModel.BRING_YOUR_OWN_LICENSE, instanceClass: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.MEDIUM), multiAz: true, @@ -188,7 +188,7 @@ export = { const vpc = new ec2.Vpc(stack, 'VPC'); const optionGroup = new rds.OptionGroup(stack, 'OptionGroup', { - engine: rds.DatabaseInstanceEngine.OracleSE1, + engine: rds.DatabaseInstanceEngine.ORACLE_SE1, majorEngineVersion: '11.2', configurations: [ { @@ -207,7 +207,7 @@ export = { // WHEN new rds.DatabaseInstance(stack, 'Database', { - engine: rds.DatabaseInstanceEngine.SqlServerEE, + engine: rds.DatabaseInstanceEngine.SQL_SERVER_EE, instanceClass: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL), masterUsername: 'syscdk', masterUserPassword: cdk.SecretValue.plainText('tooshort'), @@ -236,7 +236,7 @@ export = { // WHEN new rds.DatabaseInstanceFromSnapshot(stack, 'Instance', { snapshotIdentifier: 'my-snapshot', - engine: rds.DatabaseInstanceEngine.Postgres, + engine: rds.DatabaseInstanceEngine.POSTGRES, instanceClass: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.LARGE), vpc }); @@ -256,7 +256,7 @@ export = { // THEN test.throws(() => new rds.DatabaseInstanceFromSnapshot(stack, 'Instance', { snapshotIdentifier: 'my-snapshot', - engine: rds.DatabaseInstanceEngine.Mysql, + engine: rds.DatabaseInstanceEngine.MYSQL, instanceClass: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.LARGE), vpc, generateMasterUserPassword: true, @@ -270,7 +270,7 @@ export = { const stack = new cdk.Stack(); const vpc = new ec2.Vpc(stack, 'VPC'); const sourceInstance = new rds.DatabaseInstance(stack, 'Instance', { - engine: rds.DatabaseInstanceEngine.Mysql, + engine: rds.DatabaseInstanceEngine.MYSQL, instanceClass: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL), masterUsername: 'admin', vpc @@ -279,7 +279,7 @@ export = { // WHEN new rds.DatabaseInstanceReadReplica(stack, 'ReadReplica', { sourceDatabaseInstance: sourceInstance, - engine: rds.DatabaseInstanceEngine.Mysql, + engine: rds.DatabaseInstanceEngine.MYSQL, instanceClass: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.LARGE), vpc }); @@ -299,7 +299,7 @@ export = { const stack = new cdk.Stack(); const vpc = new ec2.Vpc(stack, 'VPC'); const instance = new rds.DatabaseInstance(stack, 'Instance', { - engine: rds.DatabaseInstanceEngine.Mysql, + engine: rds.DatabaseInstanceEngine.MYSQL, instanceClass: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL), masterUsername: 'admin', vpc @@ -307,7 +307,7 @@ export = { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.inline('dummy'), handler: 'index.handler', - runtime: lambda.Runtime.Nodejs810 + runtime: lambda.Runtime.NODEJS_8_10 }); // WHEN @@ -366,7 +366,7 @@ export = { const stack = new cdk.Stack(); const vpc = new ec2.Vpc(stack, 'VPC'); const instance = new rds.DatabaseInstance(stack, 'Instance', { - engine: rds.DatabaseInstanceEngine.Mysql, + engine: rds.DatabaseInstanceEngine.MYSQL, instanceClass: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL), masterUsername: 'admin', vpc @@ -419,7 +419,7 @@ export = { // WHEN const instance = new rds.DatabaseInstance(stack, 'Instance', { - engine: rds.DatabaseInstanceEngine.Mysql, + engine: rds.DatabaseInstanceEngine.MYSQL, instanceClass: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL), masterUsername: 'admin', vpc @@ -444,7 +444,7 @@ export = { // WHEN const instance = new rds.DatabaseInstance(stack, 'Instance', { - engine: rds.DatabaseInstanceEngine.Mysql, + engine: rds.DatabaseInstanceEngine.MYSQL, instanceClass: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL), masterUsername: 'admin', vpc @@ -475,7 +475,7 @@ export = { // WHEN new rds.DatabaseInstance(stack, 'Instance', { - engine: rds.DatabaseInstanceEngine.Mysql, + engine: rds.DatabaseInstanceEngine.MYSQL, instanceClass: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL), masterUsername: 'admin', vpc, diff --git a/packages/@aws-cdk/aws-rds/test/test.option-group.ts b/packages/@aws-cdk/aws-rds/test/test.option-group.ts index 538a428ab0d8d..815d48a44a9db 100644 --- a/packages/@aws-cdk/aws-rds/test/test.option-group.ts +++ b/packages/@aws-cdk/aws-rds/test/test.option-group.ts @@ -11,7 +11,7 @@ export = { // WHEN new OptionGroup(stack, 'Options', { - engine: DatabaseInstanceEngine.OracleSE1, + engine: DatabaseInstanceEngine.ORACLE_SE1, majorEngineVersion: '11.2', configurations: [ { @@ -42,7 +42,7 @@ export = { // WHEN const optionGroup = new OptionGroup(stack, 'Options', { - engine: DatabaseInstanceEngine.OracleSE1, + engine: DatabaseInstanceEngine.ORACLE_SE1, majorEngineVersion: '11.2', configurations: [ { @@ -100,7 +100,7 @@ export = { // THEN test.throws(() => new OptionGroup(stack, 'Options', { - engine: DatabaseInstanceEngine.OracleSE1, + engine: DatabaseInstanceEngine.ORACLE_SE1, majorEngineVersion: '11.2', configurations: [ { diff --git a/packages/@aws-cdk/aws-rds/test/test.secret-rotation.ts b/packages/@aws-cdk/aws-rds/test/test.secret-rotation.ts index eee92b1a96d6b..bca042afb8f43 100644 --- a/packages/@aws-cdk/aws-rds/test/test.secret-rotation.ts +++ b/packages/@aws-cdk/aws-rds/test/test.secret-rotation.ts @@ -15,7 +15,7 @@ export = { const stack = new cdk.Stack(); const vpc = new ec2.Vpc(stack, 'VPC'); const cluster = new rds.DatabaseCluster(stack, 'Database', { - engine: rds.DatabaseClusterEngine.AuroraMysql, + engine: rds.DatabaseClusterEngine.AURORA_MYSQL, masterUser: { username: 'admin' }, @@ -162,7 +162,7 @@ export = { // WHEN const cluster = new rds.DatabaseCluster(stack, 'Database', { - engine: rds.DatabaseClusterEngine.AuroraMysql, + engine: rds.DatabaseClusterEngine.AURORA_MYSQL, masterUser: { username: 'admin', password: SecretValue.plainText('tooshort') @@ -196,7 +196,7 @@ export = { // THEN test.throws(() => new rds.SecretRotation(stack, 'Rotation', { secret, - application: SecretRotationApplication.MysqlRotationSingleUser, + application: SecretRotationApplication.MYSQL_ROTATION_SINGLE_USER, vpc, target }), /`target`.+default port range/); @@ -209,7 +209,7 @@ export = { const stack = new cdk.Stack(); const vpc = new ec2.Vpc(stack, 'VPC'); const instance = new rds.DatabaseInstance(stack, 'Database', { - engine: rds.DatabaseInstanceEngine.MariaDb, + engine: rds.DatabaseInstanceEngine.MARIADB, instanceClass: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL), masterUsername: 'syscdk', vpc @@ -352,7 +352,7 @@ export = { // WHEN const instance = new rds.DatabaseInstance(stack, 'Database', { - engine: rds.DatabaseInstanceEngine.SqlServerEE, + engine: rds.DatabaseInstanceEngine.SQL_SERVER_EE, instanceClass: ec2.InstanceType.of(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL), masterUsername: 'syscdk', masterUserPassword: SecretValue.plainText('tooshort'), diff --git a/packages/@aws-cdk/aws-s3-deployment/lib/bucket-deployment.ts b/packages/@aws-cdk/aws-s3-deployment/lib/bucket-deployment.ts index 0203e1d0855bd..c3c7b61df7575 100644 --- a/packages/@aws-cdk/aws-s3-deployment/lib/bucket-deployment.ts +++ b/packages/@aws-cdk/aws-s3-deployment/lib/bucket-deployment.ts @@ -46,7 +46,7 @@ export class BucketDeployment extends cdk.Construct { const handler = new lambda.SingletonFunction(this, 'CustomResourceHandler', { uuid: '8693BB64-9689-44B6-9AAF-B0CC9EB8756C', code: lambda.Code.asset(handlerCodeBundle), - runtime: lambda.Runtime.Python36, + runtime: lambda.Runtime.PYTHON_3_6, handler: 'index.handler', lambdaPurpose: 'Custom::CDKBucketDeployment', timeout: cdk.Duration.minutes(15) diff --git a/packages/@aws-cdk/aws-s3-notifications/test/lambda/integ.bucket-notifications.ts b/packages/@aws-cdk/aws-s3-notifications/test/lambda/integ.bucket-notifications.ts index ed87332d9dd0c..46bd3667f2dba 100644 --- a/packages/@aws-cdk/aws-s3-notifications/test/lambda/integ.bucket-notifications.ts +++ b/packages/@aws-cdk/aws-s3-notifications/test/lambda/integ.bucket-notifications.ts @@ -12,7 +12,7 @@ const bucketA = new s3.Bucket(stack, 'MyBucket', { }); const fn = new lambda.Function(stack, 'MyFunction', { - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, handler: 'index.handler', code: lambda.Code.inline(`exports.handler = ${handler.toString()}`) }); diff --git a/packages/@aws-cdk/aws-s3-notifications/test/lambda/lambda.test.ts b/packages/@aws-cdk/aws-s3-notifications/test/lambda/lambda.test.ts index 35af80eb15e05..1274344d464d7 100644 --- a/packages/@aws-cdk/aws-s3-notifications/test/lambda/lambda.test.ts +++ b/packages/@aws-cdk/aws-s3-notifications/test/lambda/lambda.test.ts @@ -10,7 +10,7 @@ test('lambda as notification target', () => { const stack = new Stack(); const bucketA = new s3.Bucket(stack, 'MyBucket'); const fn = new lambda.Function(stack, 'MyFunction', { - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, handler: 'index.handler', code: lambda.Code.inline(`foo`) }); diff --git a/packages/@aws-cdk/aws-s3/lib/bucket.ts b/packages/@aws-cdk/aws-s3/lib/bucket.ts index d8322b11b7504..2607167c38e05 100644 --- a/packages/@aws-cdk/aws-s3/lib/bucket.ts +++ b/packages/@aws-cdk/aws-s3/lib/bucket.ts @@ -587,14 +587,14 @@ export interface BlockPublicAccessOptions { } export class BlockPublicAccess { - public static readonly BlockAll = new BlockPublicAccess({ + public static readonly BLOCK_ALL = new BlockPublicAccess({ blockPublicAcls: true, blockPublicPolicy: true, ignorePublicAcls: true, restrictPublicBuckets: true }); - public static readonly BlockAcls = new BlockPublicAccess({ + public static readonly BLOCK_ACLS = new BlockPublicAccess({ blockPublicAcls: true, ignorePublicAcls: true }); diff --git a/packages/@aws-cdk/aws-s3/lib/rule.ts b/packages/@aws-cdk/aws-s3/lib/rule.ts index 0acec0795a57b..535d04b10443d 100644 --- a/packages/@aws-cdk/aws-s3/lib/rule.ts +++ b/packages/@aws-cdk/aws-s3/lib/rule.ts @@ -155,14 +155,14 @@ export class StorageClass { * * Has lower availability than Standard storage. */ - public static readonly InfrequentAccess = new StorageClass('STANDARD_IA'); + public static readonly INFREQUENT_ACCESS = new StorageClass('STANDARD_IA'); /** * Infrequent Access that's only stored in one availability zone. * * Has lower availability than standard InfrequentAccess. */ - public static readonly OneZoneInfrequentAccess = new StorageClass('ONEZONE_IA'); + public static readonly ONE_ZONE_INFREQUENT_ACCESS = new StorageClass('ONEZONE_IA'); /** * Storage class for long-term archival that can take between minutes and @@ -174,7 +174,7 @@ export class StorageClass { * using expedited retrieval. If you delete an object before the 90-day * minimum, you are charged for 90 days. */ - public static readonly Glacier = new StorageClass('GLACIER'); + public static readonly GLACIER = new StorageClass('GLACIER'); /** * Use for archiving data that rarely needs to be accessed. Data stored in the @@ -183,7 +183,7 @@ export class StorageClass { * before the 180-day minimum, you are charged for 180 days. For pricing * information, see Amazon S3 Pricing. */ - public static readonly DeepArchive = new StorageClass('DEEP_ARCHIVE'); + public static readonly DEEP_ARCHIVE = new StorageClass('DEEP_ARCHIVE'); /** * The INTELLIGENT_TIERING storage class is designed to optimize storage costs @@ -196,7 +196,7 @@ export class StorageClass { * costs automatically for long-lived data when access patterns are unknown or * unpredictable. */ - public static readonly IntelligentTiering = new StorageClass('INTELLIGENT_TIERING'); + public static readonly INTELLIGENT_TIERING = new StorageClass('INTELLIGENT_TIERING'); constructor(public readonly value: string) { } diff --git a/packages/@aws-cdk/aws-s3/test/test.bucket.ts b/packages/@aws-cdk/aws-s3/test/test.bucket.ts index 20ec8511c2b90..b9ca7f88f6b2e 100644 --- a/packages/@aws-cdk/aws-s3/test/test.bucket.ts +++ b/packages/@aws-cdk/aws-s3/test/test.bucket.ts @@ -356,7 +356,7 @@ export = { 'bucket with block public access set to BlockAll'(test: Test) { const stack = new cdk.Stack(); new s3.Bucket(stack, 'MyBucket', { - blockPublicAccess: s3.BlockPublicAccess.BlockAll, + blockPublicAccess: s3.BlockPublicAccess.BLOCK_ALL, }); expect(stack).toMatch({ @@ -381,7 +381,7 @@ export = { 'bucket with block public access set to BlockAcls'(test: Test) { const stack = new cdk.Stack(); new s3.Bucket(stack, 'MyBucket', { - blockPublicAccess: s3.BlockPublicAccess.BlockAcls, + blockPublicAccess: s3.BlockPublicAccess.BLOCK_ACLS, }); expect(stack).toMatch({ diff --git a/packages/@aws-cdk/aws-s3/test/test.rules.ts b/packages/@aws-cdk/aws-s3/test/test.rules.ts index 8ac94b9020191..57f9b7e19760a 100644 --- a/packages/@aws-cdk/aws-s3/test/test.rules.ts +++ b/packages/@aws-cdk/aws-s3/test/test.rules.ts @@ -83,7 +83,7 @@ export = { new Bucket(stack, 'Bucket', { lifecycleRules: [{ transitions: [{ - storageClass: StorageClass.Glacier, + storageClass: StorageClass.GLACIER, transitionAfter: Duration.days(30) }] }] diff --git a/packages/@aws-cdk/aws-secretsmanager/test/test.rotation-schedule.ts b/packages/@aws-cdk/aws-secretsmanager/test/test.rotation-schedule.ts index 24958427aa566..885b02dfec9d8 100644 --- a/packages/@aws-cdk/aws-secretsmanager/test/test.rotation-schedule.ts +++ b/packages/@aws-cdk/aws-secretsmanager/test/test.rotation-schedule.ts @@ -10,7 +10,7 @@ export = { const stack = new cdk.Stack(); const secret = new secretsmanager.Secret(stack, 'Secret'); const rotationLambda = new lambda.Function(stack, 'Lambda', { - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, code: lambda.Code.inline('export.handler = event => event;'), handler: 'index.handler' }); diff --git a/packages/@aws-cdk/aws-secretsmanager/test/test.secret.ts b/packages/@aws-cdk/aws-secretsmanager/test/test.secret.ts index 09118826958d2..4a270d67544ee 100644 --- a/packages/@aws-cdk/aws-secretsmanager/test/test.secret.ts +++ b/packages/@aws-cdk/aws-secretsmanager/test/test.secret.ts @@ -346,7 +346,7 @@ export = { }; const attachedSecret = secret.addTargetAttachment('AttachedSecret', { target }); const rotationLambda = new lambda.Function(stack, 'Lambda', { - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, code: lambda.Code.inline('export.handler = event => event;'), handler: 'index.handler' }); diff --git a/packages/@aws-cdk/aws-ses/lib/receipt-rule-action.ts b/packages/@aws-cdk/aws-ses/lib/receipt-rule-action.ts index 8ca41899939fa..47034c43f4a90 100644 --- a/packages/@aws-cdk/aws-ses/lib/receipt-rule-action.ts +++ b/packages/@aws-cdk/aws-ses/lib/receipt-rule-action.ts @@ -138,31 +138,31 @@ export interface ReceiptRuleBounceActionTemplateProps { * A bounce action template. */ export class ReceiptRuleBounceActionTemplate { - public static readonly MailboxDoesNotExist = new ReceiptRuleBounceActionTemplate({ + public static readonly MAILBOX_DOES_NOT_EXIST = new ReceiptRuleBounceActionTemplate({ message: 'Mailbox does not exist', smtpReplyCode: '550', statusCode: '5.1.1' }); - public static readonly MessageTooLarge = new ReceiptRuleBounceActionTemplate({ + public static readonly MESSAGE_TOO_LARGE = new ReceiptRuleBounceActionTemplate({ message: 'Message too large', smtpReplyCode: '552', statusCode: '5.3.4' }); - public static readonly MailboxFull = new ReceiptRuleBounceActionTemplate({ + public static readonly MAILBOX_FULL = new ReceiptRuleBounceActionTemplate({ message: 'Mailbox full', smtpReplyCode: '552', statusCode: '5.2.2' }); - public static readonly MessageContentRejected = new ReceiptRuleBounceActionTemplate({ + public static readonly MESSAGE_CONTENT_REJECTED = new ReceiptRuleBounceActionTemplate({ message: 'Message content rejected', smtpReplyCode: '500', statusCode: '5.6.1' }); - public static readonly TemporaryFailure = new ReceiptRuleBounceActionTemplate({ + public static readonly TEMPORARY_FAILURE = new ReceiptRuleBounceActionTemplate({ message: 'Temporary failure', smtpReplyCode: '450', statusCode: '4.0.0' @@ -280,7 +280,7 @@ export class ReceiptRuleLambdaAction implements IReceiptRuleAction { this.props.function.addPermission(permissionId, { action: 'lambda:InvokeFunction', principal: new iam.ServicePrincipal('ses.amazonaws.com'), - sourceAccount: cdk.Aws.accountId + sourceAccount: cdk.Aws.ACCOUNT_ID }); } @@ -345,7 +345,7 @@ export class ReceiptRuleS3Action implements IReceiptRuleAction { resources: [this.props.bucket.arnForObjects(`${keyPattern}*`)], conditions: { StringEquals: { - 'aws:Referer': cdk.Aws.accountId + 'aws:Referer': cdk.Aws.ACCOUNT_ID } } }); @@ -365,7 +365,7 @@ export class ReceiptRuleS3Action implements IReceiptRuleAction { 'kms:EncryptionContext:aws:ses:message-id': 'false' }, StringEquals: { - 'kms:EncryptionContext:aws:ses:source-account': cdk.Aws.accountId + 'kms:EncryptionContext:aws:ses:source-account': cdk.Aws.ACCOUNT_ID } } }); diff --git a/packages/@aws-cdk/aws-ses/lib/receipt-rule.ts b/packages/@aws-cdk/aws-ses/lib/receipt-rule.ts index 26cabef5d0ebd..2301e1b47322c 100644 --- a/packages/@aws-cdk/aws-ses/lib/receipt-rule.ts +++ b/packages/@aws-cdk/aws-ses/lib/receipt-rule.ts @@ -172,7 +172,7 @@ export class DropSpamReceiptRule extends Construct { super(scope, id); const fn = new lambda.SingletonFunction(this, 'Function', { - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, handler: 'index.handler', code: lambda.Code.inline(`exports.handler = ${dropSpamCode}`), uuid: '224e77f9-a32e-4b4d-ac32-983477abba16' diff --git a/packages/@aws-cdk/aws-ses/test/integ.receipt.ts b/packages/@aws-cdk/aws-ses/test/integ.receipt.ts index fba6d9d6ebc55..51564625c9f87 100644 --- a/packages/@aws-cdk/aws-ses/test/integ.receipt.ts +++ b/packages/@aws-cdk/aws-ses/test/integ.receipt.ts @@ -14,7 +14,7 @@ const topic = new sns.Topic(stack, 'Topic'); const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.inline('exports.handler = async (event) => event;'), handler: 'index.handler', - runtime: lambda.Runtime.Nodejs810 + runtime: lambda.Runtime.NODEJS_8_10 }); const bucket = new s3.Bucket(stack, 'Bucket'); @@ -56,7 +56,7 @@ const firstRule = ruleSet.addRule('FirstRule', { firstRule.addAction( new ses.ReceiptRuleBounceAction({ sender: 'cdk-ses-receipt-test@yopmail.com', - template: ses.ReceiptRuleBounceActionTemplate.MessageContentRejected, + template: ses.ReceiptRuleBounceActionTemplate.MESSAGE_CONTENT_REJECTED, topic }) ); diff --git a/packages/@aws-cdk/aws-ses/test/test.receipt-rule-action.ts b/packages/@aws-cdk/aws-ses/test/test.receipt-rule-action.ts index 9d3cc9181c8c3..7208d9458eafd 100644 --- a/packages/@aws-cdk/aws-ses/test/test.receipt-rule-action.ts +++ b/packages/@aws-cdk/aws-ses/test/test.receipt-rule-action.ts @@ -95,7 +95,7 @@ export = { actions: [ new ReceiptRuleBounceAction({ sender: 'noreply@aws.com', - template: ReceiptRuleBounceActionTemplate.MessageContentRejected, + template: ReceiptRuleBounceActionTemplate.MESSAGE_CONTENT_REJECTED, topic }) ] @@ -135,7 +135,7 @@ export = { const fn = new lambda.Function(stack, 'Function', { code: lambda.Code.inline(''), handler: 'index.handler', - runtime: lambda.Runtime.Nodejs810 + runtime: lambda.Runtime.NODEJS_8_10 }); // WHEN diff --git a/packages/@aws-cdk/aws-sns-subscriptions/test/integ.sns-lambda.ts b/packages/@aws-cdk/aws-sns-subscriptions/test/integ.sns-lambda.ts index 3588e3a795481..dc73f17850e60 100644 --- a/packages/@aws-cdk/aws-sns-subscriptions/test/integ.sns-lambda.ts +++ b/packages/@aws-cdk/aws-sns-subscriptions/test/integ.sns-lambda.ts @@ -11,7 +11,7 @@ class SnsToLambda extends cdk.Stack { const fction = new lambda.Function(this, 'Echo', { handler: 'index.handler', - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, code: lambda.Code.inline(`exports.handler = ${handler.toString()}`) }); @@ -19,7 +19,7 @@ class SnsToLambda extends cdk.Stack { const fctionFiltered = new lambda.Function(this, 'Filtered', { handler: 'index.handler', - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, code: lambda.Code.inline(`exports.handler = ${handler.toString()}`) }); diff --git a/packages/@aws-cdk/aws-sns-subscriptions/test/subs.test.ts b/packages/@aws-cdk/aws-sns-subscriptions/test/subs.test.ts index 9462674ea9709..c7189143fdbd2 100644 --- a/packages/@aws-cdk/aws-sns-subscriptions/test/subs.test.ts +++ b/packages/@aws-cdk/aws-sns-subscriptions/test/subs.test.ts @@ -164,7 +164,7 @@ test('queue subscription (with raw delivery)', () => { test('lambda subscription', () => { const fction = new lambda.Function(stack, 'MyFunc', { - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, handler: 'index.handler', code: lambda.Code.inline('exports.handler = function(e, c, cb) { return cb() }') }); @@ -283,7 +283,7 @@ test('email subscription', () => { test('multiple subscriptions', () => { const queue = new sqs.Queue(stack, 'MyQueue'); const func = new lambda.Function(stack, 'MyFunc', { - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, handler: 'index.handler', code: lambda.Code.inline('exports.handler = function(e, c, cb) { return cb() }') }); @@ -449,7 +449,7 @@ test('throws with mutliple subscriptions of the same subscriber', () => { test('with filter policy', () => { const fction = new lambda.Function(stack, 'MyFunc', { - runtime: lambda.Runtime.Nodejs810, + runtime: lambda.Runtime.NODEJS_8_10, handler: 'index.handler', code: lambda.Code.inline('exports.handler = function(e, c, cb) { return cb() }') }); diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/test/integ.invoke-function.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/test/integ.invoke-function.ts index 144ee8443058f..6d6d69dd892c1 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/test/integ.invoke-function.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/test/integ.invoke-function.ts @@ -10,7 +10,7 @@ const stack = new cdk.Stack(app, 'aws-stepfunctions-integ'); const handler = new Function(stack, 'Handler', { code: Code.asset(path.join(__dirname, 'my-lambda-handler')), handler: 'index.main', - runtime: Runtime.Python36 + runtime: Runtime.PYTHON_3_6 }); const submitJob = new sfn.Task(stack, 'Invoke Handler', { @@ -20,7 +20,7 @@ const submitJob = new sfn.Task(stack, 'Invoke Handler', { const callbackHandler = new Function(stack, 'CallbackHandler', { code: Code.asset(path.join(__dirname, 'my-lambda-handler')), handler: 'index.main', - runtime: Runtime.Python36 + runtime: Runtime.PYTHON_3_6 }); const taskTokenHandler = new sfn.Task(stack, 'Invoke Handler with task token', { diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/test/invoke-function.test.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/test/invoke-function.test.ts index a3a3d6b7d872e..c5ed65f9aae01 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/test/invoke-function.test.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/test/invoke-function.test.ts @@ -11,7 +11,7 @@ beforeEach(() => { fn = new lambda.Function(stack, 'Fn', { code: lambda.Code.inline('hello'), handler: 'index.hello', - runtime: lambda.Runtime.Python27, + runtime: lambda.Runtime.PYTHON_2_7, }); }); diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/test/run-lambda-task.test.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/test/run-lambda-task.test.ts index c190b14ec3872..bf49993b28131 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/test/run-lambda-task.test.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/test/run-lambda-task.test.ts @@ -11,7 +11,7 @@ beforeEach(() => { fn = new lambda.Function(stack, 'Fn', { code: lambda.Code.inline('hello'), handler: 'index.hello', - runtime: lambda.Runtime.Python27, + runtime: lambda.Runtime.PYTHON_2_7, }); }); diff --git a/packages/@aws-cdk/aws-stepfunctions/lib/states/state.ts b/packages/@aws-cdk/aws-stepfunctions/lib/states/state.ts index e683ecfe83819..f978b482dbc6c 100644 --- a/packages/@aws-cdk/aws-stepfunctions/lib/states/state.ts +++ b/packages/@aws-cdk/aws-stepfunctions/lib/states/state.ts @@ -224,7 +224,7 @@ export abstract class State extends cdk.Construct implements IChainable { protected _addRetry(props: RetryProps = {}) { this.retries.push({ ...props, - errors: props.errors ? props.errors : [Errors.All], + errors: props.errors ? props.errors : [Errors.ALL], }); } @@ -236,7 +236,7 @@ export abstract class State extends cdk.Construct implements IChainable { this.catches.push({ next: handler, props: { - errors: props.errors ? props.errors : [Errors.All], + errors: props.errors ? props.errors : [Errors.ALL], resultPath: props.resultPath } }); diff --git a/packages/@aws-cdk/aws-stepfunctions/lib/types.ts b/packages/@aws-cdk/aws-stepfunctions/lib/types.ts index a2a3d31dd1422..a3ce6ae96f946 100644 --- a/packages/@aws-cdk/aws-stepfunctions/lib/types.ts +++ b/packages/@aws-cdk/aws-stepfunctions/lib/types.ts @@ -41,40 +41,40 @@ export class Errors { /** * Matches any Error. */ - public static readonly All = 'States.ALL'; + public static readonly ALL = 'States.ALL'; /** * A Task State either ran longer than the “TimeoutSeconds” value, or * failed to heartbeat for a time longer than the “HeartbeatSeconds” value. */ - public static readonly Timeout = 'States.Timeout'; + public static readonly TIMEOUT = 'States.Timeout'; /** * A Task State failed during the execution. */ - public static readonly TaskFailed = 'States.TaskFailed'; + public static readonly TASKS_FAILED = 'States.TaskFailed'; /** * A Task State failed because it had insufficient privileges to execute * the specified code. */ - public static readonly Permissions = 'States.Permissions'; + public static readonly PERMISSIONS = 'States.Permissions'; /** * A Task State’s “ResultPath” field cannot be applied to the input the state received. */ - public static readonly ResultPathMatchFailure = 'States.ResultPathMatchFailure'; + public static readonly RESULT_PATH_MATCH_FAILURE = 'States.ResultPathMatchFailure'; /** * A branch of a Parallel state failed. */ - public static readonly BranchFailed = 'States.BranchFailed'; + public static readonly BRANCH_FAILED = 'States.BranchFailed'; /** * A Choice state failed to find a match for the condition field extracted * from its input. */ - public static readonly NoChoiceMatched = 'States.NoChoiceMatched'; + public static readonly NO_CHOICE_MATCHED = 'States.NoChoiceMatched'; } /** diff --git a/packages/@aws-cdk/aws-stepfunctions/package.json b/packages/@aws-cdk/aws-stepfunctions/package.json index 135c0b527497e..4e4e710d44478 100644 --- a/packages/@aws-cdk/aws-stepfunctions/package.json +++ b/packages/@aws-cdk/aws-stepfunctions/package.json @@ -90,7 +90,7 @@ "import-props-interface:@aws-cdk/aws-stepfunctions.ActivityImportProps", "export:@aws-cdk/aws-stepfunctions.IActivity", "duration-prop-type:@aws-cdk/aws-stepfunctions.WaitProps.duration", - "duration-prop-type:@aws-cdk/aws-stepfunctions.Errors.Timeout" + "duration-prop-type:@aws-cdk/aws-stepfunctions.Errors.TIMEOUT" ] }, "stability": "experimental" diff --git a/packages/@aws-cdk/core/lib/cfn-pseudo.ts b/packages/@aws-cdk/core/lib/cfn-pseudo.ts index 0985404329453..4326a1ab7eec5 100644 --- a/packages/@aws-cdk/core/lib/cfn-pseudo.ts +++ b/packages/@aws-cdk/core/lib/cfn-pseudo.ts @@ -19,14 +19,14 @@ const AWS_NOVALUE = 'AWS::NoValue'; * values can be obtained as properties from an scoped object. */ export class Aws { - public static readonly accountId = pseudoString(AWS_ACCOUNTID); - public static readonly urlSuffix = pseudoString(AWS_URLSUFFIX); - public static readonly notificationArns = Token.asList({ Ref: AWS_NOTIFICATIONARNS }, { displayHint: AWS_NOTIFICATIONARNS }); - public static readonly partition = pseudoString(AWS_PARTITION); - public static readonly region = pseudoString(AWS_REGION); - public static readonly stackId = pseudoString(AWS_STACKID); - public static readonly stackName = pseudoString(AWS_STACKNAME); - public static readonly noValue = pseudoString(AWS_NOVALUE); + public static readonly ACCOUNT_ID = pseudoString(AWS_ACCOUNTID); + public static readonly URL_SUFFIX = pseudoString(AWS_URLSUFFIX); + public static readonly NOTIFICATION_ARNS = Token.asList({ Ref: AWS_NOTIFICATIONARNS }, { displayHint: AWS_NOTIFICATIONARNS }); + public static readonly PARTITION = pseudoString(AWS_PARTITION); + public static readonly REGION = pseudoString(AWS_REGION); + public static readonly STACK_ID = pseudoString(AWS_STACKID); + public static readonly STACK_NAME = pseudoString(AWS_STACKNAME); + public static readonly NO_VALUE = pseudoString(AWS_NOVALUE); private constructor() { } } diff --git a/packages/@aws-cdk/core/lib/stack.ts b/packages/@aws-cdk/core/lib/stack.ts index a89427d942746..61897f992672e 100644 --- a/packages/@aws-cdk/core/lib/stack.ts +++ b/packages/@aws-cdk/core/lib/stack.ts @@ -288,7 +288,7 @@ export class Stack extends Construct implements ITaggable { // Always return a non-scoped partition intrinsic. These will usually // be used to construct an ARN, but there are no cross-partition // calls anyway. - return Aws.partition; + return Aws.PARTITION; } /** @@ -578,8 +578,8 @@ export class Stack extends Construct implements ITaggable { // they do not need to be scoped, the only situation in which // export/fn::importvalue would work if { Ref: "AWS::AccountId" } is the // same for provider and consumer anyway. - const account = env.account || Aws.accountId; - const region = env.region || Aws.region; + const account = env.account || Aws.ACCOUNT_ID; + const region = env.region || Aws.REGION; // this is the "aws://" env specification that will be written to the cloud assembly // manifest. it will use "unknown-account" and "unknown-region" to indicate diff --git a/packages/@aws-cdk/core/test/test.construct.ts b/packages/@aws-cdk/core/test/test.construct.ts index 932c34590b000..6aa8cfd793209 100644 --- a/packages/@aws-cdk/core/test/test.construct.ts +++ b/packages/@aws-cdk/core/test/test.construct.ts @@ -187,8 +187,8 @@ export = { 'fails if context key contains unresolved tokens'(test: Test) { const root = new Root(); - test.throws(() => root.node.setContext(`my-${Aws.region}`, 'foo'), /Invalid context key/); - test.throws(() => root.node.tryGetContext(Aws.region), /Invalid context key/); + test.throws(() => root.node.setContext(`my-${Aws.REGION}`, 'foo'), /Invalid context key/); + test.throws(() => root.node.tryGetContext(Aws.REGION), /Invalid context key/); test.done(); }, diff --git a/packages/@aws-cdk/core/test/test.environment.ts b/packages/@aws-cdk/core/test/test.environment.ts index a7b65fe7b555a..dee43ed915349 100644 --- a/packages/@aws-cdk/core/test/test.environment.ts +++ b/packages/@aws-cdk/core/test/test.environment.ts @@ -94,8 +94,8 @@ export = { // WHEN const stack = new Stack(app, 'stack', { env: { - account: Aws.accountId, - region: Aws.region + account: Aws.ACCOUNT_ID, + region: Aws.REGION } }); @@ -118,7 +118,7 @@ export = { // WHEN const stack = new Stack(app, 'stack', { env: { - account: Aws.accountId, + account: Aws.ACCOUNT_ID, region: 'us-east-2' } }); diff --git a/packages/@aws-cdk/core/test/test.mappings.ts b/packages/@aws-cdk/core/test/test.mappings.ts index 4aadcd874655e..2218e86515498 100644 --- a/packages/@aws-cdk/core/test/test.mappings.ts +++ b/packages/@aws-cdk/core/test/test.mappings.ts @@ -56,8 +56,8 @@ export = { } }); - const v1 = mapping.findInMap('instanceCount', Aws.region); - const v2 = Fn.findInMap(mapping.logicalId, 'instanceCount', Aws.region); + const v1 = mapping.findInMap('instanceCount', Aws.REGION); + const v2 = Fn.findInMap(mapping.logicalId, 'instanceCount', Aws.REGION); const expected = { 'Fn::FindInMap': [ 'mapping', 'instanceCount', { Ref: 'AWS::Region' } ] }; test.deepEqual(stack.resolve(v1), expected); @@ -77,7 +77,7 @@ export = { }); // WHEN - const v = mapping.findInMap(Aws.region, 'size'); + const v = mapping.findInMap(Aws.REGION, 'size'); // THEN test.deepEqual(stack.resolve(v), { @@ -98,10 +98,10 @@ export = { }); // WHEN - const v = mapping.findInMap('size', Aws.region); + const v = mapping.findInMap('size', Aws.REGION); // THEN - test.throws(() => mapping.findInMap('not-found', Aws.region), /Mapping doesn't contain top-level key 'not-found'/); + test.throws(() => mapping.findInMap('not-found', Aws.REGION), /Mapping doesn't contain top-level key 'not-found'/); test.deepEqual(stack.resolve(v), { 'Fn::FindInMap': [ 'mapping', 'size', { Ref: 'AWS::Region' } ] }); test.done(); }, diff --git a/packages/@aws-cdk/region-info/build-tools/generate-static-data.ts b/packages/@aws-cdk/region-info/build-tools/generate-static-data.ts index a85c5093dc4e6..28e34db03a145 100644 --- a/packages/@aws-cdk/region-info/build-tools/generate-static-data.ts +++ b/packages/@aws-cdk/region-info/build-tools/generate-static-data.ts @@ -57,14 +57,14 @@ async function main(): Promise { for (const region of AWS_REGIONS) { const partition = region.startsWith('cn-') ? 'aws-cn' : 'aws'; - registerFact(region, 'partition', partition); + registerFact(region, 'PARTITION', partition); const domainSuffix = partition === 'aws' ? 'amazonaws.com' : 'amazonaws.com.cn'; - registerFact(region, 'domainSuffix', domainSuffix); + registerFact(region, 'DOMAIN_SUFFIX', domainSuffix); - registerFact(region, 'cdkMetadataResourceAvailable', AWS_CDK_METADATA.has(region) ? 'YES' : 'NO'); + registerFact(region, 'CDK_METADATA_RESOURCE_AVAILABLE', AWS_CDK_METADATA.has(region) ? 'YES' : 'NO'); - registerFact(region, 's3StaticWebsiteEndpoint', AWS_OLDER_REGIONS.has(region) + registerFact(region, 'S3_STATIC_WEBSITE_ENDPOINT', AWS_OLDER_REGIONS.has(region) ? `s3-website-${region}.${domainSuffix}` : `s3-website.${region}.${domainSuffix}`); diff --git a/packages/@aws-cdk/region-info/lib/fact.ts b/packages/@aws-cdk/region-info/lib/fact.ts index e3c01140498ce..b34bd1bc44fad 100644 --- a/packages/@aws-cdk/region-info/lib/fact.ts +++ b/packages/@aws-cdk/region-info/lib/fact.ts @@ -78,23 +78,23 @@ export class FactName { /** * The name of the partition for a region (e.g: 'aws', 'aws-cn', ...) */ - public static readonly partition = 'partition'; + public static readonly PARTITION = 'partition'; /** * The domain suffix for a region (e.g: 'amazonaws.com`) */ - public static readonly domainSuffix = 'domainSuffix'; + public static readonly DOMAIN_SUFFIX = 'domainSuffix'; /** * Whether the AWS::CDK::Metadata CloudFormation Resource is available in-region or not. The value is a boolean * modelled as `YES` or `NO`. */ - public static readonly cdkMetadataResourceAvailable = 'cdk:metadata-resource:available'; + public static readonly CDK_METADATA_RESOURCE_AVAILABLE = 'cdk:metadata-resource:available'; /** * The endpoint used for hosting S3 static websites */ - public static readonly s3StaticWebsiteEndpoint = 's3-static-website:endpoint'; + public static readonly S3_STATIC_WEBSITE_ENDPOINT = 's3-static-website:endpoint'; /** * The name of the regional service principal for a given service. diff --git a/packages/@aws-cdk/region-info/lib/region-info.ts b/packages/@aws-cdk/region-info/lib/region-info.ts index 8135190c116b7..6a63b42f91385 100644 --- a/packages/@aws-cdk/region-info/lib/region-info.ts +++ b/packages/@aws-cdk/region-info/lib/region-info.ts @@ -19,28 +19,28 @@ export class RegionInfo { * Whether the `AWS::CDK::Metadata` CloudFormation Resource is available in this region or not. */ public get cdkMetadataResourceAvailable(): boolean { - return Fact.find(this.name, FactName.cdkMetadataResourceAvailable) === 'YES'; + return Fact.find(this.name, FactName.CDK_METADATA_RESOURCE_AVAILABLE) === 'YES'; } /** * The domain name suffix (e.g: amazonaws.com) for this region. */ public get domainSuffix(): string | undefined { - return Fact.find(this.name, FactName.domainSuffix); + return Fact.find(this.name, FactName.DOMAIN_SUFFIX); } /** * The name of the ARN partition for this region (e.g: aws). */ public get partition(): string | undefined { - return Fact.find(this.name, FactName.partition); + return Fact.find(this.name, FactName.PARTITION); } /** * The endpoint used by S3 static website hosting in this region (e.g: s3-static-website-us-east-1.amazonaws.com) */ public get s3StaticWebsiteEndpoint(): string | undefined { - return Fact.find(this.name, FactName.s3StaticWebsiteEndpoint); + return Fact.find(this.name, FactName.S3_STATIC_WEBSITE_ENDPOINT); } /** diff --git a/packages/@aws-cdk/region-info/test/fact.test.ts b/packages/@aws-cdk/region-info/test/fact.test.ts index af73a3828edf7..382502f8a3bcf 100644 --- a/packages/@aws-cdk/region-info/test/fact.test.ts +++ b/packages/@aws-cdk/region-info/test/fact.test.ts @@ -7,7 +7,7 @@ describe('find', () => { }); test('returns undefined for an unknown region', () => { - expect(Fact.find('bermuda-triangle-42', FactName.partition)).toBe(undefined); + expect(Fact.find('bermuda-triangle-42', FactName.PARTITION)).toBe(undefined); }); }); @@ -50,7 +50,7 @@ describe('register', () => { test('disallows re-registering a fact with a different value', () => { // GIVEN const region = AWS_REGIONS[0]; - const name = FactName.partition; + const name = FactName.PARTITION; const value = '1337'; // WHEN diff --git a/packages/aws-cdk/lib/api/cxapp/stacks.ts b/packages/aws-cdk/lib/api/cxapp/stacks.ts index 74e7e7be74858..3fd78ed659354 100644 --- a/packages/aws-cdk/lib/api/cxapp/stacks.ts +++ b/packages/aws-cdk/lib/api/cxapp/stacks.ts @@ -224,7 +224,7 @@ export class AppStacks { stack.template.Resources = {}; } const resourcePresent = stack.environment.region === 'default-region' - || regionInfo.Fact.find(stack.environment.region, regionInfo.FactName.cdkMetadataResourceAvailable) === 'YES'; + || regionInfo.Fact.find(stack.environment.region, regionInfo.FactName.CDK_METADATA_RESOURCE_AVAILABLE) === 'YES'; if (resourcePresent) { if (!stack.template.Resources.CDKMetadata) { stack.template.Resources.CDKMetadata = { diff --git a/packages/decdk/examples/apigw.json b/packages/decdk/examples/apigw.json index cc491fb954593..458d3abf969e5 100644 --- a/packages/decdk/examples/apigw.json +++ b/packages/decdk/examples/apigw.json @@ -7,7 +7,7 @@ "code": { "asset": { "path": "." } }, - "runtime": "Python36", + "runtime": "PYTHON_3_6", "handler": "index.handler" } }, diff --git a/packages/decdk/examples/lambda-events.json b/packages/decdk/examples/lambda-events.json index b65fd390e5f6b..0c364b1d14dd6 100644 --- a/packages/decdk/examples/lambda-events.json +++ b/packages/decdk/examples/lambda-events.json @@ -18,7 +18,7 @@ "Type": "@aws-cdk/aws-lambda.Function", "Properties": { "handler": "app.hello_handler", - "runtime": "Python36", + "runtime": "PYTHON_3_6", "code": { "asset": { "path": "." } }, diff --git a/packages/decdk/examples/lambda-topic.json b/packages/decdk/examples/lambda-topic.json index 0111ca3520429..073202c663cce 100644 --- a/packages/decdk/examples/lambda-topic.json +++ b/packages/decdk/examples/lambda-topic.json @@ -8,7 +8,7 @@ "Type": "@aws-cdk/aws-lambda.Function", "Properties": { "code": { "asset": { "path": "." } }, - "runtime": "Nodejs", + "runtime": "NODEJS", "handler": "index.handler", "events": [ { "@aws-cdk/aws-lambda-event-sources.SnsEventSource": { "topic": { "Ref": "Topic" } } } diff --git a/tools/awslint/bin/awslint.ts b/tools/awslint/bin/awslint.ts index d34e2d8f3c767..78be924bb9910 100644 --- a/tools/awslint/bin/awslint.ts +++ b/tools/awslint/bin/awslint.ts @@ -6,7 +6,7 @@ import reflect = require('jsii-reflect'); import path = require('path'); import yargs = require('yargs'); import { AggregateLinter, apiLinter, attributesLinter, cfnResourceLinter, constructLinter, DiagnosticLevel, durationsLinter, eventsLinter, exportsLinter, - importsLinter, integrationLinter, moduleLinter, resourceLinter } from '../lib'; + importsLinter, integrationLinter, moduleLinter, publicStaticPropertiesLinter, resourceLinter } from '../lib'; const linter = new AggregateLinter( moduleLinter, @@ -19,7 +19,8 @@ const linter = new AggregateLinter( exportsLinter, eventsLinter, integrationLinter, - durationsLinter + durationsLinter, + publicStaticPropertiesLinter ); let stackTrace = false; diff --git a/tools/awslint/lib/rules/index.ts b/tools/awslint/lib/rules/index.ts index b5fd25c16295a..31998e4f0a0fd 100644 --- a/tools/awslint/lib/rules/index.ts +++ b/tools/awslint/lib/rules/index.ts @@ -9,3 +9,4 @@ export * from './imports'; export * from './integrations'; export * from './module'; export * from './resource'; +export * from './public-static-properties'; diff --git a/tools/awslint/lib/rules/public-static-properties.ts b/tools/awslint/lib/rules/public-static-properties.ts new file mode 100644 index 0000000000000..7f64ba2c5a79c --- /dev/null +++ b/tools/awslint/lib/rules/public-static-properties.ts @@ -0,0 +1,28 @@ +import { Property } from 'jsii-reflect'; +import { Linter } from '../linter'; +import { CoreTypes } from './core-types'; + +const UPPER_SNAKE_CASE_ALLOWED_PATTERN = new RegExp('^[A-Z0-9][A-Z0-9_]*[A-Z0-9]+$'); + +export const publicStaticPropertiesLinter = new Linter(assembly => { + const result = new Array(); + for (const c of assembly.classes) { + // L1 classes are exempted + if (CoreTypes.isCfnResource(c)) { continue; } + for (const property of c.allProperties) { + if (property.const && property.static) { + result.push(property); + } + } + } + return result; +}); + +publicStaticPropertiesLinter.add({ + code: 'public-static-props-all-caps', + message: 'public static properties must be named using ALL_CAPS', + eval: e => { + const name = e.ctx.name; + e.assert(UPPER_SNAKE_CASE_ALLOWED_PATTERN.test(name), `${e.ctx.parentType.fqn}.${name}`); + } +}); \ No newline at end of file