diff --git a/packages/@aws-cdk/app-delivery/test/test.pipeline-deploy-stack-action.ts b/packages/@aws-cdk/app-delivery/test/test.pipeline-deploy-stack-action.ts index 1da595f6aba91..6c4014f2a765e 100644 --- a/packages/@aws-cdk/app-delivery/test/test.pipeline-deploy-stack-action.ts +++ b/packages/@aws-cdk/app-delivery/test/test.pipeline-deploy-stack-action.ts @@ -307,7 +307,7 @@ class FakeAction extends codepipeline.Action { super({ actionName, artifactBounds: { minInputs: 0, maxInputs: 5, minOutputs: 0, maxOutputs: 5 }, - category: codepipeline.ActionCategory.Test, + category: codepipeline.ActionCategory.TEST, provider: 'Test', }); diff --git a/packages/@aws-cdk/aws-apigateway/lib/integration.ts b/packages/@aws-cdk/aws-apigateway/lib/integration.ts index 5883555d69698..306d70b76a19a 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/integration.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/integration.ts @@ -154,12 +154,12 @@ export enum ContentHandling { /** * Converts a request payload from a base64-encoded string to a binary blob. */ - ConvertToBinary = 'CONVERT_TO_BINARY', + CONVERT_TO_BINARY = 'CONVERT_TO_BINARY', /** * Converts a request payload from a binary blob to a base64-encoded string. */ - ConvertToText = 'CONVERT_TO_TEXT' + CONVERT_TO_TEXT = 'CONVERT_TO_TEXT' } export enum IntegrationType { @@ -170,34 +170,34 @@ export enum IntegrationType { * integration. With any other AWS service action, this is known as AWS * integration. */ - Aws = 'AWS', + AWS = 'AWS', /** * For integrating the API method request with the Lambda function-invoking * action with the client request passed through as-is. This integration is * also referred to as the Lambda proxy integration */ - AwsProxy = 'AWS_PROXY', + AWS_PROXY = 'AWS_PROXY', /** * For integrating the API method request with an HTTP endpoint, including a * private HTTP endpoint within a VPC. This integration is also referred to * as the HTTP custom integration. */ - Http = 'HTTP', + HTTP = 'HTTP', /** * For integrating the API method request with an HTTP endpoint, including a * private HTTP endpoint within a VPC, with the client request passed * through as-is. This is also referred to as the HTTP proxy integration */ - HttpProxy = 'HTTP_PROXY', + HTTP_PROXY = 'HTTP_PROXY', /** * For integrating the API method request with API Gateway as a "loop-back" * endpoint without invoking any backend. */ - Mock = 'MOCK' + MOCK = 'MOCK' } export enum PassthroughBehavior { @@ -205,32 +205,32 @@ export enum PassthroughBehavior { * Passes the request body for unmapped content types through to the * integration back end without transformation. */ - WhenNoMatch = 'WHEN_NO_MATCH', + WHEN_NO_MATCH = 'WHEN_NO_MATCH', /** * Rejects unmapped content types with an HTTP 415 'Unsupported Media Type' * response */ - Never = 'NEVER', + NEVER = 'NEVER', /** * Allows pass-through when the integration has NO content types mapped to * templates. However if there is at least one content type defined, * unmapped content types will be rejected with the same 415 response. */ - WhenNoTemplates = 'WHEN_NO_TEMPLATES' + WHEN_NO_TEMPLATES = 'WHEN_NO_TEMPLATES' } export enum ConnectionType { /** * For connections through the public routable internet */ - Internet = 'INTERNET', + INTERNET = 'INTERNET', /** * For private connections between API Gateway and a network load balancer in a VPC */ - VpcLink = 'VPC_LINK' + VPC_LINK = 'VPC_LINK' } export interface IntegrationResponse { diff --git a/packages/@aws-cdk/aws-apigateway/lib/integrations/aws.ts b/packages/@aws-cdk/aws-apigateway/lib/integrations/aws.ts index 5ee538ee60dd0..98ca346586555 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/integrations/aws.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/integrations/aws.ts @@ -74,7 +74,7 @@ export class AwsIntegration extends Integration { constructor(props: AwsIntegrationProps) { const backend = props.subdomain ? `${props.subdomain}.${props.service}` : props.service; - const type = props.proxy ? IntegrationType.AwsProxy : IntegrationType.Aws; + const type = props.proxy ? IntegrationType.AWS_PROXY : IntegrationType.AWS; const { apiType, apiValue } = parseAwsApiCall(props.path, props.action, props.actionParameters); super({ type, diff --git a/packages/@aws-cdk/aws-apigateway/lib/integrations/http.ts b/packages/@aws-cdk/aws-apigateway/lib/integrations/http.ts index d98f0b7853075..fac5bb7cc6800 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/integrations/http.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/integrations/http.ts @@ -41,7 +41,7 @@ export class HttpIntegration extends Integration { const proxy = props.proxy !== undefined ? props.proxy : true; const method = props.httpMethod || 'GET'; super({ - type: proxy ? IntegrationType.HttpProxy : IntegrationType.Http, + type: proxy ? IntegrationType.HTTP_PROXY : IntegrationType.HTTP, integrationHttpMethod: method, uri: url, options: props.options, diff --git a/packages/@aws-cdk/aws-apigateway/lib/integrations/mock.ts b/packages/@aws-cdk/aws-apigateway/lib/integrations/mock.ts index 0c42a30ca111b..f8844d956b1e5 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/integrations/mock.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/integrations/mock.ts @@ -15,7 +15,7 @@ import { Integration, IntegrationOptions, IntegrationType } from '../integration export class MockIntegration extends Integration { constructor(options?: IntegrationOptions) { super({ - type: IntegrationType.Mock, + type: IntegrationType.MOCK, options }); } diff --git a/packages/@aws-cdk/aws-apigateway/lib/method.ts b/packages/@aws-cdk/aws-apigateway/lib/method.ts index 4950b4afa8692..304135163d23e 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/method.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/method.ts @@ -114,7 +114,7 @@ export class Method extends Resource { httpMethod: this.httpMethod, operationName: options.operationName || defaultMethodOptions.operationName, apiKeyRequired: options.apiKeyRequired || defaultMethodOptions.apiKeyRequired, - authorizationType: options.authorizationType || defaultMethodOptions.authorizationType || AuthorizationType.None, + authorizationType: options.authorizationType || defaultMethodOptions.authorizationType || AuthorizationType.NONE, authorizerId: authorizer && authorizer.authorizerId, requestParameters: options.requestParameters, integration: this.renderIntegration(props.integration), @@ -183,11 +183,11 @@ export class Method extends Resource { throw new Error(`'credentialsPassthrough' and 'credentialsRole' are mutually exclusive`); } - if (options.connectionType === ConnectionType.VpcLink && options.vpcLink === undefined) { + if (options.connectionType === ConnectionType.VPC_LINK && options.vpcLink === undefined) { throw new Error(`'connectionType' of VPC_LINK requires 'vpcLink' prop to be set`); } - if (options.connectionType === ConnectionType.Internet && options.vpcLink !== undefined) { + if (options.connectionType === ConnectionType.INTERNET && options.vpcLink !== undefined) { throw new Error(`cannot set 'vpcLink' where 'connectionType' is INTERNET`); } @@ -249,7 +249,7 @@ export enum AuthorizationType { /** * Open access. */ - None = 'NONE', + NONE = 'NONE', /** * Use AWS IAM permissions. @@ -259,10 +259,10 @@ export enum AuthorizationType { /** * Use a custom authorizer. */ - Custom = 'CUSTOM', + CUSTOM = 'CUSTOM', /** * Use an AWS Cognito user pool. */ - Cognito = 'COGNITO_USER_POOLS', + COGNITO = 'COGNITO_USER_POOLS', } diff --git a/packages/@aws-cdk/aws-apigateway/lib/restapi.ts b/packages/@aws-cdk/aws-apigateway/lib/restapi.ts index 77446d59c8610..f09c931ba4f3c 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/restapi.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/restapi.ts @@ -363,29 +363,29 @@ export enum ApiKeySourceType { /** * To read the API key from the `X-API-Key` header of a request. */ - Header = 'HEADER', + HEADER = 'HEADER', /** * To read the API key from the `UsageIdentifierKey` from a custom authorizer. */ - Authorizer = 'AUTHORIZER', + AUTHORIZER = 'AUTHORIZER', } export enum EndpointType { /** * For an edge-optimized API and its custom domain name. */ - Edge = 'EDGE', + EDGE = 'EDGE', /** * For a regional API and its custom domain name. */ - Regional = 'REGIONAL', + REGIONAL = 'REGIONAL', /** * For a private API and its custom domain name. */ - Private = 'PRIVATE' + PRIVATE = 'PRIVATE' } class RootResource extends ResourceBase { diff --git a/packages/@aws-cdk/aws-apigateway/lib/stage.ts b/packages/@aws-cdk/aws-apigateway/lib/stage.ts index d89961bbdf2d7..6af6431c85759 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/stage.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/stage.ts @@ -85,9 +85,9 @@ export interface StageProps extends StageOptions { } export enum MethodLoggingLevel { - Off = 'OFF', - Error = 'ERROR', - Info = 'INFO' + OFF = 'OFF', + ERROR = 'ERROR', + INFO = 'INFO' } export interface MethodDeploymentOptions { diff --git a/packages/@aws-cdk/aws-apigateway/lib/usage-plan.ts b/packages/@aws-cdk/aws-apigateway/lib/usage-plan.ts index 7bd58584ebb6f..f71e452210378 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/usage-plan.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/usage-plan.ts @@ -29,9 +29,9 @@ export interface ThrottleSettings { * Time period for which quota settings apply. */ export enum Period { - Day = 'DAY', - Week = 'WEEK', - Month = 'MONTH' + DAY = 'DAY', + WEEK = 'WEEK', + MONTH = 'MONTH' } /** @@ -76,7 +76,7 @@ export interface ThrottlingPerMethod { } /** - * Type of Usage Plan Key. Currently the only supported type is 'API_KEY' + * Type of Usage Plan Key. Currently the only supported type is 'ApiKey' */ export enum UsagePlanKeyType { ApiKey = 'API_KEY' diff --git a/packages/@aws-cdk/aws-apigateway/test/integ.restapi.ts b/packages/@aws-cdk/aws-apigateway/test/integ.restapi.ts index 91815bffd75d5..9babade508096 100644 --- a/packages/@aws-cdk/aws-apigateway/test/integ.restapi.ts +++ b/packages/@aws-cdk/aws-apigateway/test/integ.restapi.ts @@ -12,7 +12,7 @@ class Test extends cdk.Stack { cacheClusterEnabled: true, stageName: 'beta', description: 'beta stage', - loggingLevel: apigateway.MethodLoggingLevel.Info, + loggingLevel: apigateway.MethodLoggingLevel.INFO, dataTraceEnabled: true, methodOptions: { '/api/appliances/GET': { @@ -61,7 +61,7 @@ class Test extends cdk.Stack { throttle: { rateLimit: 5 }, quota: { limit: 10000, - period: apigateway.Period.Month + period: apigateway.Period.MONTH } }); plan.addApiStage({ diff --git a/packages/@aws-cdk/aws-apigateway/test/test.method.ts b/packages/@aws-cdk/aws-apigateway/test/test.method.ts index 8897601bcdbe0..839c438398ce3 100644 --- a/packages/@aws-cdk/aws-apigateway/test/test.method.ts +++ b/packages/@aws-cdk/aws-apigateway/test/test.method.ts @@ -112,7 +112,7 @@ export = { 'use default integration from api'(test: Test) { // GIVEN const stack = new cdk.Stack(); - const defaultIntegration = new apigateway.Integration({ type: apigateway.IntegrationType.HttpProxy, uri: 'https://amazon.com' }); + const defaultIntegration = new apigateway.Integration({ type: apigateway.IntegrationType.HTTP_PROXY, uri: 'https://amazon.com' }); const api = new apigateway.RestApi(stack, 'test-api', { cloudWatchRole: false, deploy: false, @@ -223,7 +223,7 @@ export = { // WHEN api.root.addMethod('GET', new apigateway.Integration({ - type: apigateway.IntegrationType.AwsProxy, + type: apigateway.IntegrationType.AWS_PROXY, options: { credentialsRole: role } @@ -245,7 +245,7 @@ export = { // WHEN api.root.addMethod('GET', new apigateway.Integration({ - type: apigateway.IntegrationType.AwsProxy, + type: apigateway.IntegrationType.AWS_PROXY, options: { credentialsPassthrough: true } @@ -268,7 +268,7 @@ export = { // WHEN const integration = new apigateway.Integration({ - type: apigateway.IntegrationType.AwsProxy, + type: apigateway.IntegrationType.AWS_PROXY, options: { credentialsPassthrough: true, credentialsRole: role @@ -287,10 +287,10 @@ export = { // WHEN const integration = new apigateway.Integration({ - type: apigateway.IntegrationType.HttpProxy, + type: apigateway.IntegrationType.HTTP_PROXY, integrationHttpMethod: 'ANY', options: { - connectionType: ConnectionType.VpcLink, + connectionType: ConnectionType.VPC_LINK, } }); @@ -313,10 +313,10 @@ export = { // WHEN const integration = new apigateway.Integration({ - type: apigateway.IntegrationType.HttpProxy, + type: apigateway.IntegrationType.HTTP_PROXY, integrationHttpMethod: 'ANY', options: { - connectionType: ConnectionType.Internet, + connectionType: ConnectionType.INTERNET, vpcLink: link } }); diff --git a/packages/@aws-cdk/aws-apigateway/test/test.restapi.ts b/packages/@aws-cdk/aws-apigateway/test/test.restapi.ts index c3fccb0313578..c6b31a0f00402 100644 --- a/packages/@aws-cdk/aws-apigateway/test/test.restapi.ts +++ b/packages/@aws-cdk/aws-apigateway/test/test.restapi.ts @@ -460,7 +460,7 @@ export = { // WHEN const api = new apigateway.RestApi(stack, 'api', { - endpointTypes: [ apigateway.EndpointType.Edge, apigateway.EndpointType.Private ] + endpointTypes: [ apigateway.EndpointType.EDGE, apigateway.EndpointType.PRIVATE ] }); api.root.addMethod('GET'); @@ -547,7 +547,7 @@ export = { // CASE #2: should inherit integration from root and method options, but // "authorizationType" will be overridden to "None" instead of "IAM" child.addMethod('POST', undefined, { - authorizationType: apigateway.AuthorizationType.Cognito + authorizationType: apigateway.AuthorizationType.COGNITO }); const child2 = api.root.addResource('child2', { diff --git a/packages/@aws-cdk/aws-apigateway/test/test.stage.ts b/packages/@aws-cdk/aws-apigateway/test/test.stage.ts index 6aef209a42fc3..fa55e46b0013d 100644 --- a/packages/@aws-cdk/aws-apigateway/test/test.stage.ts +++ b/packages/@aws-cdk/aws-apigateway/test/test.stage.ts @@ -78,7 +78,7 @@ export = { // WHEN new apigateway.Stage(stack, 'my-stage', { deployment, - loggingLevel: apigateway.MethodLoggingLevel.Info, + loggingLevel: apigateway.MethodLoggingLevel.INFO, throttlingRateLimit: 12 }); @@ -107,11 +107,11 @@ export = { // WHEN new apigateway.Stage(stack, 'my-stage', { deployment, - loggingLevel: apigateway.MethodLoggingLevel.Info, + loggingLevel: apigateway.MethodLoggingLevel.INFO, throttlingRateLimit: 12, methodOptions: { '/goo/bar/GET': { - loggingLevel: apigateway.MethodLoggingLevel.Error, + loggingLevel: apigateway.MethodLoggingLevel.ERROR, } } }); diff --git a/packages/@aws-cdk/aws-apigateway/test/test.usage-plan.ts b/packages/@aws-cdk/aws-apigateway/test/test.usage-plan.ts index f8e89653bf311..883f672fc999f 100644 --- a/packages/@aws-cdk/aws-apigateway/test/test.usage-plan.ts +++ b/packages/@aws-cdk/aws-apigateway/test/test.usage-plan.ts @@ -90,7 +90,7 @@ export = { new apigateway.UsagePlan(stack, 'my-usage-plan', { quota: { limit: 10000, - period: apigateway.Period.Month + period: apigateway.Period.MONTH } }); diff --git a/packages/@aws-cdk/aws-applicationautoscaling/lib/scalable-target.ts b/packages/@aws-cdk/aws-applicationautoscaling/lib/scalable-target.ts index 23cd71a20e33a..0710b4c399202 100644 --- a/packages/@aws-cdk/aws-applicationautoscaling/lib/scalable-target.ts +++ b/packages/@aws-cdk/aws-applicationautoscaling/lib/scalable-target.ts @@ -219,40 +219,40 @@ export enum ServiceNamespace { /** * Elastic Container Service */ - Ecs = 'ecs', + ECS = 'ecs', /** * Elastic Map Reduce */ - ElasticMapReduce = 'elasticmapreduce', + ELASTIC_MAP_REDUCE = 'elasticmapreduce', /** * Elastic Compute Cloud */ - Ec2 = 'ec2', + EC2 = 'ec2', /** * App Stream */ - AppStream = 'appstream', + APPSTREAM = 'appstream', /** * Dynamo DB */ - DynamoDb = 'dynamodb', + DYNAMODB = 'dynamodb', /** * Relational Database Service */ - Rds = 'rds', + RDS = 'rds', /** * SageMaker */ - SageMaker = 'sagemaker', + SAGEMAKER = 'sagemaker', /** * Custom Resource */ - CustomResource = 'custom-resource', + CUSTOM_RESOURCE = 'custom-resource', } diff --git a/packages/@aws-cdk/aws-applicationautoscaling/lib/step-scaling-action.ts b/packages/@aws-cdk/aws-applicationautoscaling/lib/step-scaling-action.ts index a77b9860ebaf2..94b5868a363c6 100644 --- a/packages/@aws-cdk/aws-applicationautoscaling/lib/step-scaling-action.ts +++ b/packages/@aws-cdk/aws-applicationautoscaling/lib/step-scaling-action.ts @@ -120,7 +120,7 @@ export enum AdjustmentType { * * A positive number increases capacity, a negative number decreases capacity. */ - ChangeInCapacity = 'ChangeInCapacity', + CHANGE_IN_CAPACITY = 'ChangeInCapacity', /** * Add this percentage of the current capacity to itself. @@ -128,12 +128,12 @@ export enum AdjustmentType { * The number must be between -100 and 100; a positive number increases * capacity and a negative number decreases it. */ - PercentChangeInCapacity = 'PercentChangeInCapacity', + PERCENT_CHANGE_IN_CAPACITY = 'PercentChangeInCapacity', /** * Make the capacity equal to the exact number given. */ - ExactCapacity = 'ExactCapacity', + EXACT_CAPACITY = 'ExactCapacity', } /** @@ -143,17 +143,17 @@ export enum MetricAggregationType { /** * Average */ - Average = 'Average', + AVERAGE = 'Average', /** * Minimum */ - Minimum = 'Minimum', + MINIMUM = 'Minimum', /** * Maximum */ - Maximum = 'Maximum' + MAXIMUM = 'Maximum' } /** diff --git a/packages/@aws-cdk/aws-applicationautoscaling/lib/step-scaling-policy.ts b/packages/@aws-cdk/aws-applicationautoscaling/lib/step-scaling-policy.ts index 6c314e036ff5f..3e354476637a0 100644 --- a/packages/@aws-cdk/aws-applicationautoscaling/lib/step-scaling-policy.ts +++ b/packages/@aws-cdk/aws-applicationautoscaling/lib/step-scaling-policy.ts @@ -75,8 +75,8 @@ export class StepScalingPolicy extends cdk.Construct { throw new Error('You must supply at least 2 intervals for autoscaling'); } - const adjustmentType = props.adjustmentType || AdjustmentType.ChangeInCapacity; - const changesAreAbsolute = adjustmentType === AdjustmentType.ExactCapacity; + const adjustmentType = props.adjustmentType || AdjustmentType.CHANGE_IN_CAPACITY; + const changesAreAbsolute = adjustmentType === AdjustmentType.EXACT_CAPACITY; const intervals = normalizeIntervals(props.scalingSteps, changesAreAbsolute); const alarms = findAlarmThresholds(intervals); @@ -104,7 +104,7 @@ export class StepScalingPolicy extends cdk.Construct { metric: props.metric, periodSec: 60, // Recommended by AutoScaling alarmDescription: 'Lower threshold scaling alarm', - comparisonOperator: cloudwatch.ComparisonOperator.LessThanOrEqualToThreshold, + comparisonOperator: cloudwatch.ComparisonOperator.LESS_THAN_OR_EQUAL_TO_THRESHOLD, evaluationPeriods: 1, threshold, }); @@ -134,7 +134,7 @@ export class StepScalingPolicy extends cdk.Construct { metric: props.metric, periodSec: 60, // Recommended by AutoScaling alarmDescription: 'Upper threshold scaling alarm', - comparisonOperator: cloudwatch.ComparisonOperator.GreaterThanOrEqualToThreshold, + comparisonOperator: cloudwatch.ComparisonOperator.GREATER_THAN_OR_EQUAL_TO_THRESHOLD, evaluationPeriods: 1, threshold, }); @@ -184,11 +184,11 @@ function aggregationTypeFromMetric(metric: cloudwatch.IMetric): MetricAggregatio const statistic = metric.toAlarmConfig().statistic; switch (statistic) { case 'Average': - return MetricAggregationType.Average; + return MetricAggregationType.AVERAGE; case 'Minimum': - return MetricAggregationType.Minimum; + return MetricAggregationType.MINIMUM; case 'Maximum': - return MetricAggregationType.Maximum; + return MetricAggregationType.MAXIMUM; default: throw new Error(`Cannot only scale on 'Minimum', 'Maximum', 'Average' metrics, got ${statistic}`); } diff --git a/packages/@aws-cdk/aws-applicationautoscaling/lib/target-tracking-scaling-policy.ts b/packages/@aws-cdk/aws-applicationautoscaling/lib/target-tracking-scaling-policy.ts index 158f4eda1a59e..7e305ea6571a7 100644 --- a/packages/@aws-cdk/aws-applicationautoscaling/lib/target-tracking-scaling-policy.ts +++ b/packages/@aws-cdk/aws-applicationautoscaling/lib/target-tracking-scaling-policy.ts @@ -166,15 +166,15 @@ function renderCustomMetric(metric?: cloudwatch.IMetric): CfnScalingPolicy.Custo * One of the predefined autoscaling metrics */ export enum PredefinedMetric { - DynamoDBReadCapacityUtilization = 'DynamoDBReadCapacityUtilization', - DynamoDBWriteCapacityUtilization = 'DynamoDBWriteCapacityUtilization', - ALBRequestCountPerTarget = 'ALBRequestCountPerTarget', - RDSReaderAverageCPUUtilization = 'RDSReaderAverageCPUUtilization', - RDSReaderAverageDatabaseConnections = 'RDSReaderAverageDatabaseConnections', - EC2SpotFleetRequestAverageCPUUtilization = 'EC2SpotFleetRequestAverageCPUUtilization', - EC2SpotFleetRequestAverageNetworkIn = 'EC2SpotFleetRequestAverageNetworkIn', - EC2SpotFleetRequestAverageNetworkOut = 'EC2SpotFleetRequestAverageNetworkOut', - SageMakerVariantInvocationsPerInstance = 'SageMakerVariantInvocationsPerInstance', - ECSServiceAverageCPUUtilization = 'ECSServiceAverageCPUUtilization', - ECSServiceAverageMemoryUtilization = 'ECSServiceAverageMemoryUtilization', + DYNAMODB_READ_CAPACITY_UTILIZATION = 'DynamoDBReadCapacityUtilization', + DYANMODB_WRITE_CAPACITY_UTILIZATION = 'DynamoDBWriteCapacityUtilization', + ALB_REQUEST_COUNT_PER_TARGET = 'ALBRequestCountPerTarget', + RDS_READER_AVERAGE_CPU_UTILIZATION = 'RDSReaderAverageCPUUtilization', + RDS_READER_AVERAGE_DATABASE_CONNECTIONS = 'RDSReaderAverageDatabaseConnections', + EC2_SPOT_FLEET_REQUEST_AVERAGE_CPU_UTILIZATION = 'EC2SpotFleetRequestAverageCPUUtilization', + EC2_SPOT_FLEET_REQUEST_AVERAGE_NETWORK_IN = 'EC2SpotFleetRequestAverageNetworkIn', + EC2_SPOT_FLEET_REQUEST_AVERAGE_NETWORK_OUT = 'EC2SpotFleetRequestAverageNetworkOut', + SAGEMAKER_VARIANT_INVOCATIONS_PER_INSTANCE = 'SageMakerVariantInvocationsPerInstance', + ECS_SERVICE_AVERAGE_CPU_UTILIZATION = 'ECSServiceAverageCPUUtilization', + ECS_SERVICE_AVERAGE_MEMORY_UTILIZATION = 'ECSServiceAverageMemoryUtilization', } diff --git a/packages/@aws-cdk/aws-applicationautoscaling/test/test.scalable-target.ts b/packages/@aws-cdk/aws-applicationautoscaling/test/test.scalable-target.ts index c798f5d2f5d7a..4c1df119a9e78 100644 --- a/packages/@aws-cdk/aws-applicationautoscaling/test/test.scalable-target.ts +++ b/packages/@aws-cdk/aws-applicationautoscaling/test/test.scalable-target.ts @@ -11,7 +11,7 @@ export = { // WHEN new appscaling.ScalableTarget(stack, 'Target', { - serviceNamespace: appscaling.ServiceNamespace.DynamoDb, + serviceNamespace: appscaling.ServiceNamespace.DYNAMODB, scalableDimension: 'test:TestCount', resourceId: 'test:this/test', minCapacity: 1, diff --git a/packages/@aws-cdk/aws-applicationautoscaling/test/test.target-tracking.ts b/packages/@aws-cdk/aws-applicationautoscaling/test/test.target-tracking.ts index 3d7cdff38ee2a..9b0b55162d68d 100644 --- a/packages/@aws-cdk/aws-applicationautoscaling/test/test.target-tracking.ts +++ b/packages/@aws-cdk/aws-applicationautoscaling/test/test.target-tracking.ts @@ -13,7 +13,7 @@ export = { // WHEN target.scaleToTrackMetric('Tracking', { - predefinedMetric: appscaling.PredefinedMetric.EC2SpotFleetRequestAverageCPUUtilization, + predefinedMetric: appscaling.PredefinedMetric.EC2_SPOT_FLEET_REQUEST_AVERAGE_CPU_UTILIZATION, targetValue: 30, }); diff --git a/packages/@aws-cdk/aws-applicationautoscaling/test/util.ts b/packages/@aws-cdk/aws-applicationautoscaling/test/util.ts index 9b6a20a960d54..1292cffccbdb4 100644 --- a/packages/@aws-cdk/aws-applicationautoscaling/test/util.ts +++ b/packages/@aws-cdk/aws-applicationautoscaling/test/util.ts @@ -6,7 +6,7 @@ import { ServiceNamespace } from '../lib'; export function createScalableTarget(scope: cdk.Construct) { return new appscaling.ScalableTarget(scope, 'Target', { - serviceNamespace: ServiceNamespace.DynamoDb, + serviceNamespace: ServiceNamespace.DYNAMODB, scalableDimension: 'test:TestCount', resourceId: 'test:this/test', minCapacity: 1, 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 90d47d423d184..76507c15fe11c 100644 --- a/packages/@aws-cdk/aws-autoscaling-hooktargets/test/hooks.test.ts +++ b/packages/@aws-cdk/aws-autoscaling-hooktargets/test/hooks.test.ts @@ -28,7 +28,7 @@ describe('given an AutoScalingGroup', () => { // WHEN asg.addLifecycleHook('Trans', { - lifecycleTransition: autoscaling.LifecycleTransition.InstanceLaunching, + lifecycleTransition: autoscaling.LifecycleTransition.INSTANCE_LAUNCHING, notificationTarget: new hooks.QueueHook(queue), }); @@ -43,7 +43,7 @@ describe('given an AutoScalingGroup', () => { // WHEN asg.addLifecycleHook('Trans', { - lifecycleTransition: autoscaling.LifecycleTransition.InstanceLaunching, + lifecycleTransition: autoscaling.LifecycleTransition.INSTANCE_LAUNCHING, notificationTarget: new hooks.TopicHook(topic), }); @@ -63,7 +63,7 @@ describe('given an AutoScalingGroup', () => { // WHEN asg.addLifecycleHook('Trans', { - lifecycleTransition: autoscaling.LifecycleTransition.InstanceLaunching, + lifecycleTransition: autoscaling.LifecycleTransition.INSTANCE_LAUNCHING, notificationTarget: new hooks.FunctionHook(fn), }); diff --git a/packages/@aws-cdk/aws-autoscaling/lib/auto-scaling-group.ts b/packages/@aws-cdk/aws-autoscaling/lib/auto-scaling-group.ts index 55c723bf8393d..7d837a925a28a 100644 --- a/packages/@aws-cdk/aws-autoscaling/lib/auto-scaling-group.ts +++ b/packages/@aws-cdk/aws-autoscaling/lib/auto-scaling-group.ts @@ -225,7 +225,7 @@ abstract class AutoScalingGroupBase extends Resource implements IAutoScalingGrou public scaleOnCpuUtilization(id: string, props: CpuUtilizationScalingProps): TargetTrackingScalingPolicy { return new TargetTrackingScalingPolicy(this, `ScalingPolicy${id}`, { autoScalingGroup: this, - predefinedMetric: PredefinedMetric.ASGAverageCPUUtilization, + predefinedMetric: PredefinedMetric.ASG_AVERAGE_CPU_UTILIZATION, targetValue: props.targetUtilizationPercent, ...props }); @@ -237,7 +237,7 @@ abstract class AutoScalingGroupBase extends Resource implements IAutoScalingGrou public scaleOnIncomingBytes(id: string, props: NetworkUtilizationScalingProps): TargetTrackingScalingPolicy { return new TargetTrackingScalingPolicy(this, `ScalingPolicy${id}`, { autoScalingGroup: this, - predefinedMetric: PredefinedMetric.ASGAverageNetworkIn, + predefinedMetric: PredefinedMetric.ASG_AVERAGE_NETWORK_IN, targetValue: props.targetBytesPerSecond, ...props }); @@ -249,7 +249,7 @@ abstract class AutoScalingGroupBase extends Resource implements IAutoScalingGrou public scaleOnOutgoingBytes(id: string, props: NetworkUtilizationScalingProps): TargetTrackingScalingPolicy { return new TargetTrackingScalingPolicy(this, `ScalingPolicy${id}`, { autoScalingGroup: this, - predefinedMetric: PredefinedMetric.ASGAverageNetworkOut, + predefinedMetric: PredefinedMetric.ASG_AVERAGE_NETWORK_OUT, targetValue: props.targetBytesPerSecond, ...props }); @@ -270,7 +270,7 @@ abstract class AutoScalingGroupBase extends Resource implements IAutoScalingGrou const policy = new TargetTrackingScalingPolicy(this, `ScalingPolicy${id}`, { autoScalingGroup: this, - predefinedMetric: PredefinedMetric.ALBRequestCountPerTarget, + predefinedMetric: PredefinedMetric.ALB_REQUEST_COUNT_PER_TARGET, targetValue: props.targetRequestsPerSecond, resourceLabel, ...props @@ -506,7 +506,7 @@ export class AutoScalingGroup extends AutoScalingGroupBase implements * Apply CloudFormation update policies for the AutoScalingGroup */ private applyUpdatePolicies(props: AutoScalingGroupProps) { - if (props.updateType === UpdateType.ReplacingUpdate) { + if (props.updateType === UpdateType.REPLACING_UPDATE) { this.autoScalingGroup.options.updatePolicy = { ...this.autoScalingGroup.options.updatePolicy, autoScalingReplacingUpdate: { @@ -527,7 +527,7 @@ export class AutoScalingGroup extends AutoScalingGroupBase implements } }; } - } else if (props.updateType === UpdateType.RollingUpdate) { + } else if (props.updateType === UpdateType.ROLLING_UPDATE) { this.autoScalingGroup.options.updatePolicy = { ...this.autoScalingGroup.options.updatePolicy, autoScalingRollingUpdate: renderRollingUpdateConfig(props.rollingUpdateConfiguration) @@ -561,19 +561,19 @@ export enum UpdateType { /** * Don't do anything */ - None = 'None', + NONE = 'None', /** * Replace the entire AutoScalingGroup * * Builds a new AutoScalingGroup first, then delete the old one. */ - ReplacingUpdate = 'Replace', + REPLACING_UPDATE = 'Replace', /** * Replace the instances in the AutoScalingGroup. */ - RollingUpdate = 'RollingUpdate', + ROLLING_UPDATE = 'RollingUpdate', } /** @@ -652,14 +652,14 @@ export interface RollingUpdateConfiguration { } export enum ScalingProcess { - Launch = 'Launch', - Terminate = 'Terminate', - HealthCheck = 'HealthCheck', - ReplaceUnhealthy = 'ReplaceUnhealthy', - AZRebalance = 'AZRebalance', - AlarmNotification = 'AlarmNotification', - ScheduledActions = 'ScheduledActions', - AddToLoadBalancer = 'AddToLoadBalancer' + LAUNCH = 'Launch', + TERMINATE = 'Terminate', + HEALTH_CHECK = 'HealthCheck', + REPLACE_UNHEALTHY = 'ReplaceUnhealthy', + AZ_REBALANCE = 'AZRebalance', + ALARM_NOTIFICATION = 'AlarmNotification', + SCHEDULED_ACTIONS = 'ScheduledActions', + ADD_TO_LOAD_BALANCER = 'AddToLoadBalancer' } /** @@ -678,8 +678,8 @@ function renderRollingUpdateConfig(config: RollingUpdateConfiguration = {}): Aut suspendProcesses: config.suspendProcesses !== undefined ? config.suspendProcesses : // Recommended list of processes to suspend from here: // https://aws.amazon.com/premiumsupport/knowledge-center/auto-scaling-group-rolling-updates/ - [ScalingProcess.HealthCheck, ScalingProcess.ReplaceUnhealthy, ScalingProcess.AZRebalance, - ScalingProcess.AlarmNotification, ScalingProcess.ScheduledActions], + [ScalingProcess.HEALTH_CHECK, ScalingProcess.REPLACE_UNHEALTHY, ScalingProcess.AZ_REBALANCE, + ScalingProcess.ALARM_NOTIFICATION, ScalingProcess.SCHEDULED_ACTIONS], }; } diff --git a/packages/@aws-cdk/aws-autoscaling/lib/lifecycle-hook.ts b/packages/@aws-cdk/aws-autoscaling/lib/lifecycle-hook.ts index 175742dbc96ff..95ff67ffba3f6 100644 --- a/packages/@aws-cdk/aws-autoscaling/lib/lifecycle-hook.ts +++ b/packages/@aws-cdk/aws-autoscaling/lib/lifecycle-hook.ts @@ -123,8 +123,8 @@ export class LifecycleHook extends Resource implements ILifecycleHook { } export enum DefaultResult { - Continue = 'CONTINUE', - Abandon = 'ABANDON', + CONTINUE = 'CONTINUE', + ABANDON = 'ABANDON', } /** @@ -134,10 +134,10 @@ export enum LifecycleTransition { /** * Execute the hook when an instance is about to be added */ - InstanceLaunching = 'autoscaling:EC2_INSTANCE_LAUNCHING', + INSTANCE_LAUNCHING = 'autoscaling:EC2_INSTANCE_LAUNCHING', /** * Execute the hook when an instance is about to be terminated */ - InstanceTerminating = 'autoscaling:EC2_INSTANCE_TERMINATING', + INSTANCE_TERMINATING = 'autoscaling:EC2_INSTANCE_TERMINATING', } diff --git a/packages/@aws-cdk/aws-autoscaling/lib/step-scaling-action.ts b/packages/@aws-cdk/aws-autoscaling/lib/step-scaling-action.ts index fd8a8215006aa..38b4109dfd2d8 100644 --- a/packages/@aws-cdk/aws-autoscaling/lib/step-scaling-action.ts +++ b/packages/@aws-cdk/aws-autoscaling/lib/step-scaling-action.ts @@ -108,7 +108,7 @@ export enum AdjustmentType { * * A positive number increases capacity, a negative number decreases capacity. */ - ChangeInCapacity = 'ChangeInCapacity', + CHANGE_IN_CAPACITY = 'ChangeInCapacity', /** * Add this percentage of the current capacity to itself. @@ -116,12 +116,12 @@ export enum AdjustmentType { * The number must be between -100 and 100; a positive number increases * capacity and a negative number decreases it. */ - PercentChangeInCapacity = 'PercentChangeInCapacity', + PERCENT_CHANGE_IN_CAPACITY = 'PercentChangeInCapacity', /** * Make the capacity equal to the exact number given. */ - ExactCapacity = 'ExactCapacity', + EXACT_CAPACITY = 'ExactCapacity', } /** @@ -131,17 +131,17 @@ export enum MetricAggregationType { /** * Average */ - Average = 'Average', + AVERAGE = 'Average', /** * Minimum */ - Minimum = 'Minimum', + MINIMUM = 'Minimum', /** * Maximum */ - Maximum = 'Maximum' + MAXIMUM = 'Maximum' } /** diff --git a/packages/@aws-cdk/aws-autoscaling/lib/step-scaling-policy.ts b/packages/@aws-cdk/aws-autoscaling/lib/step-scaling-policy.ts index c91e1098f6cdd..854b296dd28a9 100644 --- a/packages/@aws-cdk/aws-autoscaling/lib/step-scaling-policy.ts +++ b/packages/@aws-cdk/aws-autoscaling/lib/step-scaling-policy.ts @@ -76,8 +76,8 @@ export class StepScalingPolicy extends cdk.Construct { throw new Error('You must supply at least 2 intervals for autoscaling'); } - const adjustmentType = props.adjustmentType || AdjustmentType.ChangeInCapacity; - const changesAreAbsolute = adjustmentType === AdjustmentType.ExactCapacity; + const adjustmentType = props.adjustmentType || AdjustmentType.CHANGE_IN_CAPACITY; + const changesAreAbsolute = adjustmentType === AdjustmentType.EXACT_CAPACITY; const intervals = normalizeIntervals(props.scalingSteps, changesAreAbsolute); const alarms = findAlarmThresholds(intervals); @@ -105,7 +105,7 @@ export class StepScalingPolicy extends cdk.Construct { metric: props.metric, periodSec: 60, // Recommended by AutoScaling alarmDescription: 'Lower threshold scaling alarm', - comparisonOperator: cloudwatch.ComparisonOperator.LessThanOrEqualToThreshold, + comparisonOperator: cloudwatch.ComparisonOperator.LESS_THAN_OR_EQUAL_TO_THRESHOLD, evaluationPeriods: 1, threshold, }); @@ -136,7 +136,7 @@ export class StepScalingPolicy extends cdk.Construct { metric: props.metric, periodSec: 60, // Recommended by AutoScaling alarmDescription: 'Upper threshold scaling alarm', - comparisonOperator: cloudwatch.ComparisonOperator.GreaterThanOrEqualToThreshold, + comparisonOperator: cloudwatch.ComparisonOperator.GREATER_THAN_OR_EQUAL_TO_THRESHOLD, evaluationPeriods: 1, threshold, }); @@ -149,11 +149,11 @@ function aggregationTypeFromMetric(metric: cloudwatch.IMetric): MetricAggregatio const statistic = metric.toAlarmConfig().statistic; switch (statistic) { case 'Average': - return MetricAggregationType.Average; + return MetricAggregationType.AVERAGE; case 'Minimum': - return MetricAggregationType.Minimum; + return MetricAggregationType.MINIMUM; case 'Maximum': - return MetricAggregationType.Maximum; + return MetricAggregationType.MAXIMUM; default: throw new Error(`Cannot only scale on 'Minimum', 'Maximum', 'Average' metrics, got ${statistic}`); } diff --git a/packages/@aws-cdk/aws-autoscaling/lib/target-tracking-scaling-policy.ts b/packages/@aws-cdk/aws-autoscaling/lib/target-tracking-scaling-policy.ts index 1f2ed373787b6..77ee46ad820c2 100644 --- a/packages/@aws-cdk/aws-autoscaling/lib/target-tracking-scaling-policy.ts +++ b/packages/@aws-cdk/aws-autoscaling/lib/target-tracking-scaling-policy.ts @@ -121,7 +121,7 @@ export class TargetTrackingScalingPolicy extends cdk.Construct { throw new RangeError(`estimatedInstanceWarmupSeconds cannot be negative, got: ${props.estimatedInstanceWarmupSeconds}`); } - if (props.predefinedMetric === PredefinedMetric.ALBRequestCountPerTarget && !props.resourceLabel) { + if (props.predefinedMetric === PredefinedMetric.ALB_REQUEST_COUNT_PER_TARGET && !props.resourceLabel) { throw new Error('When tracking the ALBRequestCountPerTarget metric, the ALB identifier must be supplied in resourceLabel'); } @@ -171,22 +171,22 @@ export enum PredefinedMetric { /** * Average CPU utilization of the Auto Scaling group */ - ASGAverageCPUUtilization = 'ASGAverageCPUUtilization', + ASG_AVERAGE_CPU_UTILIZATION = 'ASGAverageCPUUtilization', /** * Average number of bytes received on all network interfaces by the Auto Scaling group */ - ASGAverageNetworkIn = 'ASGAverageNetworkIn', + ASG_AVERAGE_NETWORK_IN = 'ASGAverageNetworkIn', /** * Average number of bytes sent out on all network interfaces by the Auto Scaling group */ - ASGAverageNetworkOut = 'ASGAverageNetworkOut', + ASG_AVERAGE_NETWORK_OUT = 'ASGAverageNetworkOut', /** * Number of requests completed per target in an Application Load Balancer target group * * Specify the ALB to look at in the `resourceLabel` field. */ - ALBRequestCountPerTarget = 'ALBRequestCountPerTarget', + ALB_REQUEST_COUNT_PER_TARGET = 'ALBRequestCountPerTarget', } diff --git a/packages/@aws-cdk/aws-autoscaling/test/example.images.lit.ts b/packages/@aws-cdk/aws-autoscaling/test/example.images.lit.ts index 68f7fbe6ae212..156e2745b6828 100644 --- a/packages/@aws-cdk/aws-autoscaling/test/example.images.lit.ts +++ b/packages/@aws-cdk/aws-autoscaling/test/example.images.lit.ts @@ -2,15 +2,15 @@ import ec2 = require("@aws-cdk/aws-ec2"); /// !show // Pick a Windows edition to use -const windows = new ec2.WindowsImage(ec2.WindowsVersion.WindowsServer2019EnglishFullBase); +const windows = new ec2.WindowsImage(ec2.WindowsVersion.WINDOWS_SERVER_2019_ENGLISH_FULL_BASE); // Pick the right Amazon Linux edition. All arguments shown are optional // and will default to these values when omitted. const amznLinux = new ec2.AmazonLinuxImage({ - generation: ec2.AmazonLinuxGeneration.AmazonLinux, - edition: ec2.AmazonLinuxEdition.Standard, + generation: ec2.AmazonLinuxGeneration.AMAZON_LINUX, + edition: ec2.AmazonLinuxEdition.STANDARD, virtualization: ec2.AmazonLinuxVirt.HVM, - storage: ec2.AmazonLinuxStorage.GeneralPurpose, + storage: ec2.AmazonLinuxStorage.GENERAL_PURPOSE, }); // For other custom (Linux) images, instantiate a `GenericLinuxImage` with diff --git a/packages/@aws-cdk/aws-autoscaling/test/integ.amazonlinux2.ts b/packages/@aws-cdk/aws-autoscaling/test/integ.amazonlinux2.ts index d812205407785..b85e65649f059 100644 --- a/packages/@aws-cdk/aws-autoscaling/test/integ.amazonlinux2.ts +++ b/packages/@aws-cdk/aws-autoscaling/test/integ.amazonlinux2.ts @@ -12,8 +12,8 @@ const vpc = new ec2.Vpc(stack, 'VPC', { new autoscaling.AutoScalingGroup(stack, 'Fleet', { vpc, - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.Burstable2, ec2.InstanceSize.Micro), - machineImage: new ec2.AmazonLinuxImage({ generation: ec2.AmazonLinuxGeneration.AmazonLinux2 }), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.MICRO), + machineImage: new ec2.AmazonLinuxImage({ generation: ec2.AmazonLinuxGeneration.AMAZON_LINUX_2 }), }); app.synth(); diff --git a/packages/@aws-cdk/aws-autoscaling/test/integ.asg-w-classic-loadbalancer.ts b/packages/@aws-cdk/aws-autoscaling/test/integ.asg-w-classic-loadbalancer.ts index 458f420512b2e..00f141a7872e0 100644 --- a/packages/@aws-cdk/aws-autoscaling/test/integ.asg-w-classic-loadbalancer.ts +++ b/packages/@aws-cdk/aws-autoscaling/test/integ.asg-w-classic-loadbalancer.ts @@ -13,7 +13,7 @@ const vpc = new ec2.Vpc(stack, 'VPC', { const asg = new autoscaling.AutoScalingGroup(stack, 'Fleet', { vpc, - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.Burstable2, ec2.InstanceSize.Micro), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.MICRO), machineImage: new ec2.AmazonLinuxImage(), }); diff --git a/packages/@aws-cdk/aws-autoscaling/test/integ.asg-w-elbv2.ts b/packages/@aws-cdk/aws-autoscaling/test/integ.asg-w-elbv2.ts index e9e30f9712e3e..905468709bf1e 100644 --- a/packages/@aws-cdk/aws-autoscaling/test/integ.asg-w-elbv2.ts +++ b/packages/@aws-cdk/aws-autoscaling/test/integ.asg-w-elbv2.ts @@ -13,7 +13,7 @@ const vpc = new ec2.Vpc(stack, 'VPC', { const asg = new autoscaling.AutoScalingGroup(stack, 'Fleet', { vpc, - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.Burstable2, ec2.InstanceSize.Micro), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.MICRO), machineImage: new ec2.AmazonLinuxImage(), }); diff --git a/packages/@aws-cdk/aws-autoscaling/test/integ.custom-scaling.ts b/packages/@aws-cdk/aws-autoscaling/test/integ.custom-scaling.ts index fcadadbe0d545..9f79543d36767 100644 --- a/packages/@aws-cdk/aws-autoscaling/test/integ.custom-scaling.ts +++ b/packages/@aws-cdk/aws-autoscaling/test/integ.custom-scaling.ts @@ -12,8 +12,8 @@ const vpc = new ec2.Vpc(stack, 'VPC', { const asg = new autoscaling.AutoScalingGroup(stack, 'Fleet', { vpc, - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.Burstable2, ec2.InstanceSize.Micro), - machineImage: new ec2.AmazonLinuxImage({ generation: ec2.AmazonLinuxGeneration.AmazonLinux2 }), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.MICRO), + machineImage: new ec2.AmazonLinuxImage({ generation: ec2.AmazonLinuxGeneration.AMAZON_LINUX_2 }), }); asg.scaleOnSchedule('ScaleUpInTheMorning', { diff --git a/packages/@aws-cdk/aws-autoscaling/test/integ.external-role.ts b/packages/@aws-cdk/aws-autoscaling/test/integ.external-role.ts index 25748bd083fd0..6612ea50bbe8f 100644 --- a/packages/@aws-cdk/aws-autoscaling/test/integ.external-role.ts +++ b/packages/@aws-cdk/aws-autoscaling/test/integ.external-role.ts @@ -13,7 +13,7 @@ class TestStack extends cdk.Stack { }); new asg.AutoScalingGroup(this, 'ASG', { - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.T2, ec2.InstanceSize.Micro), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.T2, ec2.InstanceSize.MICRO), vpc, machineImage: new ec2.AmazonLinuxImage(), role diff --git a/packages/@aws-cdk/aws-autoscaling/test/integ.spot-instances.ts b/packages/@aws-cdk/aws-autoscaling/test/integ.spot-instances.ts index e57731e277472..114cf2f4c2fb0 100644 --- a/packages/@aws-cdk/aws-autoscaling/test/integ.spot-instances.ts +++ b/packages/@aws-cdk/aws-autoscaling/test/integ.spot-instances.ts @@ -12,8 +12,8 @@ const vpc = new ec2.Vpc(stack, 'VPC', { new autoscaling.AutoScalingGroup(stack, 'Fleet', { vpc, - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.Burstable2, ec2.InstanceSize.Micro), - machineImage: new ec2.AmazonLinuxImage({ generation: ec2.AmazonLinuxGeneration.AmazonLinux2 }), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.MICRO), + machineImage: new ec2.AmazonLinuxImage({ generation: ec2.AmazonLinuxGeneration.AMAZON_LINUX_2 }), spotPrice: '0.20' }); diff --git a/packages/@aws-cdk/aws-autoscaling/test/test.auto-scaling-group.ts b/packages/@aws-cdk/aws-autoscaling/test/test.auto-scaling-group.ts index 1327627868723..2e2780bfb276e 100644 --- a/packages/@aws-cdk/aws-autoscaling/test/test.auto-scaling-group.ts +++ b/packages/@aws-cdk/aws-autoscaling/test/test.auto-scaling-group.ts @@ -13,7 +13,7 @@ export = { const vpc = mockVpc(stack); new autoscaling.AutoScalingGroup(stack, 'MyFleet', { - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.Micro), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.MICRO), machineImage: new ec2.AmazonLinuxImage(), vpc }); @@ -137,7 +137,7 @@ export = { const vpc = mockVpc(stack); new autoscaling.AutoScalingGroup(stack, 'MyFleet', { - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.Micro), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.MICRO), machineImage: new ec2.AmazonLinuxImage(), vpc, minCapacity: 0, @@ -162,7 +162,7 @@ export = { // WHEN new autoscaling.AutoScalingGroup(stack, 'MyFleet', { - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.Micro), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.MICRO), machineImage: new ec2.AmazonLinuxImage(), vpc, minCapacity: 10 @@ -186,7 +186,7 @@ export = { // WHEN new autoscaling.AutoScalingGroup(stack, 'MyFleet', { - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.Micro), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.MICRO), machineImage: new ec2.AmazonLinuxImage(), vpc, maxCapacity: 10 @@ -210,7 +210,7 @@ export = { // WHEN new autoscaling.AutoScalingGroup(stack, 'MyFleet', { - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.Micro), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.MICRO), machineImage: new ec2.AmazonLinuxImage(), vpc, desiredCapacity: 10 @@ -232,7 +232,7 @@ export = { const vpc = mockVpc(stack); const fleet = new autoscaling.AutoScalingGroup(stack, 'MyFleet', { - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.Micro), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.MICRO), machineImage: new ec2.AmazonLinuxImage(), vpc }); @@ -264,10 +264,10 @@ export = { // WHEN new autoscaling.AutoScalingGroup(stack, 'MyFleet', { - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.Micro), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.MICRO), machineImage: new ec2.AmazonLinuxImage(), vpc, - updateType: autoscaling.UpdateType.ReplacingUpdate, + updateType: autoscaling.UpdateType.REPLACING_UPDATE, replacingUpdateMinSuccessfulInstancesPercent: 50 }); @@ -295,10 +295,10 @@ export = { // WHEN new autoscaling.AutoScalingGroup(stack, 'MyFleet', { - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.Micro), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.MICRO), machineImage: new ec2.AmazonLinuxImage(), vpc, - updateType: autoscaling.UpdateType.RollingUpdate, + updateType: autoscaling.UpdateType.ROLLING_UPDATE, rollingUpdateConfiguration: { minSuccessfulInstancesPercent: 50, pauseTimeSec: 345 @@ -327,7 +327,7 @@ export = { // WHEN new autoscaling.AutoScalingGroup(stack, 'MyFleet', { - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.Micro), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.MICRO), machineImage: new ec2.AmazonLinuxImage(), vpc, resourceSignalCount: 5, @@ -354,7 +354,7 @@ export = { // WHEN const asg = new autoscaling.AutoScalingGroup(stack, 'MyFleet', { - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.Micro), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.MICRO), machineImage: new ec2.AmazonLinuxImage(), vpc, }); @@ -380,10 +380,10 @@ export = { // WHEN const asg = new autoscaling.AutoScalingGroup(stack, 'MyFleet', { - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.Micro), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.MICRO), machineImage: new ec2.AmazonLinuxImage(), vpc, - updateType: autoscaling.UpdateType.RollingUpdate, + updateType: autoscaling.UpdateType.ROLLING_UPDATE, rollingUpdateConfiguration: { minSuccessfulInstancesPercent: 50, pauseTimeSec: 345 @@ -422,7 +422,7 @@ export = { // WHEN new autoscaling.AutoScalingGroup(stack, 'MyStack', { - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.Micro), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.MICRO), machineImage: new ec2.AmazonLinuxImage(), vpc, @@ -444,14 +444,14 @@ export = { // WHEN new autoscaling.AutoScalingGroup(stack, 'MyStack', { - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.Micro), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.MICRO), machineImage: new ec2.AmazonLinuxImage(), vpc, minCapacity: 0, maxCapacity: 0, desiredCapacity: 0, - vpcSubnets: { subnetType: ec2.SubnetType.Public }, + vpcSubnets: { subnetType: ec2.SubnetType.PUBLIC }, associatePublicIpAddress: true, }); @@ -471,7 +471,7 @@ export = { // WHEN test.throws(() => { new autoscaling.AutoScalingGroup(stack, 'MyStack', { - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.Micro), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.MICRO), machineImage: new ec2.AmazonLinuxImage(), vpc, minCapacity: 0, @@ -490,7 +490,7 @@ export = { // WHEN new autoscaling.AutoScalingGroup(stack, 'MyStack', { - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.Micro), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.MICRO), machineImage: new ec2.AmazonLinuxImage(), vpc, minCapacity: 0, @@ -514,7 +514,7 @@ export = { // WHEN new autoscaling.AutoScalingGroup(stack, 'MyStack', { - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.Micro), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.MICRO), machineImage: new ec2.AmazonLinuxImage(), vpc, minCapacity: 0, @@ -544,7 +544,7 @@ export = { // WHEN const asg = new autoscaling.AutoScalingGroup(stack, 'MyASG', { vpc, - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.Micro), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.MICRO), machineImage: new ec2.AmazonLinuxImage(), role: importedRole }); diff --git a/packages/@aws-cdk/aws-autoscaling/test/test.lifecyclehooks.ts b/packages/@aws-cdk/aws-autoscaling/test/test.lifecyclehooks.ts index d1b56d3328c78..d462ddd42b473 100644 --- a/packages/@aws-cdk/aws-autoscaling/test/test.lifecyclehooks.ts +++ b/packages/@aws-cdk/aws-autoscaling/test/test.lifecyclehooks.ts @@ -13,15 +13,15 @@ export = { const vpc = new ec2.Vpc(stack, 'VPC'); const asg = new autoscaling.AutoScalingGroup(stack, 'ASG', { vpc, - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.Micro), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.MICRO), machineImage: new ec2.AmazonLinuxImage(), }); // WHEN asg.addLifecycleHook('Transition', { notificationTarget: new FakeNotificationTarget(), - lifecycleTransition: autoscaling.LifecycleTransition.InstanceLaunching, - defaultResult: autoscaling.DefaultResult.Abandon, + lifecycleTransition: autoscaling.LifecycleTransition.INSTANCE_LAUNCHING, + defaultResult: autoscaling.DefaultResult.ABANDON, }); // THEN diff --git a/packages/@aws-cdk/aws-autoscaling/test/test.scaling.ts b/packages/@aws-cdk/aws-autoscaling/test/test.scaling.ts index d24151415fd9e..92fa2d1aac61d 100644 --- a/packages/@aws-cdk/aws-autoscaling/test/test.scaling.ts +++ b/packages/@aws-cdk/aws-autoscaling/test/test.scaling.ts @@ -233,7 +233,7 @@ class ASGFixture extends cdk.Construct { this.vpc = new ec2.Vpc(this, 'VPC'); this.asg = new autoscaling.AutoScalingGroup(this, 'ASG', { vpc: this.vpc, - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.Micro), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.MICRO), machineImage: new ec2.AmazonLinuxImage(), }); } diff --git a/packages/@aws-cdk/aws-autoscaling/test/test.scheduled-action.ts b/packages/@aws-cdk/aws-autoscaling/test/test.scheduled-action.ts index 76bb56827422c..27a2b8fef4969 100644 --- a/packages/@aws-cdk/aws-autoscaling/test/test.scheduled-action.ts +++ b/packages/@aws-cdk/aws-autoscaling/test/test.scheduled-action.ts @@ -108,6 +108,6 @@ function makeAutoScalingGroup(scope: cdk.Construct) { vpc, instanceType: new ec2.InstanceType('t2.micro'), machineImage: new ec2.AmazonLinuxImage(), - updateType: autoscaling.UpdateType.RollingUpdate, + updateType: autoscaling.UpdateType.ROLLING_UPDATE, }); } diff --git a/packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts b/packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts index 75753c2ebf3c9..3823553af8704 100644 --- a/packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts +++ b/packages/@aws-cdk/aws-cloudfront/lib/web_distribution.ts @@ -13,18 +13,18 @@ export enum HttpVersion { * The price class determines how many edge locations CloudFront will use for your distribution. */ export enum PriceClass { - PriceClass100 = "PriceClass_100", - PriceClass200 = "PriceClass_200", - PriceClassAll = "PriceClass_All" + PRICE_CLASS_100 = "PriceClass_100", + PRICE_CLASS_200 = "PriceClass_200", + PRICE_CLASS_ALL = "PriceClass_All" } /** * How HTTPs should be handled with your distribution. */ export enum ViewerProtocolPolicy { - HTTPSOnly = "https-only", - RedirectToHTTPS = "redirect-to-https", - AllowAll = "allow-all" + HTTPS_ONLY = "https-only", + REDIRECT_TO_HTTPS = "redirect-to-https", + ALLOW_ALL = "allow-all" } /** @@ -95,11 +95,11 @@ export enum SSLMethod { * CloudFront serves your objects only to browsers or devices that support at least the SSL version that you specify. */ export enum SecurityPolicyProtocol { - SSLv3 = "SSLv3", - TLSv1 = "TLSv1", - TLSv1_2016 = "TLSv1_2016", - TLSv1_1_2016 = "TLSv1.1_2016", - TLSv1_2_2018 = "TLSv1.2_2018" + SSL_V3 = "SSLv3", + TLS_V1 = "TLSv1", + TLS_V1_2016 = "TLSv1_2016", + TLS_V1_1_2016 = "TLSv1.1_2016", + TLS_V1_2_2018 = "TLSv1.2_2018" } /** @@ -222,16 +222,16 @@ export interface CustomOriginConfig { } export enum OriginSslPolicy { - SSLv3 = "SSLv3", - TLSv1 = "TLSv1", - TLSv1_1 = "TLSv1.1", - TLSv1_2 = "TLSv1.2", + SSL_V3 = "SSLv3", + TLS_V1 = "TLSv1", + TLS_V1_1 = "TLSv1.1", + TLS_V1_2 = "TLSv1.2", } export enum OriginProtocolPolicy { - HttpOnly = "http-only", - MatchViewer = "match-viewer", - HttpsOnly = "https-only", + HTTP_ONLY = "http-only", + MATCH_VIEWER = "match-viewer", + HTTPS_ONLY = "https-only", } export interface S3OriginConfig { @@ -373,20 +373,20 @@ export enum LambdaEdgeEventType { * The origin-request specifies the request to the * origin location (e.g. S3) */ - OriginRequest = "origin-request", + ORIGIN_REQUEST = "origin-request", /** * The origin-response specifies the response from the * origin location (e.g. S3) */ - OriginResponse = "origin-response", + ORIGIN_RESPONSE = "origin-response", /** * The viewer-request specifies the incoming request */ - ViewerRequest = "viewer-request", + VIEWER_REQUEST = "viewer-request", /** * The viewer-response specifies the outgoing reponse */ - ViewerResponse = "viewer-response", + VIEWER_RESPONSE = "viewer-response", } export interface ErrorConfiguration { @@ -563,10 +563,10 @@ export class CloudFrontWebDistribution extends cdk.Construct implements IDistrib */ private readonly VALID_SSL_PROTOCOLS: { [key: string]: string[] } = { "sni-only": [ - SecurityPolicyProtocol.TLSv1, SecurityPolicyProtocol.TLSv1_1_2016, - SecurityPolicyProtocol.TLSv1_2016, SecurityPolicyProtocol.TLSv1_2_2018 + SecurityPolicyProtocol.TLS_V1, SecurityPolicyProtocol.TLS_V1_1_2016, + SecurityPolicyProtocol.TLS_V1_2016, SecurityPolicyProtocol.TLS_V1_2_2018 ], - "vip": [SecurityPolicyProtocol.SSLv3, SecurityPolicyProtocol.TLSv1], + "vip": [SecurityPolicyProtocol.SSL_V3, SecurityPolicyProtocol.TLS_V1], }; constructor(scope: cdk.Construct, id: string, props: CloudFrontWebDistributionProps) { @@ -577,7 +577,7 @@ export class CloudFrontWebDistribution extends cdk.Construct implements IDistrib enabled: true, defaultRootObject: props.defaultRootObject !== undefined ? props.defaultRootObject : "index.html", httpVersion: props.httpVersion || HttpVersion.HTTP2, - priceClass: props.priceClass || PriceClass.PriceClass100, + priceClass: props.priceClass || PriceClass.PRICE_CLASS_100, ipv6Enabled: (props.enableIpV6 !== undefined) ? props.enableIpV6 : true, // tslint:disable-next-line:max-line-length customErrorResponses: props.errorConfigurations, // TODO: validation : https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-customerrorresponse.html#cfn-cloudfront-distribution-customerrorresponse-errorcachingminttl @@ -627,8 +627,8 @@ export class CloudFrontWebDistribution extends cdk.Construct implements IDistrib httpsPort: originConfig.customOriginSource.httpsPort || 443, originKeepaliveTimeout: originConfig.customOriginSource.originKeepaliveTimeoutSeconds || 5, originReadTimeout: originConfig.customOriginSource.originReadTimeoutSeconds || 30, - originProtocolPolicy: originConfig.customOriginSource.originProtocolPolicy || OriginProtocolPolicy.HttpsOnly, - originSslProtocols: originConfig.customOriginSource.allowedOriginSSLVersions || [OriginSslPolicy.TLSv1_2] + originProtocolPolicy: originConfig.customOriginSource.originProtocolPolicy || OriginProtocolPolicy.HTTPS_ONLY, + originSslProtocols: originConfig.customOriginSource.allowedOriginSSLVersions || [OriginSslPolicy.TLS_V1_2] } : undefined }; @@ -729,7 +729,7 @@ export class CloudFrontWebDistribution extends cdk.Construct implements IDistrib minTtl: input.minTtlSeconds, trustedSigners: input.trustedSigners, targetOriginId: input.targetOriginId, - viewerProtocolPolicy: protoPolicy || ViewerProtocolPolicy.RedirectToHTTPS, + viewerProtocolPolicy: protoPolicy || ViewerProtocolPolicy.REDIRECT_TO_HTTPS, }; if (!input.isDefaultBehavior) { toReturn = Object.assign(toReturn, { pathPattern: input.pathPattern }); 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 231e42ffab952..a77e9d6da3b5e 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 @@ -28,7 +28,7 @@ new cloudfront.CloudFrontWebDistribution(stack, 'MyDistribution', { s3BucketSource: sourceBucket }, behaviors : [ {isDefaultBehavior: true, lambdaFunctionAssociations: [{ - eventType: cloudfront.LambdaEdgeEventType.OriginRequest, + eventType: cloudfront.LambdaEdgeEventType.ORIGIN_REQUEST, lambdaFunction: lambdaVersion }]}] } diff --git a/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-security-policy.ts b/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-security-policy.ts index 7857fe03c6cb4..36eb03784c4f6 100644 --- a/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-security-policy.ts +++ b/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-security-policy.ts @@ -26,7 +26,7 @@ new cloudfront.CloudFrontWebDistribution(stack, 'AnAmazingWebsiteProbably', { acmCertRef: 'testACM', names: ['test.test.com'], sslMethod: cloudfront.SSLMethod.SNI, - securityPolicy: cloudfront.SecurityPolicyProtocol.TLSv1 + securityPolicy: cloudfront.SecurityPolicyProtocol.TLS_V1 } }); diff --git a/packages/@aws-cdk/aws-cloudfront/test/test.basic.ts b/packages/@aws-cdk/aws-cloudfront/test/test.basic.ts index 37fa731d04e03..78d3f1c5fa145 100644 --- a/packages/@aws-cdk/aws-cloudfront/test/test.basic.ts +++ b/packages/@aws-cdk/aws-cloudfront/test/test.basic.ts @@ -252,7 +252,7 @@ export = { const sourceBucket = new s3.Bucket(stack, 'Bucket'); new CloudFrontWebDistribution(stack, 'AnAmazingWebsiteProbably', { - viewerProtocolPolicy: ViewerProtocolPolicy.AllowAll, + viewerProtocolPolicy: ViewerProtocolPolicy.ALLOW_ALL, originConfigs: [ { s3OriginSource: { diff --git a/packages/@aws-cdk/aws-cloudtrail/lib/index.ts b/packages/@aws-cdk/aws-cloudtrail/lib/index.ts index e5b9a83167750..dc76d342c39a3 100644 --- a/packages/@aws-cdk/aws-cloudtrail/lib/index.ts +++ b/packages/@aws-cdk/aws-cloudtrail/lib/index.ts @@ -96,9 +96,9 @@ export interface TrailProps { } export enum ReadWriteType { - ReadOnly = "ReadOnly", - WriteOnly = "WriteOnly", - All = "All" + READ_ONLY = "ReadOnly", + WRITE_ONLY = "WriteOnly", + ALL = "All" } /** @@ -129,7 +129,7 @@ export class Trail extends Resource { physicalName: props.trailName, }); - const s3bucket = new s3.Bucket(this, 'S3', {encryption: s3.BucketEncryption.Unencrypted}); + const s3bucket = new s3.Bucket(this, 'S3', {encryption: s3.BucketEncryption.UNENCRYPTED}); const cloudTrailPrincipal = new iam.ServicePrincipal("cloudtrail.amazonaws.com"); s3bucket.addToResourcePolicy(new iam.PolicyStatement({ @@ -151,7 +151,7 @@ export class Trail extends Resource { let logsRole: iam.IRole | undefined; if (props.sendToCloudWatchLogs) { logGroup = new logs.CfnLogGroup(this, "LogGroup", { - retentionInDays: props.cloudWatchLogsRetentionTimeDays || logs.RetentionDays.OneYear + retentionInDays: props.cloudWatchLogsRetentionTimeDays || logs.RetentionDays.ONE_YEAR }); logsRole = new iam.Role(this, 'LogsRole', { assumedBy: cloudTrailPrincipal }); diff --git a/packages/@aws-cdk/aws-cloudtrail/test/test.cloudtrail.ts b/packages/@aws-cdk/aws-cloudtrail/test/test.cloudtrail.ts index ade48de2167f9..3955ebc2c0488 100644 --- a/packages/@aws-cdk/aws-cloudtrail/test/test.cloudtrail.ts +++ b/packages/@aws-cdk/aws-cloudtrail/test/test.cloudtrail.ts @@ -106,7 +106,7 @@ export = { const stack = getTestStack(); new Trail(stack, 'MyAmazingCloudTrail', { sendToCloudWatchLogs: true, - cloudWatchLogsRetentionTimeDays: RetentionDays.OneWeek + cloudWatchLogsRetentionTimeDays: RetentionDays.ONE_WEEK }); expect(stack).to(haveResource("AWS::CloudTrail::Trail")); @@ -153,7 +153,7 @@ export = { const stack = getTestStack(); const cloudTrail = new Trail(stack, 'MyAmazingCloudTrail'); - cloudTrail.addS3EventSelector(["arn:aws:s3:::"], { includeManagementEvents: false, readWriteType: ReadWriteType.ReadOnly }); + cloudTrail.addS3EventSelector(["arn:aws:s3:::"], { includeManagementEvents: false, readWriteType: ReadWriteType.READ_ONLY }); expect(stack).to(haveResource("AWS::CloudTrail::Trail")); expect(stack).to(haveResource("AWS::S3::Bucket")); @@ -178,7 +178,7 @@ export = { 'with management event'(test: Test) { const stack = getTestStack(); - new Trail(stack, 'MyAmazingCloudTrail', { managementEvents: ReadWriteType.WriteOnly }); + new Trail(stack, 'MyAmazingCloudTrail', { managementEvents: ReadWriteType.WRITE_ONLY }); const trail: any = SynthUtils.synthesize(stack).template.Resources.MyAmazingCloudTrail54516E8D; test.equals(trail.Properties.EventSelectors.length, 1); @@ -194,7 +194,7 @@ export = { 'add an event rule'(test: Test) { // GIVEN const stack = getTestStack(); - const trail = new Trail(stack, 'MyAmazingCloudTrail', { managementEvents: ReadWriteType.WriteOnly }); + const trail = new Trail(stack, 'MyAmazingCloudTrail', { managementEvents: ReadWriteType.WRITE_ONLY }); // WHEN trail.onCloudTrailEvent('DoEvents', { diff --git a/packages/@aws-cdk/aws-cloudwatch-actions/test/appscaling.test.ts b/packages/@aws-cdk/aws-cloudwatch-actions/test/appscaling.test.ts index 4e0c0a510c29b..28c50c1792825 100644 --- a/packages/@aws-cdk/aws-cloudwatch-actions/test/appscaling.test.ts +++ b/packages/@aws-cdk/aws-cloudwatch-actions/test/appscaling.test.ts @@ -12,7 +12,7 @@ test('can use topic as alarm action', () => { maxCapacity: 100, resourceId: 'asdf', scalableDimension: 'height', - serviceNamespace: appscaling.ServiceNamespace.CustomResource, + serviceNamespace: appscaling.ServiceNamespace.CUSTOM_RESOURCE, }); const action = new appscaling.StepScalingAction(stack, 'Action', { scalingTarget, diff --git a/packages/@aws-cdk/aws-cloudwatch/lib/alarm.ts b/packages/@aws-cdk/aws-cloudwatch/lib/alarm.ts index d29c9783f5b83..7ee032f5bf6bc 100644 --- a/packages/@aws-cdk/aws-cloudwatch/lib/alarm.ts +++ b/packages/@aws-cdk/aws-cloudwatch/lib/alarm.ts @@ -35,10 +35,10 @@ export interface AlarmProps extends CreateAlarmOptions { * Comparison operator for evaluating alarms */ export enum ComparisonOperator { - GreaterThanOrEqualToThreshold = 'GreaterThanOrEqualToThreshold', - GreaterThanThreshold = 'GreaterThanThreshold', - LessThanThreshold = 'LessThanThreshold', - LessThanOrEqualToThreshold = 'LessThanOrEqualToThreshold', + GREATER_THAN_OR_EQUAL_TO_THRESHOLD = 'GreaterThanOrEqualToThreshold', + GREATER_THAN_THRESHOLD = 'GreaterThanThreshold', + LESS_THAN_THRESHOLD = 'LessThanThreshold', + LESS_THAN_OR_EQUAL_TO_THRESHOLD = 'LessThanOrEqualToThreshold', } const OPERATOR_SYMBOLS: {[key: string]: string} = { @@ -55,22 +55,22 @@ export enum TreatMissingData { /** * Missing data points are treated as breaching the threshold */ - Breaching = 'breaching', + BREACHING = 'breaching', /** * Missing data points are treated as being within the threshold */ - NotBreaching = 'notBreaching', + NOT_BREACHING = 'notBreaching', /** * The current alarm state is maintained */ - Ignore = 'ignore', + IGNORE = 'ignore', /** * The alarm does not consider missing data points when evaluating whether to change state */ - Missing = 'missing' + MISSING = 'missing' } /** @@ -119,7 +119,7 @@ export class Alarm extends Resource implements IAlarm { physicalName: props.alarmName, }); - const comparisonOperator = props.comparisonOperator || ComparisonOperator.GreaterThanOrEqualToThreshold; + const comparisonOperator = props.comparisonOperator || ComparisonOperator.GREATER_THAN_OR_EQUAL_TO_THRESHOLD; const config = props.metric.toAlarmConfig(); diff --git a/packages/@aws-cdk/aws-cloudwatch/lib/dashboard.ts b/packages/@aws-cdk/aws-cloudwatch/lib/dashboard.ts index 6c7501138c983..44e6e1815d46c 100644 --- a/packages/@aws-cdk/aws-cloudwatch/lib/dashboard.ts +++ b/packages/@aws-cdk/aws-cloudwatch/lib/dashboard.ts @@ -4,8 +4,8 @@ import { Column, Row } from "./layout"; import { IWidget } from "./widget"; export enum PeriodOverride { - Auto = 'auto', - Inherit = 'inherit', + AUTO = 'auto', + INHERIT = 'inherit', } export interface DashboardProps { diff --git a/packages/@aws-cdk/aws-cloudwatch/lib/graph.ts b/packages/@aws-cdk/aws-cloudwatch/lib/graph.ts index aea30abd66927..0c30441ea4865 100644 --- a/packages/@aws-cdk/aws-cloudwatch/lib/graph.ts +++ b/packages/@aws-cdk/aws-cloudwatch/lib/graph.ts @@ -272,17 +272,17 @@ export enum Shading { /** * Don't add shading */ - None = 'none', + NONE = 'none', /** * Add shading above the annotation */ - Above = 'above', + ABOVE = 'above', /** * Add shading below the annotation */ - Below = 'below' + BELOW = 'below' } function mapAnnotation(yAxis: string): ((x: HorizontalAnnotation) => any) { diff --git a/packages/@aws-cdk/aws-cloudwatch/lib/metric-types.ts b/packages/@aws-cdk/aws-cloudwatch/lib/metric-types.ts index d813a7dfbe8a9..5a3d90895ecfe 100644 --- a/packages/@aws-cdk/aws-cloudwatch/lib/metric-types.ts +++ b/packages/@aws-cdk/aws-cloudwatch/lib/metric-types.ts @@ -33,44 +33,44 @@ export interface Dimension { * Statistic to use over the aggregation period */ export enum Statistic { - SampleCount = 'SampleCount', - Average = 'Average', - Sum = 'Sum', - Minimum = 'Minimum', - Maximum = 'Maximum', + SAMPLE_COUNT = 'SampleCount', + AVERAGE = 'Average', + SUM = 'Sum', + MINIMUM = 'Minimum', + MAXIMUM = 'Maximum', } /** * Unit for metric */ export enum Unit { - Seconds = 'Seconds', - Microseconds = 'Microseconds', - Milliseconds = 'Milliseconds', - Bytes_ = 'Bytes', - Kilobytes = 'Kilobytes', - Megabytes = 'Megabytes', - Gigabytes = 'Gigabytes', - Terabytes = 'Terabytes', - Bits = 'Bits', - Kilobits = 'Kilobits', - Megabits = 'Megabits', - Gigabits = 'Gigabits', - Terabits = 'Terabits', - Percent = 'Percent', - Count = 'Count', - BytesPerSecond = 'Bytes/Second', - KilobytesPerSecond = 'Kilobytes/Second', - MegabytesPerSecond = 'Megabytes/Second', - GigabytesPerSecond = 'Gigabytes/Second', - TerabytesPerSecond = 'Terabytes/Second', - BitsPerSecond = 'Bits/Second', - KilobitsPerSecond = 'Kilobits/Second', - MegabitsPerSecond = 'Megabits/Second', - GigabitsPerSecond = 'Gigabits/Second', - TerabitsPerSecond = 'Terabits/Second', - CountPerSecond = 'Count/Second', - None = 'None' + SECONDS = 'Seconds', + MICROSECONDS = 'Microseconds', + MILLISECONDS = 'Milliseconds', + BYTES = 'Bytes', + KILOBYTES = 'Kilobytes', + MEGABYTES = 'Megabytes', + GIGABYTES = 'Gigabytes', + TERABYTES = 'Terabytes', + BITS = 'Bits', + KILOBITS = 'Kilobits', + MEGABITS = 'Megabits', + GIGABITS = 'Gigabits', + TERABITS = 'Terabits', + PERCENT = 'Percent', + COUNT = 'Count', + BYTES_PER_SECOND = 'Bytes/Second', + KILOBYTES_PER_SECOND = 'Kilobytes/Second', + MEGABYTES_PER_SECOND = 'Megabytes/Second', + GIGABYTES_PER_SECOND = 'Gigabytes/Second', + TERABYTES_PER_SECOND = 'Terabytes/Second', + BITS_PER_SECOND = 'Bits/Second', + KILOBITS_PER_SECOND = 'Kilobits/Second', + MEGABITS_PER_SECOND = 'Megabits/Second', + GIGABITS_PER_SECOND = 'Gigabits/Second', + TERABITS_PER_SECOND = 'Terabits/Second', + COUNT_PER_SECOND = 'Count/Second', + NONE = 'None' } /** diff --git a/packages/@aws-cdk/aws-cloudwatch/lib/util.statistic.ts b/packages/@aws-cdk/aws-cloudwatch/lib/util.statistic.ts index 6f6c590287fdf..ae6f8f7e43096 100644 --- a/packages/@aws-cdk/aws-cloudwatch/lib/util.statistic.ts +++ b/packages/@aws-cdk/aws-cloudwatch/lib/util.statistic.ts @@ -17,15 +17,15 @@ export function parseStatistic(stat: string): SimpleStatistic | PercentileStatis // Simple statistics const statMap: {[k: string]: Statistic} = { - average: Statistic.Average, - avg: Statistic.Average, - minimum: Statistic.Minimum, - min: Statistic.Minimum, - maximum: Statistic.Maximum, - max: Statistic.Maximum, - samplecount: Statistic.SampleCount, - n: Statistic.SampleCount, - sum: Statistic.Sum, + average: Statistic.AVERAGE, + avg: Statistic.AVERAGE, + minimum: Statistic.MINIMUM, + min: Statistic.MINIMUM, + maximum: Statistic.MAXIMUM, + max: Statistic.MAXIMUM, + samplecount: Statistic.SAMPLE_COUNT, + n: Statistic.SAMPLE_COUNT, + sum: Statistic.SUM, }; if (lowerStat in statMap) { diff --git a/packages/@aws-cdk/aws-cloudwatch/test/integ.alarm-and-dashboard.ts b/packages/@aws-cdk/aws-cloudwatch/test/integ.alarm-and-dashboard.ts index dff1aff02ac7c..d516f7004031a 100644 --- a/packages/@aws-cdk/aws-cloudwatch/test/integ.alarm-and-dashboard.ts +++ b/packages/@aws-cdk/aws-cloudwatch/test/integ.alarm-and-dashboard.ts @@ -30,7 +30,7 @@ const dashboard = new cloudwatch.Dashboard(stack, 'Dash', { dashboardName: cdk.PhysicalName.of('MyCustomDashboardName'), start: '-9H', end: '2018-12-17T06:00:00.000Z', - periodOverride: PeriodOverride.Inherit + periodOverride: PeriodOverride.INHERIT }); dashboard.addWidgets( new cloudwatch.TextWidget({ markdown: '# This is my dashboard' }), diff --git a/packages/@aws-cdk/aws-cloudwatch/test/test.dashboard.ts b/packages/@aws-cdk/aws-cloudwatch/test/test.dashboard.ts index dcbd27b5db341..fe51772d402b8 100644 --- a/packages/@aws-cdk/aws-cloudwatch/test/test.dashboard.ts +++ b/packages/@aws-cdk/aws-cloudwatch/test/test.dashboard.ts @@ -99,7 +99,7 @@ export = { { start: '-9H', end: '2018-12-17T06:00:00.000Z', - periodOverride: PeriodOverride.Inherit + periodOverride: PeriodOverride.INHERIT }); // WHEN diff --git a/packages/@aws-cdk/aws-cloudwatch/test/test.graphs.ts b/packages/@aws-cdk/aws-cloudwatch/test/test.graphs.ts index 64d731b8b4e8d..3f3bea6386e23 100644 --- a/packages/@aws-cdk/aws-cloudwatch/test/test.graphs.ts +++ b/packages/@aws-cdk/aws-cloudwatch/test/test.graphs.ts @@ -133,7 +133,7 @@ export = { leftAnnotations: [{ value: 1000, color: '667788', - fill: Shading.Below, + fill: Shading.BELOW, label: 'this is the annotation', }] }); diff --git a/packages/@aws-cdk/aws-codebuild/lib/cache.ts b/packages/@aws-cdk/aws-codebuild/lib/cache.ts index aac93ec29ebe9..b92206de862a6 100644 --- a/packages/@aws-cdk/aws-codebuild/lib/cache.ts +++ b/packages/@aws-cdk/aws-codebuild/lib/cache.ts @@ -17,17 +17,17 @@ export enum LocalCacheMode { /** * Caches Git metadata for primary and secondary sources */ - Source = 'LOCAL_SOURCE_CACHE', + SOURCE = 'LOCAL_SOURCE_CACHE', /** * Caches existing Docker layers */ - DockerLayer = 'LOCAL_DOCKER_LAYER_CACHE', + DOCKER_LAYER = 'LOCAL_DOCKER_LAYER_CACHE', /** * Caches directories you specify in the buildspec file */ - Custom = 'LOCAL_CUSTOM_CACHE', + CUSTOM = 'LOCAL_CUSTOM_CACHE', } /** diff --git a/packages/@aws-cdk/aws-codebuild/lib/project.ts b/packages/@aws-cdk/aws-codebuild/lib/project.ts index e5131a2a6c4b6..e6993fdfdb694 100644 --- a/packages/@aws-cdk/aws-codebuild/lib/project.ts +++ b/packages/@aws-cdk/aws-codebuild/lib/project.ts @@ -809,7 +809,7 @@ export class Project extends ProjectBase { computeType: env.computeType || this.buildImage.defaultComputeType, environmentVariables: !hasEnvironmentVars ? undefined : Object.keys(vars).map(name => ({ name, - type: vars[name].type || BuildEnvironmentVariableType.PlainText, + type: vars[name].type || BuildEnvironmentVariableType.PLAINTEXT, value: vars[name].value })) }; @@ -924,9 +924,9 @@ export class Project extends ProjectBase { * Build machine compute type. */ export enum ComputeType { - Small = 'BUILD_GENERAL1_SMALL', - Medium = 'BUILD_GENERAL1_MEDIUM', - Large = 'BUILD_GENERAL1_LARGE' + SMALL = 'BUILD_GENERAL1_SMALL', + MEDIUM = 'BUILD_GENERAL1_MEDIUM', + LARGE = 'BUILD_GENERAL1_LARGE' } export interface BuildEnvironment { @@ -1087,7 +1087,7 @@ export class LinuxBuildImage implements IBuildImage { } public readonly type = 'LINUX_CONTAINER'; - public readonly defaultComputeType = ComputeType.Small; + public readonly defaultComputeType = ComputeType.SMALL; private constructor(public readonly imageId: string) { } @@ -1179,14 +1179,14 @@ export class WindowsBuildImage implements IBuildImage { return image; } public readonly type = 'WINDOWS_CONTAINER'; - public readonly defaultComputeType = ComputeType.Medium; + public readonly defaultComputeType = ComputeType.MEDIUM; private constructor(public readonly imageId: string) { } public validate(buildEnvironment: BuildEnvironment): string[] { const ret: string[] = []; - if (buildEnvironment.computeType === ComputeType.Small) { + if (buildEnvironment.computeType === ComputeType.SMALL) { ret.push("Windows images do not support the Small ComputeType"); } return ret; @@ -1236,12 +1236,12 @@ export enum BuildEnvironmentVariableType { /** * An environment variable in plaintext format. */ - PlainText = 'PLAINTEXT', + PLAINTEXT = 'PLAINTEXT', /** * An environment variable stored in Systems Manager Parameter Store. */ - ParameterStore = 'PARAMETER_STORE' + PARAMETER_STORE = 'PARAMETER_STORE' } function ecrAccessForCodeBuildService(): iam.PolicyStatement { diff --git a/packages/@aws-cdk/aws-codebuild/test/integ.project-bucket.ts b/packages/@aws-cdk/aws-codebuild/test/integ.project-bucket.ts index 12626a39514d0..6698aee216a1d 100644 --- a/packages/@aws-cdk/aws-codebuild/test/integ.project-bucket.ts +++ b/packages/@aws-cdk/aws-codebuild/test/integ.project-bucket.ts @@ -17,7 +17,7 @@ new codebuild.Project(stack, 'MyProject', { path: 'path/to/my/source.zip', }), environment: { - computeType: codebuild.ComputeType.Large + computeType: codebuild.ComputeType.LARGE } }); diff --git a/packages/@aws-cdk/aws-codebuild/test/test.codebuild.ts b/packages/@aws-cdk/aws-codebuild/test/test.codebuild.ts index dae52caec15ea..7d8c6ded5aec5 100644 --- a/packages/@aws-cdk/aws-codebuild/test/test.codebuild.ts +++ b/packages/@aws-cdk/aws-codebuild/test/test.codebuild.ts @@ -1096,7 +1096,7 @@ export = { environment: { environmentVariables: { FOO: { value: '1234' }, - BAR: { value: `111${cdk.Token.asString({ twotwotwo: '222' })}`, type: codebuild.BuildEnvironmentVariableType.ParameterStore } + BAR: { value: `111${cdk.Token.asString({ twotwotwo: '222' })}`, type: codebuild.BuildEnvironmentVariableType.PARAMETER_STORE } } }, environmentVariables: { @@ -1185,7 +1185,7 @@ export = { const stack = new cdk.Stack(); const invalidEnvironment: codebuild.BuildEnvironment = { buildImage: codebuild.WindowsBuildImage.WIN_SERVER_CORE_2016_BASE, - computeType: codebuild.ComputeType.Small, + computeType: codebuild.ComputeType.SMALL, }; test.throws(() => { diff --git a/packages/@aws-cdk/aws-codebuild/test/test.project.ts b/packages/@aws-cdk/aws-codebuild/test/test.project.ts index 65ea194a8b3e5..856dc11c552c7 100644 --- a/packages/@aws-cdk/aws-codebuild/test/test.project.ts +++ b/packages/@aws-cdk/aws-codebuild/test/test.project.ts @@ -196,8 +196,8 @@ export = { bucket: new Bucket(stack, 'Bucket'), path: 'path', }), - cache: codebuild.Cache.local(codebuild.LocalCacheMode.Custom, codebuild.LocalCacheMode.DockerLayer, - codebuild.LocalCacheMode.Source) + cache: codebuild.Cache.local(codebuild.LocalCacheMode.CUSTOM, codebuild.LocalCacheMode.DOCKER_LAYER, + codebuild.LocalCacheMode.SOURCE) }); // THEN diff --git a/packages/@aws-cdk/aws-codecommit/lib/repository.ts b/packages/@aws-cdk/aws-codecommit/lib/repository.ts index 9b74acda10769..00dbd908b310b 100644 --- a/packages/@aws-cdk/aws-codecommit/lib/repository.ts +++ b/packages/@aws-cdk/aws-codecommit/lib/repository.ts @@ -315,8 +315,8 @@ export class Repository extends RepositoryBase { public notify(arn: string, options?: RepositoryTriggerOptions): Repository { let evt = options && options.events; - if (evt && evt.length > 1 && evt.indexOf(RepositoryEventTrigger.All) > -1) { - evt = [RepositoryEventTrigger.All]; + if (evt && evt.length > 1 && evt.indexOf(RepositoryEventTrigger.ALL) > -1) { + evt = [RepositoryEventTrigger.ALL]; } const customData = options && options.customData; @@ -336,7 +336,7 @@ export class Repository extends RepositoryBase { name, customData, branches, - events: evt || [RepositoryEventTrigger.All], + events: evt || [RepositoryEventTrigger.ALL], }); return this; } @@ -376,8 +376,8 @@ export interface RepositoryTriggerOptions { * Repository events that will cause the trigger to run actions in another service. */ export enum RepositoryEventTrigger { - All = 'all', - UpdateRef = 'updateReference', - CreateRef = 'createReference', - DeleteRef = 'deleteReference' + ALL = 'all', + UPDATE_REF = 'updateReference', + CREATE_REF = 'createReference', + DELETE_REF = 'deleteReference' } 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 9d64e256d8aa6..e2e53dff867dd 100644 --- a/packages/@aws-cdk/aws-codedeploy/lib/server/deployment-group.ts +++ b/packages/@aws-cdk/aws-codedeploy/lib/server/deployment-group.ts @@ -352,7 +352,7 @@ export class ServerDeploymentGroup extends ServerDeploymentGroupBase { this.codeDeployBucket.grantRead(asg.role, 'latest/*'); switch (asg.osType) { - case ec2.OperatingSystemType.Linux: + case ec2.OperatingSystemType.LINUX: asg.addUserData( 'PKG_CMD=`which yum 2>/dev/null`', 'if [ -z "$PKG_CMD" ]; then', @@ -374,7 +374,7 @@ export class ServerDeploymentGroup extends ServerDeploymentGroupBase { 'rm -fr $TMP_DIR', ); break; - case ec2.OperatingSystemType.Windows: + case ec2.OperatingSystemType.WINDOWS: asg.addUserData( 'Set-Variable -Name TEMPDIR -Value (New-TemporaryFile).DirectoryName', `aws s3 cp s3://aws-codedeploy-${Stack.of(this).region}/latest/codedeploy-agent.msi $TEMPDIR\\codedeploy-agent.msi`, diff --git a/packages/@aws-cdk/aws-codedeploy/lib/utils.ts b/packages/@aws-cdk/aws-codedeploy/lib/utils.ts index 717b3cfd1b679..ab720f48ef26b 100644 --- a/packages/@aws-cdk/aws-codedeploy/lib/utils.ts +++ b/packages/@aws-cdk/aws-codedeploy/lib/utils.ts @@ -27,9 +27,9 @@ export function renderAlarmConfiguration(alarms: cloudwatch.IAlarm[], ignorePoll } enum AutoRollbackEvent { - DeploymentFailure = 'DEPLOYMENT_FAILURE', - DeploymentStopOnAlarm = 'DEPLOYMENT_STOP_ON_ALARM', - DeploymentStopOnRequest = 'DEPLOYMENT_STOP_ON_REQUEST' + DEPLOYMENT_FAILURE = 'DEPLOYMENT_FAILURE', + DEPLOYMENT_STOP_ON_ALARM = 'DEPLOYMENT_STOP_ON_ALARM', + DEPLOYMENT_STOP_ON_REQUEST = 'DEPLOYMENT_STOP_ON_REQUEST' } export function renderAutoRollbackConfiguration(alarms: cloudwatch.IAlarm[], autoRollbackConfig: AutoRollbackConfig = {}): @@ -38,19 +38,19 @@ export function renderAutoRollbackConfiguration(alarms: cloudwatch.IAlarm[], aut // we roll back failed deployments by default if (autoRollbackConfig.failedDeployment !== false) { - events.push(AutoRollbackEvent.DeploymentFailure); + events.push(AutoRollbackEvent.DEPLOYMENT_FAILURE); } // we _do not_ roll back stopped deployments by default if (autoRollbackConfig.stoppedDeployment === true) { - events.push(AutoRollbackEvent.DeploymentStopOnRequest); + events.push(AutoRollbackEvent.DEPLOYMENT_STOP_ON_REQUEST); } // we _do not_ roll back alarm-triggering deployments by default // unless the Deployment Group has at least one alarm if (autoRollbackConfig.deploymentInAlarm !== false) { if (alarms.length > 0) { - events.push(AutoRollbackEvent.DeploymentStopOnAlarm); + events.push(AutoRollbackEvent.DEPLOYMENT_STOP_ON_ALARM); } else if (autoRollbackConfig.deploymentInAlarm === true) { throw new Error( "The auto-rollback setting 'deploymentInAlarm' does not have any effect unless you associate " + 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 8fef7529b6018..605c3f754c638 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 @@ -35,7 +35,7 @@ new codedeploy.LambdaDeploymentGroup(stack, 'BlueGreenDeployment', { deploymentConfig: codedeploy.LambdaDeploymentConfig.Linear10PercentEvery1Minute, alarms: [ new cloudwatch.Alarm(stack, 'BlueGreenErrors', { - comparisonOperator: cloudwatch.ComparisonOperator.GreaterThanThreshold, + comparisonOperator: cloudwatch.ComparisonOperator.GREATER_THAN_THRESHOLD, threshold: 1, evaluationPeriods: 1, metric: blueGreenAlias.metricErrors() 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 61932e0e50027..8c70a948fcbe0 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 @@ -215,7 +215,7 @@ export = { deploymentConfig: codedeploy.LambdaDeploymentConfig.AllAtOnce, alarms: [new cloudwatch.Alarm(stack, 'Failures', { metric: alias.metricErrors(), - comparisonOperator: cloudwatch.ComparisonOperator.GreaterThanThreshold, + comparisonOperator: cloudwatch.ComparisonOperator.GREATER_THAN_THRESHOLD, threshold: 1, evaluationPeriods: 1 })] @@ -471,7 +471,7 @@ export = { ignorePollAlarmsFailure: true, alarms: [new cloudwatch.Alarm(stack, 'Failures', { metric: alias.metricErrors(), - comparisonOperator: cloudwatch.ComparisonOperator.GreaterThanThreshold, + comparisonOperator: cloudwatch.ComparisonOperator.GREATER_THAN_THRESHOLD, threshold: 1, evaluationPeriods: 1 })] @@ -564,7 +564,7 @@ export = { }, alarms: [new cloudwatch.Alarm(stack, 'Failures', { metric: alias.metricErrors(), - comparisonOperator: cloudwatch.ComparisonOperator.GreaterThanThreshold, + comparisonOperator: cloudwatch.ComparisonOperator.GREATER_THAN_THRESHOLD, threshold: 1, evaluationPeriods: 1 })] 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 ebda4e4675cb7..8da3a180499ec 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 @@ -12,7 +12,7 @@ const stack = new cdk.Stack(app, 'aws-cdk-codedeploy-server-dg'); const vpc = new ec2.Vpc(stack, 'VPC'); const asg = new autoscaling.AutoScalingGroup(stack, 'ASG', { - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M5, ec2.InstanceSize.Large), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M5, ec2.InstanceSize.LARGE), machineImage: new ec2.AmazonLinuxImage(), vpc, }); diff --git a/packages/@aws-cdk/aws-codedeploy/test/server/test.deployment-group.ts b/packages/@aws-cdk/aws-codedeploy/test/server/test.deployment-group.ts index 8267d104c16fb..6ad904aeeafd5 100644 --- a/packages/@aws-cdk/aws-codedeploy/test/server/test.deployment-group.ts +++ b/packages/@aws-cdk/aws-codedeploy/test/server/test.deployment-group.ts @@ -46,7 +46,7 @@ export = { const stack = new cdk.Stack(); const asg = new autoscaling.AutoScalingGroup(stack, 'ASG', { - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.Standard3, ec2.InstanceSize.Small), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.STANDARD3, ec2.InstanceSize.SMALL), machineImage: new ec2.AmazonLinuxImage(), vpc: new ec2.Vpc(stack, 'VPC'), }); @@ -70,7 +70,7 @@ export = { const stack = new cdk.Stack(); const asg = new autoscaling.AutoScalingGroup(stack, 'ASG', { - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.Standard3, ec2.InstanceSize.Small), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.STANDARD3, ec2.InstanceSize.SMALL), machineImage: new ec2.AmazonLinuxImage(), vpc: new ec2.Vpc(stack, 'VPC'), }); diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/alexa-ask/deploy-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/alexa-ask/deploy-action.ts index ad36ab6e614b0..7e70ccb423d6f 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/alexa-ask/deploy-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/alexa-ask/deploy-action.ts @@ -43,7 +43,7 @@ export class AlexaSkillDeployAction extends codepipeline.Action { constructor(props: AlexaSkillDeployActionProps) { super({ ...props, - category: codepipeline.ActionCategory.Deploy, + category: codepipeline.ActionCategory.DEPLOY, owner: 'ThirdParty', provider: 'AlexaSkillsKit', artifactBounds: { diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/cloudformation/pipeline-actions.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/cloudformation/pipeline-actions.ts index 683c0dc65e43f..ec4b2648584e1 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/cloudformation/pipeline-actions.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/cloudformation/pipeline-actions.ts @@ -74,7 +74,7 @@ export abstract class CloudFormationAction extends codepipeline.Action { ? [props.output || new codepipeline.Artifact(`${props.actionName}_${props.stackName}_Artifact`)] : undefined, provider: 'CloudFormation', - category: codepipeline.ActionCategory.Deploy, + category: codepipeline.ActionCategory.DEPLOY, configuration: { StackName: props.stackName, OutputFileName: props.outputFileName, diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/codebuild/build-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/codebuild/build-action.ts index 2826f438c67db..7de9abd2922d4 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/codebuild/build-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/codebuild/build-action.ts @@ -71,8 +71,8 @@ export class CodeBuildAction extends codepipeline.Action { super({ ...props, category: props.type === CodeBuildActionType.TEST - ? codepipeline.ActionCategory.Test - : codepipeline.ActionCategory.Build, + ? codepipeline.ActionCategory.TEST + : codepipeline.ActionCategory.BUILD, provider: 'CodeBuild', artifactBounds: { minInputs: 1, maxInputs: 5, minOutputs: 0, maxOutputs: 5 }, inputs: [props.input, ...props.extraInputs || []], diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/codecommit/source-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/codecommit/source-action.ts index 32278f12ac0a7..8368ec9af90c8 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/codecommit/source-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/codecommit/source-action.ts @@ -41,7 +41,7 @@ export class CodeCommitSourceAction extends codepipeline.Action { constructor(props: CodeCommitSourceActionProps) { super({ ...props, - category: codepipeline.ActionCategory.Source, + category: codepipeline.ActionCategory.SOURCE, provider: 'CodeCommit', artifactBounds: sourceArtifactBounds(), outputs: [props.output], diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/codedeploy/server-deploy-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/codedeploy/server-deploy-action.ts index 2456af68e1dc1..7d1b0b9c0e04c 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/codedeploy/server-deploy-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/codedeploy/server-deploy-action.ts @@ -24,7 +24,7 @@ export class CodeDeployServerDeployAction extends codepipeline.Action { constructor(props: CodeDeployServerDeployActionProps) { super({ ...props, - category: codepipeline.ActionCategory.Deploy, + category: codepipeline.ActionCategory.DEPLOY, provider: 'CodeDeploy', artifactBounds: deployArtifactBounds(), inputs: [props.input], diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/ecr/source-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/ecr/source-action.ts index 22aa8d7e80ede..4ec55df41d1ed 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/ecr/source-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/ecr/source-action.ts @@ -39,7 +39,7 @@ export class EcrSourceAction extends codepipeline.Action { constructor(props: EcrSourceActionProps) { super({ ...props, - category: codepipeline.ActionCategory.Source, + category: codepipeline.ActionCategory.SOURCE, provider: 'ECR', artifactBounds: sourceArtifactBounds(), outputs: [props.output], diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/ecs/deploy-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/ecs/deploy-action.ts index 1ae0f05333936..2238b56d7f6e5 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/ecs/deploy-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/ecs/deploy-action.ts @@ -47,7 +47,7 @@ export class EcsDeployAction extends codepipeline.Action { constructor(props: EcsDeployActionProps) { super({ ...props, - category: codepipeline.ActionCategory.Deploy, + category: codepipeline.ActionCategory.DEPLOY, provider: 'ECS', artifactBounds: deployArtifactBounds(), inputs: [determineInputArtifact(props)], diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/github/source-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/github/source-action.ts index 51d85c2edd80d..02216174ba02d 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/github/source-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/github/source-action.ts @@ -68,7 +68,7 @@ export class GitHubSourceAction extends codepipeline.Action { constructor(props: GitHubSourceActionProps) { super({ ...props, - category: codepipeline.ActionCategory.Source, + category: codepipeline.ActionCategory.SOURCE, owner: 'ThirdParty', provider: 'GitHub', artifactBounds: sourceArtifactBounds(), diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/jenkins/jenkins-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/jenkins/jenkins-action.ts index 24e3c948c5227..f23dfbb4bff63 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/jenkins/jenkins-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/jenkins/jenkins-action.ts @@ -64,8 +64,8 @@ export class JenkinsAction extends codepipeline.Action { super({ ...props, category: props.type === JenkinsActionType.BUILD - ? codepipeline.ActionCategory.Build - : codepipeline.ActionCategory.Test, + ? codepipeline.ActionCategory.BUILD + : codepipeline.ActionCategory.TEST, provider: props.jenkinsProvider.providerName, owner: 'Custom', artifactBounds: jenkinsArtifactsBounds, @@ -79,7 +79,7 @@ export class JenkinsAction extends codepipeline.Action { } protected bind(_info: codepipeline.ActionBind): void { - if (this.category === codepipeline.ActionCategory.Build) { + if (this.category === codepipeline.ActionCategory.BUILD) { this.jenkinsProvider._registerBuildProvider(); } else { this.jenkinsProvider._registerTestProvider(); diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/jenkins/jenkins-provider.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/jenkins/jenkins-provider.ts index 322235f37f6ef..1d14f9361c709 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/jenkins/jenkins-provider.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/jenkins/jenkins-provider.ts @@ -170,7 +170,7 @@ export class JenkinsProvider extends BaseJenkinsProvider { return; } this.buildIncluded = true; - this.registerJenkinsCustomAction('JenkinsBuildProviderResource', codepipeline.ActionCategory.Build); + this.registerJenkinsCustomAction('JenkinsBuildProviderResource', codepipeline.ActionCategory.BUILD); } /** @@ -181,7 +181,7 @@ export class JenkinsProvider extends BaseJenkinsProvider { return; } this.testIncluded = true; - this.registerJenkinsCustomAction('JenkinsTestProviderResource', codepipeline.ActionCategory.Test); + this.registerJenkinsCustomAction('JenkinsTestProviderResource', codepipeline.ActionCategory.TEST); } private registerJenkinsCustomAction(id: string, category: codepipeline.ActionCategory) { diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/lambda/invoke-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/lambda/invoke-action.ts index 4e248b9c76e42..6c864e329049c 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/lambda/invoke-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/lambda/invoke-action.ts @@ -59,7 +59,7 @@ export class LambdaInvokeAction extends codepipeline.Action { constructor(props: LambdaInvokeActionProps) { super({ ...props, - category: codepipeline.ActionCategory.Invoke, + category: codepipeline.ActionCategory.INVOKE, provider: 'Lambda', artifactBounds: { minInputs: 0, diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/manual-approval-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/manual-approval-action.ts index a6a65e58624d3..ea679ac648cfb 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/manual-approval-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/manual-approval-action.ts @@ -40,7 +40,7 @@ export class ManualApprovalAction extends codepipeline.Action { constructor(props: ManualApprovalActionProps) { super({ ...props, - category: codepipeline.ActionCategory.Approval, + category: codepipeline.ActionCategory.APPROVAL, provider: 'Manual', artifactBounds: { minInputs: 0, maxInputs: 0, minOutputs: 0, maxOutputs: 0 }, configuration: cdk.Lazy.anyValue({ produce: () => this.actionConfiguration() }), diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/s3/deploy-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/s3/deploy-action.ts index 1cda99264290b..59c96ea4f883a 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/s3/deploy-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/s3/deploy-action.ts @@ -38,7 +38,7 @@ export class S3DeployAction extends codepipeline.Action { constructor(props: S3DeployActionProps) { super({ ...props, - category: codepipeline.ActionCategory.Deploy, + category: codepipeline.ActionCategory.DEPLOY, provider: 'S3', artifactBounds: deployArtifactBounds(), inputs: [props.input], diff --git a/packages/@aws-cdk/aws-codepipeline-actions/lib/s3/source-action.ts b/packages/@aws-cdk/aws-codepipeline-actions/lib/s3/source-action.ts index eb4065cb0f3ff..91113d7749e82 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/lib/s3/source-action.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/lib/s3/source-action.ts @@ -48,7 +48,7 @@ export class S3SourceAction extends codepipeline.Action { constructor(props: S3SourceActionProps) { super({ ...props, - category: codepipeline.ActionCategory.Source, + category: codepipeline.ActionCategory.SOURCE, provider: 'S3', artifactBounds: sourceArtifactBounds(), outputs: [props.output], 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 42053330fe295..5219adc82afce 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 @@ -18,7 +18,7 @@ const bucket = new s3.Bucket(stack, 'PipelineBucket', { }); const key = 'key'; const trail = new cloudtrail.Trail(stack, 'CloudTrail'); -trail.addS3EventSelector([bucket.arnForObjects(key)], { readWriteType: cloudtrail.ReadWriteType.WriteOnly, includeManagementEvents: false }); +trail.addS3EventSelector([bucket.arnForObjects(key)], { readWriteType: cloudtrail.ReadWriteType.WRITE_ONLY, includeManagementEvents: false }); sourceStage.addAction(new cpactions.S3SourceAction({ actionName: 'Source', output: new codepipeline.Artifact('SourceArtifact'), 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 3e206e9261754..d6b6c662c5de2 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/test.pipeline.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/test.pipeline.ts @@ -726,7 +726,7 @@ export = { }); const sourceBucket = new s3.Bucket(pipelineStack, 'ArtifactBucket', { bucketName: PhysicalName.of('source-bucket'), - encryption: s3.BucketEncryption.Kms, + encryption: s3.BucketEncryption.KMS, }); const sourceOutput = new codepipeline.Artifact(); new codepipeline.Pipeline(pipelineStack, 'Pipeline', { diff --git a/packages/@aws-cdk/aws-codepipeline/lib/action.ts b/packages/@aws-cdk/aws-codepipeline/lib/action.ts index 7d1916742dbe3..d69e347061882 100644 --- a/packages/@aws-cdk/aws-codepipeline/lib/action.ts +++ b/packages/@aws-cdk/aws-codepipeline/lib/action.ts @@ -5,12 +5,12 @@ import { Artifact } from './artifact'; import validation = require('./validation'); export enum ActionCategory { - Source = 'Source', - Build = 'Build', - Test = 'Test', - Approval = 'Approval', - Deploy = 'Deploy', - Invoke = 'Invoke' + SOURCE = 'Source', + BUILD = 'Build', + TEST = 'Test', + APPROVAL = 'Approval', + DEPLOY = 'Deploy', + INVOKE = 'Invoke' } /** diff --git a/packages/@aws-cdk/aws-codepipeline/lib/pipeline.ts b/packages/@aws-cdk/aws-codepipeline/lib/pipeline.ts index 01f7f70335a48..1b06b4810e0c7 100644 --- a/packages/@aws-cdk/aws-codepipeline/lib/pipeline.ts +++ b/packages/@aws-cdk/aws-codepipeline/lib/pipeline.ts @@ -232,7 +232,7 @@ export class Pipeline extends PipelineBase { propsBucket = new s3.Bucket(this, 'ArtifactsBucket', { bucketName: PhysicalName.auto({ crossEnvironment: true }), encryptionKey, - encryption: s3.BucketEncryption.Kms, + encryption: s3.BucketEncryption.KMS, removalPolicy: RemovalPolicy.Retain }); } diff --git a/packages/@aws-cdk/aws-codepipeline/lib/validation.ts b/packages/@aws-cdk/aws-codepipeline/lib/validation.ts index 2853165951ab6..29f7fd785c13a 100644 --- a/packages/@aws-cdk/aws-codepipeline/lib/validation.ts +++ b/packages/@aws-cdk/aws-codepipeline/lib/validation.ts @@ -26,7 +26,7 @@ export function validateArtifactBounds( type: string, artifacts: Artifact[], * in the first stage of a pipeline, and the first stage can only contain source actions. */ export function validateSourceAction(mustBeSource: boolean, category: string, actionName: string, stageName: string): string[] { - if (mustBeSource !== (category === ActionCategory.Source)) { + if (mustBeSource !== (category === ActionCategory.SOURCE)) { return [`Action ${actionName} in stage ${stageName}: ` + (mustBeSource ? 'first stage may only contain Source actions' : 'Source actions may only occur in first stage')]; } diff --git a/packages/@aws-cdk/aws-codepipeline/test/fake-build-action.ts b/packages/@aws-cdk/aws-codepipeline/test/fake-build-action.ts index cb14d68eef1d4..a04c7acd7ef1b 100644 --- a/packages/@aws-cdk/aws-codepipeline/test/fake-build-action.ts +++ b/packages/@aws-cdk/aws-codepipeline/test/fake-build-action.ts @@ -12,7 +12,7 @@ export class FakeBuildAction extends codepipeline.Action { constructor(props: FakeBuildActionProps) { super({ ...props, - category: codepipeline.ActionCategory.Build, + category: codepipeline.ActionCategory.BUILD, provider: 'Fake', artifactBounds: { minInputs: 1, maxInputs: 3, minOutputs: 0, maxOutputs: 1 }, inputs: [props.input, ...props.extraInputs || []], diff --git a/packages/@aws-cdk/aws-codepipeline/test/fake-source-action.ts b/packages/@aws-cdk/aws-codepipeline/test/fake-source-action.ts index b71558655b088..8f1f1f7c968f1 100644 --- a/packages/@aws-cdk/aws-codepipeline/test/fake-source-action.ts +++ b/packages/@aws-cdk/aws-codepipeline/test/fake-source-action.ts @@ -10,7 +10,7 @@ export class FakeSourceAction extends codepipeline.Action { constructor(props: FakeSourceActionProps) { super({ ...props, - category: codepipeline.ActionCategory.Source, + category: codepipeline.ActionCategory.SOURCE, provider: 'Fake', artifactBounds: { minInputs: 0, maxInputs: 0, minOutputs: 1, maxOutputs: 4 }, outputs: [props.output, ...props.extraOutputs || []], diff --git a/packages/@aws-cdk/aws-codepipeline/test/test.action.ts b/packages/@aws-cdk/aws-codepipeline/test/test.action.ts index 54e8e78a2936b..42e0d893e58f5 100644 --- a/packages/@aws-cdk/aws-codepipeline/test/test.action.ts +++ b/packages/@aws-cdk/aws-codepipeline/test/test.action.ts @@ -35,27 +35,27 @@ export = { 'action type validation': { 'must be source and is source'(test: Test) { - const result = validations.validateSourceAction(true, codepipeline.ActionCategory.Source, 'test action', 'test stage'); + const result = validations.validateSourceAction(true, codepipeline.ActionCategory.SOURCE, 'test action', 'test stage'); test.deepEqual(result.length, 0); test.done(); }, 'must be source and is not source'(test: Test) { - const result = validations.validateSourceAction(true, codepipeline.ActionCategory.Deploy, 'test action', 'test stage'); + const result = validations.validateSourceAction(true, codepipeline.ActionCategory.DEPLOY, 'test action', 'test stage'); test.deepEqual(result.length, 1); test.ok(result[0].match(/may only contain Source actions/), 'the validation should have failed'); test.done(); }, 'cannot be source and is source'(test: Test) { - const result = validations.validateSourceAction(false, codepipeline.ActionCategory.Source, 'test action', 'test stage'); + const result = validations.validateSourceAction(false, codepipeline.ActionCategory.SOURCE, 'test action', 'test stage'); test.deepEqual(result.length, 1); test.ok(result[0].match(/may only occur in first stage/), 'the validation should have failed'); test.done(); }, 'cannot be source and is not source'(test: Test) { - const result = validations.validateSourceAction(false, codepipeline.ActionCategory.Deploy, 'test action', 'test stage'); + const result = validations.validateSourceAction(false, codepipeline.ActionCategory.DEPLOY, 'test action', 'test stage'); test.deepEqual(result.length, 0); test.done(); }, diff --git a/packages/@aws-cdk/aws-cognito/lib/user-pool-client.ts b/packages/@aws-cdk/aws-cognito/lib/user-pool-client.ts index a7e21cabe4aab..6e436c122f8e8 100644 --- a/packages/@aws-cdk/aws-cognito/lib/user-pool-client.ts +++ b/packages/@aws-cdk/aws-cognito/lib/user-pool-client.ts @@ -9,17 +9,17 @@ export enum AuthFlow { /** * Enable flow for server-side or admin authentication (no client app) */ - AdminNoSrp = 'ADMIN_NO_SRP_AUTH', + ADMIN_NO_SRP = 'ADMIN_NO_SRP_AUTH', /** * Enable custom authentication flow */ - CustomFlowOnly = 'CUSTOM_AUTH_FLOW_ONLY', + CUSTOM_FLOW_ONLY = 'CUSTOM_AUTH_FLOW_ONLY', /** * Enable auth using username & password */ - UserPassword = 'USER_PASSWORD_AUTH' + USER_PASSWORD = 'USER_PASSWORD_AUTH' } export interface UserPoolClientProps { diff --git a/packages/@aws-cdk/aws-cognito/lib/user-pool.ts b/packages/@aws-cdk/aws-cognito/lib/user-pool.ts index 719553f9bcfa1..ab2a29c3bc6ce 100644 --- a/packages/@aws-cdk/aws-cognito/lib/user-pool.ts +++ b/packages/@aws-cdk/aws-cognito/lib/user-pool.ts @@ -12,39 +12,39 @@ export enum UserPoolAttribute { /** * End-User's preferred postal address. */ - Address = 'address', + ADDRESS = 'address', /** * End-User's birthday, represented as an ISO 8601:2004 [ISO8601‑2004] YYYY-MM-DD format. * The year MAY be 0000, indicating that it is omitted. * To represent only the year, YYYY format is allowed. */ - Birthdate = 'birthdate', + BIRTHDATE = 'birthdate', /** * End-User's preferred e-mail address. * Its value MUST conform to the RFC 5322 [RFC5322] addr-spec syntax. */ - Email = 'email', + EMAIL = 'email', /** * Surname(s) or last name(s) of the End-User. * Note that in some cultures, people can have multiple family names or no family name; * all can be present, with the names being separated by space characters. */ - FamilyName = 'family_name', + FAMILY_NAME = 'family_name', /** * End-User's gender. */ - Gender = 'gender', + GENDER = 'gender', /** * Given name(s) or first name(s) of the End-User. * Note that in some cultures, people can have multiple given names; * all can be present, with the names being separated by space characters. */ - GivenName = 'given_name', + GIVEN_NAME = 'given_name', /** * End-User's locale, represented as a BCP47 [RFC5646] language tag. @@ -52,7 +52,7 @@ export enum UserPoolAttribute { * and an ISO 3166-1 Alpha-2 [ISO3166‑1] country code in uppercase, separated by a dash. * For example, en-US or fr-CA. */ - Locale = 'locale', + LOCALE = 'locale', /** * Middle name(s) of the End-User. @@ -60,19 +60,19 @@ export enum UserPoolAttribute { * all can be present, with the names being separated by space characters. * Also note that in some cultures, middle names are not used. */ - MiddleName = 'middle_name', + MIDDLE_NAME = 'middle_name', /** * End-User's full name in displayable form including all name parts, * possibly including titles and suffixes, ordered according to the End-User's locale and preferences. */ - Name = 'name', + NAME = 'name', /** * Casual name of the End-User that may or may not be the same as the given_name. * For instance, a nickname value of Mike might be returned alongside a given_name value of Michael. */ - Nickname = 'nickname', + NICKNAME = 'nickname', /** * End-User's preferred telephone number. @@ -80,7 +80,7 @@ export enum UserPoolAttribute { * If the phone number contains an extension, it is RECOMMENDED that the extension be represented using the * RFC 3966 [RFC3966] extension syntax, for example, +1 (604) 555-1234;ext=5678. */ - PhoneNumber = 'phone_number', + PHONE_NUMBER = 'phone_number', /** * URL of the End-User's profile picture. @@ -89,35 +89,35 @@ export enum UserPoolAttribute { * Note that this URL SHOULD specifically reference a profile photo of the End-User * suitable for displaying when describing the End-User, rather than an arbitrary photo taken by the End-User */ - Picture = 'picture', + PICTURE = 'picture', /** * Shorthand name by which the End-User wishes to be referred to. */ - PreferredUsername = 'preferred_username', + PREFERRED_USERNAME = 'preferred_username', /** * URL of the End-User's profile page. The contents of this Web page SHOULD be about the End-User. */ - Profile = 'profile', + PROFILE = 'profile', /** * The End-User's time zone */ - Timezone = 'timezone', + TIMEZONE = 'timezone', /** * Time the End-User's information was last updated. * Its value is a JSON number representing the number of seconds from 1970-01-01T0:0:0Z * as measured in UTC until the date/time. */ - UpdatedAt = 'updated_at', + UPDATED_AT = 'updated_at', /** * URL of the End-User's Web page or blog. * This Web page SHOULD contain information published by the End-User or an organization that the End-User is affiliated with. */ - Website = 'website' + WEBSITE = 'website' } /** @@ -127,22 +127,22 @@ export enum SignInType { /** * End-user will sign in with a username, with optional aliases */ - Username, + USERNAME, /** * End-user will sign in using an email address */ - Email, + EMAIL, /** * End-user will sign in using a phone number */ - Phone, + PHONE, /** * End-user will sign in using either an email address or phone number */ - EmailOrPhone + EMAIL_OR_PHONE } export interface UserPoolTriggers { @@ -342,37 +342,37 @@ export class UserPool extends Resource implements IUserPool { let aliasAttributes: UserPoolAttribute[] | undefined; let usernameAttributes: UserPoolAttribute[] | undefined; - if (props.usernameAliasAttributes != null && props.signInType !== SignInType.Username) { + if (props.usernameAliasAttributes != null && props.signInType !== SignInType.USERNAME) { throw new Error(`'usernameAliasAttributes' can only be set with a signInType of 'USERNAME'`); } if (props.usernameAliasAttributes && !props.usernameAliasAttributes.every(a => { - return a === UserPoolAttribute.Email || a === UserPoolAttribute.PhoneNumber || a === UserPoolAttribute.PreferredUsername; + return a === UserPoolAttribute.EMAIL || a === UserPoolAttribute.PHONE_NUMBER || a === UserPoolAttribute.PREFERRED_USERNAME; })) { throw new Error(`'usernameAliasAttributes' can only include EMAIL, PHONE_NUMBER, or PREFERRED_USERNAME`); } if (props.autoVerifiedAttributes - && !props.autoVerifiedAttributes.every(a => a === UserPoolAttribute.Email || a === UserPoolAttribute.PhoneNumber)) { + && !props.autoVerifiedAttributes.every(a => a === UserPoolAttribute.EMAIL || a === UserPoolAttribute.PHONE_NUMBER)) { throw new Error(`'autoVerifiedAttributes' can only include EMAIL or PHONE_NUMBER`); } switch (props.signInType) { - case SignInType.Username: + case SignInType.USERNAME: aliasAttributes = props.usernameAliasAttributes; break; - case SignInType.Email: - usernameAttributes = [UserPoolAttribute.Email]; + case SignInType.EMAIL: + usernameAttributes = [UserPoolAttribute.EMAIL]; break; - case SignInType.Phone: - usernameAttributes = [UserPoolAttribute.PhoneNumber]; + case SignInType.PHONE: + usernameAttributes = [UserPoolAttribute.PHONE_NUMBER]; break; - case SignInType.EmailOrPhone: - usernameAttributes = [UserPoolAttribute.Email, UserPoolAttribute.PhoneNumber]; + case SignInType.EMAIL_OR_PHONE: + usernameAttributes = [UserPoolAttribute.EMAIL, UserPoolAttribute.PHONE_NUMBER]; break; default: 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 5a8697992f4c1..8894bbf1146f8 100644 --- a/packages/@aws-cdk/aws-cognito/test/test.user-pool.ts +++ b/packages/@aws-cdk/aws-cognito/test/test.user-pool.ts @@ -118,8 +118,8 @@ export = { // WHEN new cognito.UserPool(stack, 'Pool', { - signInType: cognito.SignInType.Email, - autoVerifiedAttributes: [cognito.UserPoolAttribute.Email] + signInType: cognito.SignInType.EMAIL, + autoVerifiedAttributes: [cognito.UserPoolAttribute.EMAIL] }); // THEN @@ -138,8 +138,8 @@ export = { // WHEN const toThrow = () => { new cognito.UserPool(stack, 'Pool', { - signInType: cognito.SignInType.Email, - usernameAliasAttributes: [cognito.UserPoolAttribute.PreferredUsername] + signInType: cognito.SignInType.EMAIL, + usernameAliasAttributes: [cognito.UserPoolAttribute.PREFERRED_USERNAME] }); }; @@ -155,8 +155,8 @@ export = { // WHEN const toThrow = () => { new cognito.UserPool(stack, 'Pool', { - signInType: cognito.SignInType.Username, - usernameAliasAttributes: [cognito.UserPoolAttribute.GivenName] + signInType: cognito.SignInType.USERNAME, + usernameAliasAttributes: [cognito.UserPoolAttribute.GIVEN_NAME] }); }; @@ -172,8 +172,8 @@ export = { // WHEN const toThrow = () => { new cognito.UserPool(stack, 'Pool', { - signInType: cognito.SignInType.Email, - autoVerifiedAttributes: [cognito.UserPoolAttribute.Email, cognito.UserPoolAttribute.Gender] + signInType: cognito.SignInType.EMAIL, + autoVerifiedAttributes: [cognito.UserPoolAttribute.EMAIL, cognito.UserPoolAttribute.GENDER] }); }; diff --git a/packages/@aws-cdk/aws-dynamodb-global/lib/aws-dynamodb-global.ts b/packages/@aws-cdk/aws-dynamodb-global/lib/aws-dynamodb-global.ts index 9c87eaf3d4272..651f9e55461d7 100644 --- a/packages/@aws-cdk/aws-dynamodb-global/lib/aws-dynamodb-global.ts +++ b/packages/@aws-cdk/aws-dynamodb-global/lib/aws-dynamodb-global.ts @@ -39,15 +39,15 @@ export class GlobalTable extends cdk.Construct { super(scope, id); this._regionalTables = []; - if (props.stream != null && props.stream !== dynamodb.StreamViewType.NewAndOldImages) { - throw new Error("dynamoProps.stream MUST be set to dynamodb.StreamViewType.NewAndOldImages"); + if (props.stream != null && props.stream !== dynamodb.StreamViewType.NEW_AND_OLD_IMAGES) { + throw new Error("dynamoProps.stream MUST be set to dynamodb.StreamViewType.NEW_AND_OLD_IMAGES"); } // need to set this stream specification, otherwise global tables don't work // And no way to set a default value in an interface const stackProps: dynamodb.TableProps = { ...props, - stream: dynamodb.StreamViewType.NewAndOldImages + stream: dynamodb.StreamViewType.NEW_AND_OLD_IMAGES }; // here we loop through the configured regions. diff --git a/packages/@aws-cdk/aws-dynamodb-global/test/integ.dynamodb.global.ts b/packages/@aws-cdk/aws-dynamodb-global/test/integ.dynamodb.global.ts index 7a90f338fb277..316b4d2811232 100644 --- a/packages/@aws-cdk/aws-dynamodb-global/test/integ.dynamodb.global.ts +++ b/packages/@aws-cdk/aws-dynamodb-global/test/integ.dynamodb.global.ts @@ -5,7 +5,7 @@ import { GlobalTable } from '../lib'; const app = new App(); new GlobalTable(app, 'globdynamodbinteg', { - partitionKey: { name: 'hashKey', type: AttributeType.String }, + partitionKey: { name: 'hashKey', type: AttributeType.STRING }, tableName: PhysicalName.of('integrationtest'), regions: [ "us-east-1", "us-east-2", "us-west-2" ] }); diff --git a/packages/@aws-cdk/aws-dynamodb-global/test/test.dynamodb.global.ts b/packages/@aws-cdk/aws-dynamodb-global/test/test.dynamodb.global.ts index 08ece23a033eb..e73f7bb5dfb36 100644 --- a/packages/@aws-cdk/aws-dynamodb-global/test/test.dynamodb.global.ts +++ b/packages/@aws-cdk/aws-dynamodb-global/test/test.dynamodb.global.ts @@ -16,7 +16,7 @@ const CONSTRUCT_NAME = 'aws-cdk-dynamodb-global'; // DynamoDB table parameters const TABLE_NAME = 'GlobalTable'; -const TABLE_PARTITION_KEY: Attribute = { name: 'hashKey', type: AttributeType.String }; +const TABLE_PARTITION_KEY: Attribute = { name: 'hashKey', type: AttributeType.STRING }; const STACK_PROPS: GlobalTableProps = { partitionKey: TABLE_PARTITION_KEY, @@ -71,7 +71,7 @@ export = { try { new GlobalTable(stack, CONSTRUCT_NAME, { tableName: PhysicalName.of(TABLE_NAME), - stream: StreamViewType.KeysOnly, + stream: StreamViewType.KEYS_ONLY, partitionKey: TABLE_PARTITION_KEY, regions: [ 'us-east-1', 'us-east-2', 'us-west-2' ] }); diff --git a/packages/@aws-cdk/aws-dynamodb/lib/scalable-table-attribute.ts b/packages/@aws-cdk/aws-dynamodb/lib/scalable-table-attribute.ts index a0fb5e83bf946..c3d13c305bf1a 100644 --- a/packages/@aws-cdk/aws-dynamodb/lib/scalable-table-attribute.ts +++ b/packages/@aws-cdk/aws-dynamodb/lib/scalable-table-attribute.ts @@ -21,8 +21,8 @@ export class ScalableTableAttribute extends appscaling.BaseScalableAttribute { throw new RangeError(`targetUtilizationPercent for DynamoDB scaling must be between 10 and 90 percent, got: ${props.targetUtilizationPercent}`); } const predefinedMetric = this.props.dimension.indexOf('ReadCapacity') === -1 - ? appscaling.PredefinedMetric.DynamoDBWriteCapacityUtilization - : appscaling.PredefinedMetric.DynamoDBReadCapacityUtilization; + ? appscaling.PredefinedMetric.DYANMODB_WRITE_CAPACITY_UTILIZATION + : appscaling.PredefinedMetric.DYNAMODB_READ_CAPACITY_UTILIZATION; super.doScaleToTrackMetric('Tracking', { policyName: props.policyName, diff --git a/packages/@aws-cdk/aws-dynamodb/lib/table.ts b/packages/@aws-cdk/aws-dynamodb/lib/table.ts index 18c6d586e0848..2adc3c5c996c9 100644 --- a/packages/@aws-cdk/aws-dynamodb/lib/table.ts +++ b/packages/@aws-cdk/aws-dynamodb/lib/table.ts @@ -228,7 +228,7 @@ export class Table extends Resource { physicalName: props.tableName, }); - this.billingMode = props.billingMode || BillingMode.Provisioned; + this.billingMode = props.billingMode || BillingMode.PROVISIONED; this.validateProvisioning(props); this.table = new CfnTable(this, 'Resource', { @@ -238,8 +238,8 @@ export class Table extends Resource { globalSecondaryIndexes: Lazy.anyValue({ produce: () => this.globalSecondaryIndexes }, { omitEmptyArray: true }), localSecondaryIndexes: Lazy.anyValue({ produce: () => this.localSecondaryIndexes }, { omitEmptyArray: true }), pointInTimeRecoverySpecification: props.pointInTimeRecovery ? { pointInTimeRecoveryEnabled: props.pointInTimeRecovery } : undefined, - billingMode: this.billingMode === BillingMode.PayPerRequest ? this.billingMode : undefined, - provisionedThroughput: props.billingMode === BillingMode.PayPerRequest ? undefined : { + billingMode: this.billingMode === BillingMode.PAY_PER_REQUEST ? this.billingMode : undefined, + provisionedThroughput: props.billingMode === BillingMode.PAY_PER_REQUEST ? undefined : { readCapacityUnits: props.readCapacity || 5, writeCapacityUnits: props.writeCapacity || 5 }, @@ -293,7 +293,7 @@ export class Table extends Resource { indexName: props.indexName, keySchema: gsiKeySchema, projection: gsiProjection, - provisionedThroughput: this.billingMode === BillingMode.PayPerRequest ? undefined : { + provisionedThroughput: this.billingMode === BillingMode.PAY_PER_REQUEST ? undefined : { readCapacityUnits: props.readCapacity || 5, writeCapacityUnits: props.writeCapacity || 5 } @@ -336,12 +336,12 @@ export class Table extends Resource { if (this.tableScaling.scalableReadAttribute) { throw new Error('Read AutoScaling already enabled for this table'); } - if (this.billingMode === BillingMode.PayPerRequest) { + if (this.billingMode === BillingMode.PAY_PER_REQUEST) { throw new Error('AutoScaling is not available for tables with PAY_PER_REQUEST billing mode'); } return this.tableScaling.scalableReadAttribute = new ScalableTableAttribute(this, 'ReadScaling', { - serviceNamespace: appscaling.ServiceNamespace.DynamoDb, + serviceNamespace: appscaling.ServiceNamespace.DYNAMODB, resourceId: `table/${this.tableName}`, dimension: 'dynamodb:table:ReadCapacityUnits', role: this.scalingRole, @@ -358,12 +358,12 @@ export class Table extends Resource { if (this.tableScaling.scalableWriteAttribute) { throw new Error('Write AutoScaling already enabled for this table'); } - if (this.billingMode === BillingMode.PayPerRequest) { + if (this.billingMode === BillingMode.PAY_PER_REQUEST) { throw new Error('AutoScaling is not available for tables with PAY_PER_REQUEST billing mode'); } return this.tableScaling.scalableWriteAttribute = new ScalableTableAttribute(this, 'WriteScaling', { - serviceNamespace: appscaling.ServiceNamespace.DynamoDb, + serviceNamespace: appscaling.ServiceNamespace.DYNAMODB, resourceId: `table/${this.tableName}`, dimension: 'dynamodb:table:WriteCapacityUnits', role: this.scalingRole, @@ -377,7 +377,7 @@ export class Table extends Resource { * @returns An object to configure additional AutoScaling settings for this attribute */ public autoScaleGlobalSecondaryIndexReadCapacity(indexName: string, props: EnableScalingProps): IScalableTableAttribute { - if (this.billingMode === BillingMode.PayPerRequest) { + if (this.billingMode === BillingMode.PAY_PER_REQUEST) { throw new Error('AutoScaling is not available for tables with PAY_PER_REQUEST billing mode'); } const attributePair = this.indexScaling.get(indexName); @@ -389,7 +389,7 @@ export class Table extends Resource { } return attributePair.scalableReadAttribute = new ScalableTableAttribute(this, `${indexName}ReadScaling`, { - serviceNamespace: appscaling.ServiceNamespace.DynamoDb, + serviceNamespace: appscaling.ServiceNamespace.DYNAMODB, resourceId: `table/${this.tableName}/index/${indexName}`, dimension: 'dynamodb:index:ReadCapacityUnits', role: this.scalingRole, @@ -403,7 +403,7 @@ export class Table extends Resource { * @returns An object to configure additional AutoScaling settings for this attribute */ public autoScaleGlobalSecondaryIndexWriteCapacity(indexName: string, props: EnableScalingProps): IScalableTableAttribute { - if (this.billingMode === BillingMode.PayPerRequest) { + if (this.billingMode === BillingMode.PAY_PER_REQUEST) { throw new Error('AutoScaling is not available for tables with PAY_PER_REQUEST billing mode'); } const attributePair = this.indexScaling.get(indexName); @@ -415,7 +415,7 @@ export class Table extends Resource { } return attributePair.scalableWriteAttribute = new ScalableTableAttribute(this, `${indexName}WriteScaling`, { - serviceNamespace: appscaling.ServiceNamespace.DynamoDb, + serviceNamespace: appscaling.ServiceNamespace.DYNAMODB, resourceId: `table/${this.tableName}/index/${indexName}`, dimension: 'dynamodb:index:WriteCapacityUnits', role: this.scalingRole, @@ -526,7 +526,7 @@ export class Table extends Resource { * @param props read and write capacity properties */ private validateProvisioning(props: { readCapacity?: number, writeCapacity?: number}): void { - if (this.billingMode === BillingMode.PayPerRequest) { + if (this.billingMode === BillingMode.PAY_PER_REQUEST) { if (props.readCapacity !== undefined || props.writeCapacity !== undefined) { throw new Error('you cannot provision read and write capacity for a table with PAY_PER_REQUEST billing mode'); } @@ -584,14 +584,14 @@ export class Table extends Resource { } private buildIndexProjection(props: SecondaryIndexProps): CfnTable.ProjectionProperty { - if (props.projectionType === ProjectionType.Include && !props.nonKeyAttributes) { + if (props.projectionType === ProjectionType.INCLUDE && !props.nonKeyAttributes) { // https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-dynamodb-projectionobject.html - throw new Error(`non-key attributes should be specified when using ${ProjectionType.Include} projection type`); + throw new Error(`non-key attributes should be specified when using ${ProjectionType.INCLUDE} projection type`); } - if (props.projectionType !== ProjectionType.Include && props.nonKeyAttributes) { + if (props.projectionType !== ProjectionType.INCLUDE && props.nonKeyAttributes) { // this combination causes validation exception, status code 400, while trying to create CFN stack - throw new Error(`non-key attributes should not be specified when not using ${ProjectionType.Include} projection type`); + throw new Error(`non-key attributes should not be specified when not using ${ProjectionType.INCLUDE} projection type`); } if (props.nonKeyAttributes) { @@ -599,7 +599,7 @@ export class Table extends Resource { } return { - projectionType: props.projectionType ? props.projectionType : ProjectionType.All, + projectionType: props.projectionType ? props.projectionType : ProjectionType.ALL, nonKeyAttributes: props.nonKeyAttributes ? props.nonKeyAttributes : undefined }; } @@ -663,9 +663,9 @@ export class Table extends Resource { } export enum AttributeType { - Binary = 'B', - Number = 'N', - String = 'S', + BINARY = 'B', + NUMBER = 'N', + STRING = 'S', } /** @@ -675,17 +675,17 @@ export enum BillingMode { /** * Pay only for what you use. You don't configure Read/Write capacity units. */ - PayPerRequest = 'PAY_PER_REQUEST', + PAY_PER_REQUEST = 'PAY_PER_REQUEST', /** * Explicitly specified Read/Write capacity units. */ - Provisioned = 'PROVISIONED', + PROVISIONED = 'PROVISIONED', } export enum ProjectionType { - KeysOnly = 'KEYS_ONLY', - Include = 'INCLUDE', - All = 'ALL' + KEYS_ONLY = 'KEYS_ONLY', + INCLUDE = 'INCLUDE', + ALL = 'ALL' } /** @@ -696,13 +696,13 @@ export enum ProjectionType { */ export enum StreamViewType { /** The entire item, as it appears after it was modified, is written to the stream. */ - NewImage = 'NEW_IMAGE', + NEW_IMAGE = 'NEW_IMAGE', /** The entire item, as it appeared before it was modified, is written to the stream. */ - OldImage = 'OLD_IMAGE', + OLD_IMAGE = 'OLD_IMAGE', /** Both the new and the old item images of the item are written to the stream. */ - NewAndOldImages = 'NEW_AND_OLD_IMAGES', + NEW_AND_OLD_IMAGES = 'NEW_AND_OLD_IMAGES', /** Only the key attributes of the modified item are written to the stream. */ - KeysOnly = 'KEYS_ONLY' + KEYS_ONLY = 'KEYS_ONLY' } /** diff --git a/packages/@aws-cdk/aws-dynamodb/test/integ.autoscaling.lit.ts b/packages/@aws-cdk/aws-dynamodb/test/integ.autoscaling.lit.ts index 7173832bfbde7..98b6a7fc8d3f6 100644 --- a/packages/@aws-cdk/aws-dynamodb/test/integ.autoscaling.lit.ts +++ b/packages/@aws-cdk/aws-dynamodb/test/integ.autoscaling.lit.ts @@ -6,7 +6,7 @@ const app = new cdk.App(); const stack = new cdk.Stack(app, 'aws-cdk-dynamodb'); const table = new dynamodb.Table(stack, 'Table', { - partitionKey: { name: 'hashKey', type: dynamodb.AttributeType.String } + partitionKey: { name: 'hashKey', type: dynamodb.AttributeType.STRING } }); /// !show diff --git a/packages/@aws-cdk/aws-dynamodb/test/integ.dynamodb.ondemand.ts b/packages/@aws-cdk/aws-dynamodb/test/integ.dynamodb.ondemand.ts index 38514f6e93a2c..4ff942c7de643 100644 --- a/packages/@aws-cdk/aws-dynamodb/test/integ.dynamodb.ondemand.ts +++ b/packages/@aws-cdk/aws-dynamodb/test/integ.dynamodb.ondemand.ts @@ -9,8 +9,8 @@ const TABLE = 'Table'; const TABLE_WITH_GLOBAL_AND_LOCAL_SECONDARY_INDEX = 'TableWithGlobalAndLocalSecondaryIndex'; const TABLE_WITH_GLOBAL_SECONDARY_INDEX = 'TableWithGlobalSecondaryIndex'; const TABLE_WITH_LOCAL_SECONDARY_INDEX = 'TableWithLocalSecondaryIndex'; -const TABLE_PARTITION_KEY: Attribute = { name: 'hashKey', type: AttributeType.String }; -const TABLE_SORT_KEY: Attribute = { name: 'sortKey', type: AttributeType.Number }; +const TABLE_PARTITION_KEY: Attribute = { name: 'hashKey', type: AttributeType.STRING }; +const TABLE_SORT_KEY: Attribute = { name: 'sortKey', type: AttributeType.NUMBER }; // DynamoDB global secondary index parameters const GSI_TEST_CASE_1 = 'GSI-PartitionKeyOnly'; @@ -18,8 +18,8 @@ const GSI_TEST_CASE_2 = 'GSI-PartitionAndSortKeyWithReadAndWriteCapacity'; const GSI_TEST_CASE_3 = 'GSI-ProjectionTypeKeysOnly'; const GSI_TEST_CASE_4 = 'GSI-ProjectionTypeInclude'; const GSI_TEST_CASE_5 = 'GSI-InverseTableKeySchema'; -const GSI_PARTITION_KEY: Attribute = { name: 'gsiHashKey', type: AttributeType.String }; -const GSI_SORT_KEY: Attribute = { name: 'gsiSortKey', type: AttributeType.Number }; +const GSI_PARTITION_KEY: Attribute = { name: 'gsiHashKey', type: AttributeType.STRING }; +const GSI_SORT_KEY: Attribute = { name: 'gsiSortKey', type: AttributeType.NUMBER }; const GSI_NON_KEY: string[] = []; for (let i = 0; i < 10; i++) { // 'A' to 'J' GSI_NON_KEY.push(String.fromCharCode(65 + i)); @@ -30,7 +30,7 @@ const LSI_TEST_CASE_1 = 'LSI-PartitionAndSortKey'; const LSI_TEST_CASE_2 = 'LSI-PartitionAndTableSortKey'; const LSI_TEST_CASE_3 = 'LSI-ProjectionTypeKeysOnly'; const LSI_TEST_CASE_4 = 'LSI-ProjectionTypeInclude'; -const LSI_SORT_KEY: Attribute = { name: 'lsiSortKey', type: AttributeType.Number }; +const LSI_SORT_KEY: Attribute = { name: 'lsiSortKey', type: AttributeType.NUMBER }; const LSI_NON_KEY: string[] = []; for (let i = 0; i < 10; i++) { // 'K' to 'T' LSI_NON_KEY.push(String.fromCharCode(75 + i)); @@ -42,15 +42,15 @@ const stack = new Stack(app, STACK_NAME); // Provisioned tables new Table(stack, TABLE, { - billingMode: BillingMode.PayPerRequest, + billingMode: BillingMode.PAY_PER_REQUEST, partitionKey: TABLE_PARTITION_KEY }); const tableWithGlobalAndLocalSecondaryIndex = new Table(stack, TABLE_WITH_GLOBAL_AND_LOCAL_SECONDARY_INDEX, { pointInTimeRecovery: true, serverSideEncryption: true, - stream: StreamViewType.KeysOnly, - billingMode: BillingMode.PayPerRequest, + stream: StreamViewType.KEYS_ONLY, + billingMode: BillingMode.PAY_PER_REQUEST, timeToLiveAttribute: 'timeToLive', partitionKey: TABLE_PARTITION_KEY, sortKey: TABLE_SORT_KEY @@ -71,13 +71,13 @@ tableWithGlobalAndLocalSecondaryIndex.addGlobalSecondaryIndex({ indexName: GSI_TEST_CASE_3, partitionKey: GSI_PARTITION_KEY, sortKey: GSI_SORT_KEY, - projectionType: ProjectionType.KeysOnly, + projectionType: ProjectionType.KEYS_ONLY, }); tableWithGlobalAndLocalSecondaryIndex.addGlobalSecondaryIndex({ indexName: GSI_TEST_CASE_4, partitionKey: GSI_PARTITION_KEY, sortKey: GSI_SORT_KEY, - projectionType: ProjectionType.Include, + projectionType: ProjectionType.INCLUDE, nonKeyAttributes: GSI_NON_KEY }); tableWithGlobalAndLocalSecondaryIndex.addGlobalSecondaryIndex({ @@ -97,17 +97,17 @@ tableWithGlobalAndLocalSecondaryIndex.addLocalSecondaryIndex({ tableWithGlobalAndLocalSecondaryIndex.addLocalSecondaryIndex({ indexName: LSI_TEST_CASE_3, sortKey: LSI_SORT_KEY, - projectionType: ProjectionType.KeysOnly + projectionType: ProjectionType.KEYS_ONLY }); tableWithGlobalAndLocalSecondaryIndex.addLocalSecondaryIndex({ indexName: LSI_TEST_CASE_4, sortKey: LSI_SORT_KEY, - projectionType: ProjectionType.Include, + projectionType: ProjectionType.INCLUDE, nonKeyAttributes: LSI_NON_KEY }); const tableWithGlobalSecondaryIndex = new Table(stack, TABLE_WITH_GLOBAL_SECONDARY_INDEX, { - billingMode: BillingMode.PayPerRequest, + billingMode: BillingMode.PAY_PER_REQUEST, partitionKey: TABLE_PARTITION_KEY, }); tableWithGlobalSecondaryIndex.addGlobalSecondaryIndex({ @@ -116,7 +116,7 @@ tableWithGlobalSecondaryIndex.addGlobalSecondaryIndex({ }); const tableWithLocalSecondaryIndex = new Table(stack, TABLE_WITH_LOCAL_SECONDARY_INDEX, { - billingMode: BillingMode.PayPerRequest, + billingMode: BillingMode.PAY_PER_REQUEST, partitionKey: TABLE_PARTITION_KEY, sortKey: TABLE_SORT_KEY, }); diff --git a/packages/@aws-cdk/aws-dynamodb/test/integ.dynamodb.ts b/packages/@aws-cdk/aws-dynamodb/test/integ.dynamodb.ts index 62b135a71152a..2281996c14871 100644 --- a/packages/@aws-cdk/aws-dynamodb/test/integ.dynamodb.ts +++ b/packages/@aws-cdk/aws-dynamodb/test/integ.dynamodb.ts @@ -10,8 +10,8 @@ const TABLE = 'Table'; const TABLE_WITH_GLOBAL_AND_LOCAL_SECONDARY_INDEX = 'TableWithGlobalAndLocalSecondaryIndex'; const TABLE_WITH_GLOBAL_SECONDARY_INDEX = 'TableWithGlobalSecondaryIndex'; const TABLE_WITH_LOCAL_SECONDARY_INDEX = 'TableWithLocalSecondaryIndex'; -const TABLE_PARTITION_KEY: Attribute = { name: 'hashKey', type: AttributeType.String }; -const TABLE_SORT_KEY: Attribute = { name: 'sortKey', type: AttributeType.Number }; +const TABLE_PARTITION_KEY: Attribute = { name: 'hashKey', type: AttributeType.STRING }; +const TABLE_SORT_KEY: Attribute = { name: 'sortKey', type: AttributeType.NUMBER }; // DynamoDB global secondary index parameters const GSI_TEST_CASE_1 = 'GSI-PartitionKeyOnly'; @@ -19,8 +19,8 @@ const GSI_TEST_CASE_2 = 'GSI-PartitionAndSortKeyWithReadAndWriteCapacity'; const GSI_TEST_CASE_3 = 'GSI-ProjectionTypeKeysOnly'; const GSI_TEST_CASE_4 = 'GSI-ProjectionTypeInclude'; const GSI_TEST_CASE_5 = 'GSI-InverseTableKeySchema'; -const GSI_PARTITION_KEY: Attribute = { name: 'gsiHashKey', type: AttributeType.String }; -const GSI_SORT_KEY: Attribute = { name: 'gsiSortKey', type: AttributeType.Number }; +const GSI_PARTITION_KEY: Attribute = { name: 'gsiHashKey', type: AttributeType.STRING }; +const GSI_SORT_KEY: Attribute = { name: 'gsiSortKey', type: AttributeType.NUMBER }; const GSI_NON_KEY: string[] = []; for (let i = 0; i < 10; i++) { // 'A' to 'J' GSI_NON_KEY.push(String.fromCharCode(65 + i)); @@ -31,7 +31,7 @@ const LSI_TEST_CASE_1 = 'LSI-PartitionAndSortKey'; const LSI_TEST_CASE_2 = 'LSI-PartitionAndTableSortKey'; const LSI_TEST_CASE_3 = 'LSI-ProjectionTypeKeysOnly'; const LSI_TEST_CASE_4 = 'LSI-ProjectionTypeInclude'; -const LSI_SORT_KEY: Attribute = { name: 'lsiSortKey', type: AttributeType.Number }; +const LSI_SORT_KEY: Attribute = { name: 'lsiSortKey', type: AttributeType.NUMBER }; const LSI_NON_KEY: string[] = []; for (let i = 0; i < 10; i++) { // 'K' to 'T' LSI_NON_KEY.push(String.fromCharCode(75 + i)); @@ -48,7 +48,7 @@ const table = new Table(stack, TABLE, { const tableWithGlobalAndLocalSecondaryIndex = new Table(stack, TABLE_WITH_GLOBAL_AND_LOCAL_SECONDARY_INDEX, { pointInTimeRecovery: true, serverSideEncryption: true, - stream: StreamViewType.KeysOnly, + stream: StreamViewType.KEYS_ONLY, timeToLiveAttribute: 'timeToLive', partitionKey: TABLE_PARTITION_KEY, sortKey: TABLE_SORT_KEY @@ -70,13 +70,13 @@ tableWithGlobalAndLocalSecondaryIndex.addGlobalSecondaryIndex({ indexName: GSI_TEST_CASE_3, partitionKey: GSI_PARTITION_KEY, sortKey: GSI_SORT_KEY, - projectionType: ProjectionType.KeysOnly, + projectionType: ProjectionType.KEYS_ONLY, }); tableWithGlobalAndLocalSecondaryIndex.addGlobalSecondaryIndex({ indexName: GSI_TEST_CASE_4, partitionKey: GSI_PARTITION_KEY, sortKey: GSI_SORT_KEY, - projectionType: ProjectionType.Include, + projectionType: ProjectionType.INCLUDE, nonKeyAttributes: GSI_NON_KEY }); tableWithGlobalAndLocalSecondaryIndex.addGlobalSecondaryIndex({ @@ -96,12 +96,12 @@ tableWithGlobalAndLocalSecondaryIndex.addLocalSecondaryIndex({ tableWithGlobalAndLocalSecondaryIndex.addLocalSecondaryIndex({ indexName: LSI_TEST_CASE_3, sortKey: LSI_SORT_KEY, - projectionType: ProjectionType.KeysOnly + projectionType: ProjectionType.KEYS_ONLY }); tableWithGlobalAndLocalSecondaryIndex.addLocalSecondaryIndex({ indexName: LSI_TEST_CASE_4, sortKey: LSI_SORT_KEY, - projectionType: ProjectionType.Include, + projectionType: ProjectionType.INCLUDE, nonKeyAttributes: LSI_NON_KEY }); diff --git a/packages/@aws-cdk/aws-dynamodb/test/test.dynamodb.ts b/packages/@aws-cdk/aws-dynamodb/test/test.dynamodb.ts index 3771062f01ebe..fc2bb3efce1b6 100644 --- a/packages/@aws-cdk/aws-dynamodb/test/test.dynamodb.ts +++ b/packages/@aws-cdk/aws-dynamodb/test/test.dynamodb.ts @@ -21,13 +21,13 @@ const CONSTRUCT_NAME = 'MyTable'; // DynamoDB table parameters const TABLE_NAME = 'MyTable'; -const TABLE_PARTITION_KEY: Attribute = { name: 'hashKey', type: AttributeType.String }; -const TABLE_SORT_KEY: Attribute = { name: 'sortKey', type: AttributeType.Number }; +const TABLE_PARTITION_KEY: Attribute = { name: 'hashKey', type: AttributeType.STRING }; +const TABLE_SORT_KEY: Attribute = { name: 'sortKey', type: AttributeType.NUMBER }; // DynamoDB global secondary index parameters const GSI_NAME = 'MyGSI'; -const GSI_PARTITION_KEY: Attribute = { name: 'gsiHashKey', type: AttributeType.String }; -const GSI_SORT_KEY: Attribute = { name: 'gsiSortKey', type: AttributeType.Binary }; +const GSI_PARTITION_KEY: Attribute = { name: 'gsiHashKey', type: AttributeType.STRING }; +const GSI_SORT_KEY: Attribute = { name: 'gsiSortKey', type: AttributeType.BINARY }; const GSI_NON_KEY = 'gsiNonKey'; function* GSI_GENERATOR() { let n = 0; @@ -50,7 +50,7 @@ function* NON_KEY_ATTRIBUTE_GENERATOR(nonKeyPrefix: string) { // DynamoDB local secondary index parameters const LSI_NAME = 'MyLSI'; -const LSI_SORT_KEY: Attribute = { name: 'lsiSortKey', type: AttributeType.Number }; +const LSI_SORT_KEY: Attribute = { name: 'lsiSortKey', type: AttributeType.NUMBER }; const LSI_NON_KEY = 'lsiNonKey'; function* LSI_GENERATOR() { let n = 0; @@ -222,7 +222,7 @@ export = { tableName: PhysicalName.of(TABLE_NAME), readCapacity: 42, writeCapacity: 1337, - stream: StreamViewType.NewAndOldImages, + stream: StreamViewType.NEW_AND_OLD_IMAGES, partitionKey: TABLE_PARTITION_KEY, sortKey: TABLE_SORT_KEY }); @@ -252,7 +252,7 @@ export = { tableName: PhysicalName.of(TABLE_NAME), readCapacity: 42, writeCapacity: 1337, - stream: StreamViewType.NewImage, + stream: StreamViewType.NEW_IMAGE, partitionKey: TABLE_PARTITION_KEY, sortKey: TABLE_SORT_KEY }); @@ -282,7 +282,7 @@ export = { tableName: PhysicalName.of(TABLE_NAME), readCapacity: 42, writeCapacity: 1337, - stream: StreamViewType.OldImage, + stream: StreamViewType.OLD_IMAGE, partitionKey: TABLE_PARTITION_KEY, sortKey: TABLE_SORT_KEY }); @@ -314,8 +314,8 @@ export = { writeCapacity: 1337, pointInTimeRecovery: true, serverSideEncryption: true, - billingMode: BillingMode.Provisioned, - stream: StreamViewType.KeysOnly, + billingMode: BillingMode.PROVISIONED, + stream: StreamViewType.KEYS_ONLY, timeToLiveAttribute: 'timeToLive', partitionKey: TABLE_PARTITION_KEY, sortKey: TABLE_SORT_KEY, @@ -351,7 +351,7 @@ export = { const stack = new Stack(); new Table(stack, CONSTRUCT_NAME, { tableName: PhysicalName.of(TABLE_NAME), - billingMode: BillingMode.PayPerRequest, + billingMode: BillingMode.PAY_PER_REQUEST, partitionKey: TABLE_PARTITION_KEY }); @@ -374,19 +374,19 @@ export = { const stack = new Stack(); test.throws(() => new Table(stack, CONSTRUCT_NAME, { tableName: PhysicalName.of(TABLE_NAME), - billingMode: BillingMode.PayPerRequest, + billingMode: BillingMode.PAY_PER_REQUEST, partitionKey: TABLE_PARTITION_KEY, readCapacity: 1 })); test.throws(() => new Table(stack, CONSTRUCT_NAME, { tableName: PhysicalName.of(TABLE_NAME), - billingMode: BillingMode.PayPerRequest, + billingMode: BillingMode.PAY_PER_REQUEST, partitionKey: TABLE_PARTITION_KEY, writeCapacity: 1 })); test.throws(() => new Table(stack, CONSTRUCT_NAME, { tableName: PhysicalName.of(TABLE_NAME), - billingMode: BillingMode.PayPerRequest, + billingMode: BillingMode.PAY_PER_REQUEST, partitionKey: TABLE_PARTITION_KEY, readCapacity: 1, writeCapacity: 1 @@ -447,7 +447,7 @@ export = { indexName: GSI_NAME, partitionKey: GSI_PARTITION_KEY, sortKey: GSI_SORT_KEY, - projectionType: ProjectionType.All, + projectionType: ProjectionType.ALL, readCapacity: 42, writeCapacity: 1337 }); @@ -492,7 +492,7 @@ export = { indexName: GSI_NAME, partitionKey: GSI_PARTITION_KEY, sortKey: GSI_SORT_KEY, - projectionType: ProjectionType.KeysOnly, + projectionType: ProjectionType.KEYS_ONLY, }); expect(stack).to(haveResource('AWS::DynamoDB::Table', @@ -532,7 +532,7 @@ export = { indexName: GSI_NAME, partitionKey: GSI_PARTITION_KEY, sortKey: GSI_SORT_KEY, - projectionType: ProjectionType.Include, + projectionType: ProjectionType.INCLUDE, nonKeyAttributes: [gsiNonKeyAttributeGenerator.next().value, gsiNonKeyAttributeGenerator.next().value], readCapacity: 42, writeCapacity: 1337 @@ -570,7 +570,7 @@ export = { 'when adding a global secondary index on a table with PAY_PER_REQUEST billing mode'(test: Test) { const stack = new Stack(); new Table(stack, CONSTRUCT_NAME, { - billingMode: BillingMode.PayPerRequest, + billingMode: BillingMode.PAY_PER_REQUEST, partitionKey: TABLE_PARTITION_KEY, sortKey: TABLE_SORT_KEY }).addGlobalSecondaryIndex({ @@ -611,7 +611,7 @@ export = { indexName: GSI_NAME, partitionKey: GSI_PARTITION_KEY, sortKey: GSI_SORT_KEY, - projectionType: ProjectionType.Include + projectionType: ProjectionType.INCLUDE }), /non-key attributes should be specified when using INCLUDE projection type/); test.done(); @@ -639,7 +639,7 @@ export = { test.throws(() => table.addGlobalSecondaryIndex({ indexName: GSI_NAME, partitionKey: GSI_PARTITION_KEY, - projectionType: ProjectionType.KeysOnly, + projectionType: ProjectionType.KEYS_ONLY, nonKeyAttributes: [gsiNonKeyAttributeGenerator.next().value] }), /non-key attributes should not be specified when not using INCLUDE projection type/); @@ -659,7 +659,7 @@ export = { indexName: GSI_NAME, partitionKey: GSI_PARTITION_KEY, sortKey: GSI_SORT_KEY, - projectionType: ProjectionType.Include, + projectionType: ProjectionType.INCLUDE, nonKeyAttributes: gsiNonKeyAttributes }), /a maximum number of nonKeyAttributes across all of secondary indexes is 20/); @@ -674,7 +674,7 @@ export = { indexName: GSI_NAME, partitionKey: GSI_PARTITION_KEY, sortKey: GSI_SORT_KEY, - projectionType: ProjectionType.Include, + projectionType: ProjectionType.INCLUDE, nonKeyAttributes: [GSI_NON_KEY, TABLE_PARTITION_KEY.name] // tslint:disable-next-line:max-line-length }), /a key attribute, hashKey, is part of a list of non-key attributes, gsiNonKey,hashKey, which is not allowed since all key attributes are added automatically and this configuration causes stack creation failure/); @@ -686,7 +686,7 @@ export = { const stack = new Stack(); const table = new Table(stack, CONSTRUCT_NAME, { partitionKey: TABLE_PARTITION_KEY, - billingMode: BillingMode.PayPerRequest + billingMode: BillingMode.PAY_PER_REQUEST }); test.throws(() => table.addGlobalSecondaryIndex({ @@ -861,7 +861,7 @@ export = { table.addLocalSecondaryIndex({ indexName: LSI_NAME, sortKey: LSI_SORT_KEY, - projectionType: ProjectionType.KeysOnly + projectionType: ProjectionType.KEYS_ONLY }); expect(stack).to(haveResource('AWS::DynamoDB::Table', @@ -898,7 +898,7 @@ export = { table.addLocalSecondaryIndex({ indexName: LSI_NAME, sortKey: LSI_SORT_KEY, - projectionType: ProjectionType.Include, + projectionType: ProjectionType.INCLUDE, nonKeyAttributes: [ lsiNonKeyAttributeGenerator.next().value, lsiNonKeyAttributeGenerator.next().value ] }); @@ -1045,7 +1045,7 @@ export = { 'error when enabling AutoScaling on the PAY_PER_REQUEST table'(test: Test) { // GIVEN const stack = new Stack(); - const table = new Table(stack, CONSTRUCT_NAME, { billingMode: BillingMode.PayPerRequest, partitionKey: TABLE_PARTITION_KEY }); + const table = new Table(stack, CONSTRUCT_NAME, { billingMode: BillingMode.PAY_PER_REQUEST, partitionKey: TABLE_PARTITION_KEY }); table.addGlobalSecondaryIndex({ indexName: GSI_NAME, partitionKey: GSI_PARTITION_KEY @@ -1096,7 +1096,7 @@ export = { const table = new Table(stack, CONSTRUCT_NAME, { readCapacity: 42, writeCapacity: 1337, - partitionKey: { name: 'Hash', type: AttributeType.String } + partitionKey: { name: 'Hash', type: AttributeType.STRING } }); // WHEN @@ -1178,9 +1178,9 @@ export = { const table = new Table(stack, 'my-table', { partitionKey: { name: 'id', - type: AttributeType.String + type: AttributeType.STRING }, - stream: StreamViewType.NewImage + stream: StreamViewType.NEW_IMAGE }); const user = new iam.User(stack, 'user'); @@ -1216,8 +1216,8 @@ export = { // GIVEN const stack = new Stack(); - const table = new Table(stack, 'my-table', { partitionKey: { name: 'ID', type: AttributeType.String } }); - table.addGlobalSecondaryIndex({ indexName: 'MyIndex', partitionKey: { name: 'Age', type: AttributeType.Number }}); + const table = new Table(stack, 'my-table', { partitionKey: { name: 'ID', type: AttributeType.STRING } }); + table.addGlobalSecondaryIndex({ indexName: 'MyIndex', partitionKey: { name: 'Age', type: AttributeType.NUMBER }}); const user = new iam.User(stack, 'user'); // WHEN @@ -1255,7 +1255,7 @@ export = { function testGrant(test: Test, expectedActions: string[], invocation: (user: iam.IPrincipal, table: Table) => void) { // GIVEN const stack = new Stack(); - const table = new Table(stack, 'my-table', { partitionKey: { name: 'ID', type: AttributeType.String } }); + const table = new Table(stack, 'my-table', { partitionKey: { name: 'ID', type: AttributeType.STRING } }); const user = new iam.User(stack, 'user'); // WHEN diff --git a/packages/@aws-cdk/aws-ec2/lib/instance-types.ts b/packages/@aws-cdk/aws-ec2/lib/instance-types.ts index f235f2a7ebb9a..447f0bde2eb73 100644 --- a/packages/@aws-cdk/aws-ec2/lib/instance-types.ts +++ b/packages/@aws-cdk/aws-ec2/lib/instance-types.ts @@ -11,7 +11,7 @@ export enum InstanceClass { /** * Standard instances, 3rd generation */ - Standard3 = 'm3', + STANDARD3 = 'm3', /** * Standard instances, 3rd generation @@ -21,7 +21,7 @@ export enum InstanceClass { /** * Standard instances, 4th generation */ - Standard4 = 'm4', + STANDARD4 = 'm4', /** * Standard instances, 4th generation @@ -31,7 +31,7 @@ export enum InstanceClass { /** * Standard instances, 5th generation */ - Standard5 = 'm5', + STANDARD5 = 'm5', /** * Standard instances, 5th generation @@ -41,7 +41,7 @@ export enum InstanceClass { /** * Memory optimized instances, 3rd generation */ - Memory3 = 'r3', + MEMORY3 = 'r3', /** * Memory optimized instances, 3rd generation @@ -51,7 +51,7 @@ export enum InstanceClass { /** * Memory optimized instances, 3rd generation */ - Memory4 = 'r4', + MEMORY4 = 'r4', /** * Memory optimized instances, 3rd generation @@ -61,7 +61,7 @@ export enum InstanceClass { /** * Compute optimized instances, 3rd generation */ - Compute3 = 'c3', + COMPUTE3 = 'c3', /** * Compute optimized instances, 3rd generation @@ -71,7 +71,7 @@ export enum InstanceClass { /** * Compute optimized instances, 4th generation */ - Compute4 = 'c4', + COMPUTE4 = 'c4', /** * Compute optimized instances, 4th generation @@ -81,7 +81,7 @@ export enum InstanceClass { /** * Compute optimized instances, 5th generation */ - Compute5 = 'c5', + COMPUTE5 = 'c5', /** * Compute optimized instances, 5th generation @@ -91,7 +91,7 @@ export enum InstanceClass { /** * Storage-optimized instances, 2nd generation */ - Storage2 = 'd2', + STORAGE2 = 'd2', /** * Storage-optimized instances, 2nd generation @@ -101,7 +101,7 @@ export enum InstanceClass { /** * Storage/compute balanced instances, 1st generation */ - StorageCompute1 = 'h1', + STORAGE_COMPUTE_1 = 'h1', /** * Storage/compute balanced instances, 1st generation @@ -111,7 +111,7 @@ export enum InstanceClass { /** * I/O-optimized instances, 3rd generation */ - Io3 = 'i3', + IO3 = 'i3', /** * I/O-optimized instances, 3rd generation @@ -121,7 +121,7 @@ export enum InstanceClass { /** * Burstable instances, 2nd generation */ - Burstable2 = 't2', + BURSTABLE2 = 't2', /** * Burstable instances, 2nd generation @@ -131,7 +131,7 @@ export enum InstanceClass { /** * Burstable instances, 3rd generation */ - Burstable3 = 't3', + BURSTABLE3 = 't3', /** * Burstable instances, 3rd generation @@ -141,7 +141,7 @@ export enum InstanceClass { /** * Memory-intensive instances, 1st generation */ - MemoryIntensive1 = 'x1', + MEMORY_INTENSIVE_1 = 'x1', /** * Memory-intensive instances, 1st generation @@ -151,17 +151,17 @@ export enum InstanceClass { /** * Memory-intensive instances, extended, 1st generation */ - MemoryIntensive1Extended = 'x1e', + MEMORY_INTENSIVE_1_EXTENDED = 'x1e', /** * Memory-intensive instances, 1st generation */ - X1e = 'x1e', + X1E = 'x1e', /** * Instances with customizable hardware acceleration, 1st generation */ - Fpga1 = 'f1', + FPGA1 = 'f1', /** * Instances with customizable hardware acceleration, 1st generation @@ -171,7 +171,7 @@ export enum InstanceClass { /** * Graphics-optimized instances, 3rd generation */ - Graphics3 = 'g3', + GRAPHICS3 = 'g3', /** * Graphics-optimized instances, 3rd generation @@ -181,7 +181,7 @@ export enum InstanceClass { /** * Parallel-processing optimized instances, 2nd generation */ - Parallel2 = 'p2', + PARALLEL2 = 'p2', /** * Parallel-processing optimized instances, 2nd generation @@ -191,7 +191,7 @@ export enum InstanceClass { /** * Parallel-processing optimized instances, 3nd generation */ - Parallel3 = 'p3', + PARALLEL3 = 'p3', /** * Parallel-processing optimized instances, 3nd generation @@ -203,22 +203,22 @@ export enum InstanceClass { * What size of instance to use */ export enum InstanceSize { - Nano = 'nano', - Micro = 'micro', - Small = 'small', - Medium = 'medium', - Large = 'large', - XLarge = 'xlarge', - XLarge2 = '2xlarge', - XLarge4 = '4xlarge', - XLarge8 = '8xlarge', - XLarge9 = '9xlarge', - XLarge10 = '10xlarge', - XLarge12 = '12xlarge', - XLarge16 = '16xlarge', - XLarge18 = '18xlarge', - XLarge24 = '24xlarge', - XLarge32 = '32xlarge', + NANO = 'nano', + MICRO = 'micro', + SMALL = 'small', + MEDIUM = 'medium', + LARGE = 'large', + XLARGE = 'xlarge', + XLARGE2 = '2xlarge', + XLARGE4 = '4xlarge', + XLARGE8 = '8xlarge', + XLARGE9 = '9xlarge', + XLARGE10 = '10xlarge', + XLARGE12 = '12xlarge', + XLARGE16 = '16xlarge', + XLARGE18 = '18xlarge', + XLARGE24 = '24xlarge', + XLARGE32 = '32xlarge', } /** diff --git a/packages/@aws-cdk/aws-ec2/lib/machine-image.ts b/packages/@aws-cdk/aws-ec2/lib/machine-image.ts index de885d2197e7a..3b4ec33297089 100644 --- a/packages/@aws-cdk/aws-ec2/lib/machine-image.ts +++ b/packages/@aws-cdk/aws-ec2/lib/machine-image.ts @@ -84,10 +84,10 @@ export class AmazonLinuxImage implements IMachineImageSource { private readonly storage: AmazonLinuxStorage; constructor(props?: AmazonLinuxImageProps) { - this.generation = (props && props.generation) || AmazonLinuxGeneration.AmazonLinux; - this.edition = (props && props.edition) || AmazonLinuxEdition.Standard; + this.generation = (props && props.generation) || AmazonLinuxGeneration.AMAZON_LINUX; + this.edition = (props && props.edition) || AmazonLinuxEdition.STANDARD; this.virtualization = (props && props.virtualization) || AmazonLinuxVirt.HVM; - this.storage = (props && props.storage) || AmazonLinuxStorage.GeneralPurpose; + this.storage = (props && props.storage) || AmazonLinuxStorage.GENERAL_PURPOSE; } /** @@ -97,7 +97,7 @@ export class AmazonLinuxImage implements IMachineImageSource { const parts: Array = [ this.generation, 'ami', - this.edition !== AmazonLinuxEdition.Standard ? this.edition : undefined, + this.edition !== AmazonLinuxEdition.STANDARD ? this.edition : undefined, this.virtualization, 'x86_64', // No 32-bits images vended through this this.storage @@ -116,12 +116,12 @@ export enum AmazonLinuxGeneration { /** * Amazon Linux */ - AmazonLinux = 'amzn', + AMAZON_LINUX = 'amzn', /** * Amazon Linux 2 */ - AmazonLinux2 = 'amzn2', + AMAZON_LINUX_2 = 'amzn2', } /** @@ -131,12 +131,12 @@ export enum AmazonLinuxEdition { /** * Standard edition */ - Standard = 'standard', + STANDARD = 'standard', /** * Minimal edition */ - Minimal = 'minimal' + MINIMAL = 'minimal' } /** @@ -168,7 +168,7 @@ export enum AmazonLinuxStorage { /** * General Purpose-based storage (recommended) */ - GeneralPurpose = 'gp2', + GENERAL_PURPOSE = 'gp2', } /** @@ -200,232 +200,233 @@ export class GenericLinuxImage implements IMachineImageSource { * The Windows version to use for the WindowsImage */ export enum WindowsVersion { - WindowsServer2008SP2English64BitSQL2008SP4Express = 'Windows_Server-2008-SP2-English-64Bit-SQL_2008_SP4_Express', - WindowsServer2012R2RTMChineseSimplified64BitBase = 'Windows_Server-2012-R2_RTM-Chinese_Simplified-64Bit-Base', - WindowsServer2012R2RTMChineseTraditional64BitBase = 'Windows_Server-2012-R2_RTM-Chinese_Traditional-64Bit-Base', - WindowsServer2012R2RTMDutch64BitBase = 'Windows_Server-2012-R2_RTM-Dutch-64Bit-Base', - WindowsServer2012R2RTMEnglish64BitSQL2014SP2Enterprise = 'Windows_Server-2012-R2_RTM-English-64Bit-SQL_2014_SP2_Enterprise', - WindowsServer2012R2RTMHungarian64BitBase = 'Windows_Server-2012-R2_RTM-Hungarian-64Bit-Base', - WindowsServer2012R2RTMJapanese64BitBase = 'Windows_Server-2012-R2_RTM-Japanese-64Bit-Base', - WindowsServer2016EnglishCoreContainers = 'Windows_Server-2016-English-Core-Containers', - WindowsServer2016EnglishCoreSQL2016SP1Web = 'Windows_Server-2016-English-Core-SQL_2016_SP1_Web', - WindowsServer2016GermanFullBase = 'Windows_Server-2016-German-Full-Base', - WindowsServer2003R2SP2LanguagePacks32BitBase = 'Windows_Server-2003-R2_SP2-Language_Packs-32Bit-Base', - WindowsServer2008R2SP1English64BitSQL2008R2SP3Web = 'Windows_Server-2008-R2_SP1-English-64Bit-SQL_2008_R2_SP3_Web', - WindowsServer2008R2SP1English64BitSQL2012SP4Express = 'Windows_Server-2008-R2_SP1-English-64Bit-SQL_2012_SP4_Express', - WindowsServer2008R2SP1PortugueseBrazil64BitCore = 'Windows_Server-2008-R2_SP1-Portuguese_Brazil-64Bit-Core', - WindowsServer2012R2RTMEnglish64BitSQL2016SP2Standard = 'Windows_Server-2012-R2_RTM-English-64Bit-SQL_2016_SP2_Standard', - WindowsServer2012RTMEnglish64BitSQL2014SP2Express = 'Windows_Server-2012-RTM-English-64Bit-SQL_2014_SP2_Express', - WindowsServer2012RTMItalian64BitBase = 'Windows_Server-2012-RTM-Italian-64Bit-Base', - WindowsServer2016EnglishCoreSQL2016SP1Express = 'Windows_Server-2016-English-Core-SQL_2016_SP1_Express', - WindowsServer2016EnglishDeepLearning = 'Windows_Server-2016-English-Deep-Learning', - WindowsServer2019ItalianFullBase = 'Windows_Server-2019-Italian-Full-Base', - WindowsServer2008R2SP1Korean64BitBase = 'Windows_Server-2008-R2_SP1-Korean-64Bit-Base', - WindowsServer2012R2RTMEnglish64BitSQL2016SP1Express = 'Windows_Server-2012-R2_RTM-English-64Bit-SQL_2016_SP1_Express', - WindowsServer2012R2RTMJapanese64BitSQL2016SP2Web = 'Windows_Server-2012-R2_RTM-Japanese-64Bit-SQL_2016_SP2_Web', - WindowsServer2016JapaneseFullSQL2016SP2Web = 'Windows_Server-2016-Japanese-Full-SQL_2016_SP2_Web', - WindowsServer2016KoreanFullBase = 'Windows_Server-2016-Korean-Full-Base', - WindowsServer2016KoreanFullSQL2016SP2Standard = 'Windows_Server-2016-Korean-Full-SQL_2016_SP2_Standard', - WindowsServer2016PortuguesePortugalFullBase = 'Windows_Server-2016-Portuguese_Portugal-Full-Base', - WindowsServer2019EnglishFullSQL2017Web = 'Windows_Server-2019-English-Full-SQL_2017_Web', - WindowsServer2019FrenchFullBase = 'Windows_Server-2019-French-Full-Base', - WindowsServer2019KoreanFullBase = 'Windows_Server-2019-Korean-Full-Base', - WindowsServer2008R2SP1ChineseHongKongSAR64BitBase = 'Windows_Server-2008-R2_SP1-Chinese_Hong_Kong_SAR-64Bit-Base', - WindowsServer2008R2SP1ChinesePRC64BitBase = 'Windows_Server-2008-R2_SP1-Chinese_PRC-64Bit-Base', - WindowsServer2012RTMFrench64BitBase = 'Windows_Server-2012-RTM-French-64Bit-Base', - WindowsServer2016EnglishFullContainers = 'Windows_Server-2016-English-Full-Containers', - WindowsServer2016EnglishFullSQL2016SP1Standard = 'Windows_Server-2016-English-Full-SQL_2016_SP1_Standard', - WindowsServer2016RussianFullBase = 'Windows_Server-2016-Russian-Full-Base', - WindowsServer2019ChineseSimplifiedFullBase = 'Windows_Server-2019-Chinese_Simplified-Full-Base', - WindowsServer2019EnglishFullSQL2016SP2Standard = 'Windows_Server-2019-English-Full-SQL_2016_SP2_Standard', - WindowsServer2019HungarianFullBase = 'Windows_Server-2019-Hungarian-Full-Base', - WindowsServer2008R2SP1English64BitSQL2008R2SP3Express = 'Windows_Server-2008-R2_SP1-English-64Bit-SQL_2008_R2_SP3_Express', - WindowsServer2008R2SP1LanguagePacks64BitBase = 'Windows_Server-2008-R2_SP1-Language_Packs-64Bit-Base', - WindowsServer2008SP2English32BitBase = 'Windows_Server-2008-SP2-English-32Bit-Base', - WindowsServer2012R2RTMEnglish64BitSQL2012SP4Enterprise = 'Windows_Server-2012-R2_RTM-English-64Bit-SQL_2012_SP4_Enterprise', - WindowsServer2012RTMChineseTraditional64BitBase = 'Windows_Server-2012-RTM-Chinese_Traditional-64Bit-Base', - WindowsServer2012RTMEnglish64BitSQL2008R2SP3Express = 'Windows_Server-2012-RTM-English-64Bit-SQL_2008_R2_SP3_Express', - WindowsServer2012RTMEnglish64BitSQL2014SP2Standard = 'Windows_Server-2012-RTM-English-64Bit-SQL_2014_SP2_Standard', - WindowsServer2012RTMJapanese64BitSQL2014SP2Express = 'Windows_Server-2012-RTM-Japanese-64Bit-SQL_2014_SP2_Express', - WindowsServer2016PolishFullBase = 'Windows_Server-2016-Polish-Full-Base', - WindowsServer2019EnglishFullSQL2016SP2Web = 'Windows_Server-2019-English-Full-SQL_2016_SP2_Web', - WindowsServer2012R2RTMEnglish64BitSQL2014SP3Standard = 'Windows_Server-2012-R2_RTM-English-64Bit-SQL_2014_SP3_Standard', - WindowsServer2012R2RTMEnglish64BitSQL2016SP2Express = 'Windows_Server-2012-R2_RTM-English-64Bit-SQL_2016_SP2_Express', - WindowsServer2012R2RTMEnglishDeepLearning = 'Windows_Server-2012-R2_RTM-English-Deep-Learning', - WindowsServer2012R2RTMGerman64BitBase = 'Windows_Server-2012-R2_RTM-German-64Bit-Base', - WindowsServer2012R2RTMJapanese64BitSQL2016SP1Express = 'Windows_Server-2012-R2_RTM-Japanese-64Bit-SQL_2016_SP1_Express', - WindowsServer2012R2RTMRussian64BitBase = 'Windows_Server-2012-R2_RTM-Russian-64Bit-Base', - WindowsServer2012RTMChineseTraditionalHongKongSAR64BitBase = 'Windows_Server-2012-RTM-Chinese_Traditional_Hong_Kong_SAR-64Bit-Base', - WindowsServer2012RTMHungarian64BitBase = 'Windows_Server-2012-RTM-Hungarian-64Bit-Base', - WindowsServer2012RTMJapanese64BitSQL2014SP3Standard = 'Windows_Server-2012-RTM-Japanese-64Bit-SQL_2014_SP3_Standard', - WindowsServer2019EnglishFullHyperV = 'Windows_Server-2019-English-Full-HyperV', - WindowsServer2003R2SP2English64BitSQL2005SP4Express = 'Windows_Server-2003-R2_SP2-English-64Bit-SQL_2005_SP4_Express', - WindowsServer2008R2SP1Japanese64BitSQL2012SP4Express = 'Windows_Server-2008-R2_SP1-Japanese-64Bit-SQL_2012_SP4_Express', - WindowsServer2012RTMGerman64BitBase = 'Windows_Server-2012-RTM-German-64Bit-Base', - WindowsServer2012RTMJapanese64BitSQL2008R2SP3Standard = 'Windows_Server-2012-RTM-Japanese-64Bit-SQL_2008_R2_SP3_Standard', - WindowsServer2016EnglishFullSQL2016SP2Standard = 'Windows_Server-2016-English-Full-SQL_2016_SP2_Standard', - WindowsServer2019EnglishFullSQL2017Express = 'Windows_Server-2019-English-Full-SQL_2017_Express', - WindowsServer2019JapaneseFullBase = 'Windows_Server-2019-Japanese-Full-Base', - WindowsServer2019RussianFullBase = 'Windows_Server-2019-Russian-Full-Base', - WindowsServer2012R2RTMEnglish64BitSQL2014SP2Standard = 'Windows_Server-2012-R2_RTM-English-64Bit-SQL_2014_SP2_Standard', - WindowsServer2012R2RTMItalian64BitBase = 'Windows_Server-2012-R2_RTM-Italian-64Bit-Base', - WindowsServer2012RTMEnglish64BitBase = 'Windows_Server-2012-RTM-English-64Bit-Base', - WindowsServer2012RTMEnglish64BitSQL2008R2SP3Standard = 'Windows_Server-2012-RTM-English-64Bit-SQL_2008_R2_SP3_Standard', - WindowsServer2016EnglishFullHyperV = 'Windows_Server-2016-English-Full-HyperV', - WindowsServer2016EnglishFullSQL2016SP2Enterprise = 'Windows_Server-2016-English-Full-SQL_2016_SP2_Enterprise', - WindowsServer2019ChineseTraditionalFullBase = 'Windows_Server-2019-Chinese_Traditional-Full-Base', - WindowsServer2019EnglishCoreBase = 'Windows_Server-2019-English-Core-Base', - WindowsServer2019EnglishCoreContainersLatest = 'Windows_Server-2019-English-Core-ContainersLatest', - WindowsServer2008SP2English64BitBase = 'Windows_Server-2008-SP2-English-64Bit-Base', - WindowsServer2012R2RTMFrench64BitBase = 'Windows_Server-2012-R2_RTM-French-64Bit-Base', - WindowsServer2012R2RTMPolish64BitBase = 'Windows_Server-2012-R2_RTM-Polish-64Bit-Base', - WindowsServer2012RTMEnglish64BitSQL2012SP4Express = 'Windows_Server-2012-RTM-English-64Bit-SQL_2012_SP4_Express', - WindowsServer2012RTMEnglish64BitSQL2014SP3Standard = 'Windows_Server-2012-RTM-English-64Bit-SQL_2014_SP3_Standard', - WindowsServer2012RTMJapanese64BitSQL2012SP4Standard = 'Windows_Server-2012-RTM-Japanese-64Bit-SQL_2012_SP4_Standard', - WindowsServer2016EnglishCoreContainersLatest = 'Windows_Server-2016-English-Core-ContainersLatest', - WindowsServer2019EnglishFullSQL2016SP2Express = 'Windows_Server-2019-English-Full-SQL_2016_SP2_Express', - WindowsServer2019TurkishFullBase = 'Windows_Server-2019-Turkish-Full-Base', - WindowsServer2012R2RTMEnglish64BitSQL2014SP2Express = 'Windows_Server-2012-R2_RTM-English-64Bit-SQL_2014_SP2_Express', - WindowsServer2012R2RTMEnglish64BitSQL2014SP3Web = 'Windows_Server-2012-R2_RTM-English-64Bit-SQL_2014_SP3_Web', - WindowsServer2012R2RTMJapanese64BitSQL2016SP1Web = 'Windows_Server-2012-R2_RTM-Japanese-64Bit-SQL_2016_SP1_Web', - WindowsServer2012R2RTMPortugueseBrazil64BitBase = 'Windows_Server-2012-R2_RTM-Portuguese_Brazil-64Bit-Base', - WindowsServer2012R2RTMPortuguesePortugal64BitBase = 'Windows_Server-2012-R2_RTM-Portuguese_Portugal-64Bit-Base', - WindowsServer2012R2RTMSwedish64BitBase = 'Windows_Server-2012-R2_RTM-Swedish-64Bit-Base', - WindowsServer2016EnglishFullSQL2016SP1Express = 'Windows_Server-2016-English-Full-SQL_2016_SP1_Express', - WindowsServer2016ItalianFullBase = 'Windows_Server-2016-Italian-Full-Base', - WindowsServer2016SpanishFullBase = 'Windows_Server-2016-Spanish-Full-Base', - WindowsServer2019EnglishFullSQL2017Standard = 'Windows_Server-2019-English-Full-SQL_2017_Standard', - WindowsServer2003R2SP2LanguagePacks64BitSQL2005SP4Standard = 'Windows_Server-2003-R2_SP2-Language_Packs-64Bit-SQL_2005_SP4_Standard', - WindowsServer2008R2SP1Japanese64BitSQL2008R2SP3Standard = 'Windows_Server-2008-R2_SP1-Japanese-64Bit-SQL_2008_R2_SP3_Standard', - WindowsServer2012R2RTMJapanese64BitSQL2016SP1Standard = 'Windows_Server-2012-R2_RTM-Japanese-64Bit-SQL_2016_SP1_Standard', - WindowsServer2012RTMEnglish64BitSQL2008R2SP3Web = 'Windows_Server-2012-RTM-English-64Bit-SQL_2008_R2_SP3_Web', - WindowsServer2012RTMJapanese64BitSQL2014SP2Web = 'Windows_Server-2012-RTM-Japanese-64Bit-SQL_2014_SP2_Web', - WindowsServer2016EnglishCoreSQL2016SP2Enterprise = 'Windows_Server-2016-English-Core-SQL_2016_SP2_Enterprise', - WindowsServer2016PortugueseBrazilFullBase = 'Windows_Server-2016-Portuguese_Brazil-Full-Base', - WindowsServer2019EnglishFullBase = 'Windows_Server-2019-English-Full-Base', - WindowsServer2003R2SP2English32BitBase = 'Windows_Server-2003-R2_SP2-English-32Bit-Base', - WindowsServer2012R2RTMCzech64BitBase = 'Windows_Server-2012-R2_RTM-Czech-64Bit-Base', - WindowsServer2012R2RTMEnglish64BitSQL2016SP1Standard = 'Windows_Server-2012-R2_RTM-English-64Bit-SQL_2016_SP1_Standard', - WindowsServer2012R2RTMJapanese64BitSQL2014SP2Express = 'Windows_Server-2012-R2_RTM-Japanese-64Bit-SQL_2014_SP2_Express', - WindowsServer2012RTMEnglish64BitSQL2012SP4Standard = 'Windows_Server-2012-RTM-English-64Bit-SQL_2012_SP4_Standard', - WindowsServer2016EnglishCoreSQL2016SP1Enterprise = 'Windows_Server-2016-English-Core-SQL_2016_SP1_Enterprise', - WindowsServer2016JapaneseFullSQL2016SP1Web = 'Windows_Server-2016-Japanese-Full-SQL_2016_SP1_Web', - WindowsServer2016SwedishFullBase = 'Windows_Server-2016-Swedish-Full-Base', - WindowsServer2016TurkishFullBase = 'Windows_Server-2016-Turkish-Full-Base', - WindowsServer2008R2SP1English64BitCoreSQL2012SP4Standard = 'Windows_Server-2008-R2_SP1-English-64Bit-Core_SQL_2012_SP4_Standard', - WindowsServer2008R2SP1LanguagePacks64BitSQL2008R2SP3Standard = 'Windows_Server-2008-R2_SP1-Language_Packs-64Bit-SQL_2008_R2_SP3_Standard', - WindowsServer2012RTMCzech64BitBase = 'Windows_Server-2012-RTM-Czech-64Bit-Base', - WindowsServer2012RTMTurkish64BitBase = 'Windows_Server-2012-RTM-Turkish-64Bit-Base', - WindowsServer2016DutchFullBase = 'Windows_Server-2016-Dutch-Full-Base', - WindowsServer2016EnglishFullSQL2016SP2Express = 'Windows_Server-2016-English-Full-SQL_2016_SP2_Express', - WindowsServer2016EnglishFullSQL2017Enterprise = 'Windows_Server-2016-English-Full-SQL_2017_Enterprise', - WindowsServer2016HungarianFullBase = 'Windows_Server-2016-Hungarian-Full-Base', - WindowsServer2016KoreanFullSQL2016SP1Standard = 'Windows_Server-2016-Korean-Full-SQL_2016_SP1_Standard', - WindowsServer2019SpanishFullBase = 'Windows_Server-2019-Spanish-Full-Base', - WindowsServer2003R2SP2English64BitBase = 'Windows_Server-2003-R2_SP2-English-64Bit-Base', - WindowsServer2008R2SP1English64BitBase = 'Windows_Server-2008-R2_SP1-English-64Bit-Base', - WindowsServer2008R2SP1LanguagePacks64BitSQL2008R2SP3Express = 'Windows_Server-2008-R2_SP1-Language_Packs-64Bit-SQL_2008_R2_SP3_Express', - WindowsServer2008SP2PortugueseBrazil64BitBase = 'Windows_Server-2008-SP2-Portuguese_Brazil-64Bit-Base', - WindowsServer2012R2RTMEnglish64BitSQL2016SP1Web = 'Windows_Server-2012-R2_RTM-English-64Bit-SQL_2016_SP1_Web', - WindowsServer2012R2RTMJapanese64BitSQL2014SP3Express = 'Windows_Server-2012-R2_RTM-Japanese-64Bit-SQL_2014_SP3_Express', - WindowsServer2012R2RTMJapanese64BitSQL2016SP2Enterprise = 'Windows_Server-2012-R2_RTM-Japanese-64Bit-SQL_2016_SP2_Enterprise', - WindowsServer2012RTMJapanese64BitBase = 'Windows_Server-2012-RTM-Japanese-64Bit-Base', - WindowsServer2019EnglishFullContainersLatest = 'Windows_Server-2019-English-Full-ContainersLatest', - WindowsServer2019EnglishFullSQL2017Enterprise = 'Windows_Server-2019-English-Full-SQL_2017_Enterprise', - WindowsServer1709EnglishCoreContainersLatest = 'Windows_Server-1709-English-Core-ContainersLatest', - WindowsServer1803EnglishCoreBase = 'Windows_Server-1803-English-Core-Base', - WindowsServer2008R2SP1English64BitSQL2012SP4Web = 'Windows_Server-2008-R2_SP1-English-64Bit-SQL_2012_SP4_Web', - WindowsServer2008R2SP1Japanese64BitBase = 'Windows_Server-2008-R2_SP1-Japanese-64Bit-Base', - WindowsServer2008SP2English64BitSQL2008SP4Standard = 'Windows_Server-2008-SP2-English-64Bit-SQL_2008_SP4_Standard', - WindowsServer2012R2RTMEnglish64BitBase = 'Windows_Server-2012-R2_RTM-English-64Bit-Base', - WindowsServer2012RTMPortugueseBrazil64BitBase = 'Windows_Server-2012-RTM-Portuguese_Brazil-64Bit-Base', - WindowsServer2016EnglishFullSQL2016SP1Web = 'Windows_Server-2016-English-Full-SQL_2016_SP1_Web', - WindowsServer2016EnglishP3 = 'Windows_Server-2016-English-P3', - WindowsServer2016JapaneseFullSQL2016SP1Enterprise = 'Windows_Server-2016-Japanese-Full-SQL_2016_SP1_Enterprise', - WindowsServer2003R2SP2LanguagePacks64BitBase = 'Windows_Server-2003-R2_SP2-Language_Packs-64Bit-Base', - WindowsServer2012R2RTMChineseTraditionalHongKong64BitBase = 'Windows_Server-2012-R2_RTM-Chinese_Traditional_Hong_Kong-64Bit-Base', - WindowsServer2012R2RTMEnglish64BitSQL2014SP3Express = 'Windows_Server-2012-R2_RTM-English-64Bit-SQL_2014_SP3_Express', - WindowsServer2012R2RTMEnglish64BitSQL2016SP2Enterprise = 'Windows_Server-2012-R2_RTM-English-64Bit-SQL_2016_SP2_Enterprise', - WindowsServer2012RTMChineseSimplified64BitBase = 'Windows_Server-2012-RTM-Chinese_Simplified-64Bit-Base', - WindowsServer2012RTMEnglish64BitSQL2012SP4Web = 'Windows_Server-2012-RTM-English-64Bit-SQL_2012_SP4_Web', - WindowsServer2012RTMJapanese64BitSQL2014SP3Web = 'Windows_Server-2012-RTM-Japanese-64Bit-SQL_2014_SP3_Web', - WindowsServer2016JapaneseFullBase = 'Windows_Server-2016-Japanese-Full-Base', - WindowsServer2016JapaneseFullSQL2016SP1Express = 'Windows_Server-2016-Japanese-Full-SQL_2016_SP1_Express', - WindowsServer1803EnglishCoreContainersLatest = 'Windows_Server-1803-English-Core-ContainersLatest', - WindowsServer2008R2SP1Japanese64BitSQL2012SP4Standard = 'Windows_Server-2008-R2_SP1-Japanese-64Bit-SQL_2012_SP4_Standard', - WindowsServer2012R2RTMEnglish64BitCore = 'Windows_Server-2012-R2_RTM-English-64Bit-Core', - WindowsServer2012R2RTMEnglish64BitSQL2014SP2Web = 'Windows_Server-2012-R2_RTM-English-64Bit-SQL_2014_SP2_Web', - WindowsServer2012R2RTMEnglish64BitSQL2014SP3Enterprise = 'Windows_Server-2012-R2_RTM-English-64Bit-SQL_2014_SP3_Enterprise', - WindowsServer2012R2RTMJapanese64BitSQL2016SP2Standard = 'Windows_Server-2012-R2_RTM-Japanese-64Bit-SQL_2016_SP2_Standard', - WindowsServer2012RTMEnglish64BitSQL2014SP3Web = 'Windows_Server-2012-RTM-English-64Bit-SQL_2014_SP3_Web', - WindowsServer2012RTMSwedish64BitBase = 'Windows_Server-2012-RTM-Swedish-64Bit-Base', - WindowsServer2016ChineseSimplifiedFullBase = 'Windows_Server-2016-Chinese_Simplified-Full-Base', - WindowsServer2019PolishFullBase = 'Windows_Server-2019-Polish-Full-Base', - WindowsServer2008R2SP1Japanese64BitSQL2008R2SP3Web = 'Windows_Server-2008-R2_SP1-Japanese-64Bit-SQL_2008_R2_SP3_Web', - WindowsServer2008R2SP1PortugueseBrazil64BitBase = 'Windows_Server-2008-R2_SP1-Portuguese_Brazil-64Bit-Base', - WindowsServer2012R2RTMJapanese64BitSQL2016SP1Enterprise = 'Windows_Server-2012-R2_RTM-Japanese-64Bit-SQL_2016_SP1_Enterprise', - WindowsServer2012R2RTMJapanese64BitSQL2016SP2Express = 'Windows_Server-2012-R2_RTM-Japanese-64Bit-SQL_2016_SP2_Express', - WindowsServer2012RTMEnglish64BitSQL2014SP3Express = 'Windows_Server-2012-RTM-English-64Bit-SQL_2014_SP3_Express', - WindowsServer2012RTMJapanese64BitSQL2014SP2Standard = 'Windows_Server-2012-RTM-Japanese-64Bit-SQL_2014_SP2_Standard', - WindowsServer2016EnglishCoreBase = 'Windows_Server-2016-English-Core-Base', - WindowsServer2016EnglishFullBase = 'Windows_Server-2016-English-Full-Base', - WindowsServer2016EnglishFullSQL2017Web = 'Windows_Server-2016-English-Full-SQL_2017_Web', - WindowsServer2019GermanFullBase = 'Windows_Server-2019-German-Full-Base', - WindowsServer2003R2SP2English64BitSQL2005SP4Standard = 'Windows_Server-2003-R2_SP2-English-64Bit-SQL_2005_SP4_Standard', - WindowsServer2008R2SP1English64BitSQL2012SP4Enterprise = 'Windows_Server-2008-R2_SP1-English-64Bit-SQL_2012_SP4_Enterprise', - WindowsServer2008R2SP1Japanese64BitSQL2008R2SP3Express = 'Windows_Server-2008-R2_SP1-Japanese-64Bit-SQL_2008_R2_SP3_Express', - WindowsServer2012R2RTMEnglish64BitSQL2016SP1Enterprise = 'Windows_Server-2012-R2_RTM-English-64Bit-SQL_2016_SP1_Enterprise', - WindowsServer2012RTMEnglish64BitSQL2014SP2Web = 'Windows_Server-2012-RTM-English-64Bit-SQL_2014_SP2_Web', - WindowsServer2012RTMJapanese64BitSQL2008R2SP3Express = 'Windows_Server-2012-RTM-Japanese-64Bit-SQL_2008_R2_SP3_Express', - WindowsServer2016FrenchFullBase = 'Windows_Server-2016-French-Full-Base', - WindowsServer2016JapaneseFullSQL2016SP2Enterprise = 'Windows_Server-2016-Japanese-Full-SQL_2016_SP2_Enterprise', - WindowsServer2019CzechFullBase = 'Windows_Server-2019-Czech-Full-Base', - WindowsServer1809EnglishCoreBase = 'Windows_Server-1809-English-Core-Base', - WindowsServer1809EnglishCoreContainersLatest = 'Windows_Server-1809-English-Core-ContainersLatest', - WindowsServer2003R2SP2LanguagePacks64BitSQL2005SP4Express = 'Windows_Server-2003-R2_SP2-Language_Packs-64Bit-SQL_2005_SP4_Express', - WindowsServer2012R2RTMTurkish64BitBase = 'Windows_Server-2012-R2_RTM-Turkish-64Bit-Base', - WindowsServer2012RTMJapanese64BitSQL2012SP4Web = 'Windows_Server-2012-RTM-Japanese-64Bit-SQL_2012_SP4_Web', - WindowsServer2012RTMPolish64BitBase = 'Windows_Server-2012-RTM-Polish-64Bit-Base', - WindowsServer2012RTMSpanish64BitBase = 'Windows_Server-2012-RTM-Spanish-64Bit-Base', - WindowsServer2016EnglishFullSQL2016SP1Enterprise = 'Windows_Server-2016-English-Full-SQL_2016_SP1_Enterprise', - WindowsServer2016JapaneseFullSQL2016SP2Express = 'Windows_Server-2016-Japanese-Full-SQL_2016_SP2_Express', - WindowsServer2019EnglishFullSQL2016SP2Enterprise = 'Windows_Server-2019-English-Full-SQL_2016_SP2_Enterprise', - WindowsServer1709EnglishCoreBase = 'Windows_Server-1709-English-Core-Base', - WindowsServer2008R2SP1English64BitSQL2012RTMSP2Enterprise = 'Windows_Server-2008-R2_SP1-English-64Bit-SQL_2012_RTM_SP2_Enterprise', - WindowsServer2008R2SP1English64BitSQL2012SP4Standard = 'Windows_Server-2008-R2_SP1-English-64Bit-SQL_2012_SP4_Standard', - WindowsServer2008SP2PortugueseBrazil32BitBase = 'Windows_Server-2008-SP2-Portuguese_Brazil-32Bit-Base', - WindowsServer2012R2RTMJapanese64BitSQL2014SP2Standard = 'Windows_Server-2012-R2_RTM-Japanese-64Bit-SQL_2014_SP2_Standard', - WindowsServer2012RTMJapanese64BitSQL2012SP4Express = 'Windows_Server-2012-RTM-Japanese-64Bit-SQL_2012_SP4_Express', - WindowsServer2012RTMPortuguesePortugal64BitBase = 'Windows_Server-2012-RTM-Portuguese_Portugal-64Bit-Base', - WindowsServer2016CzechFullBase = 'Windows_Server-2016-Czech-Full-Base', - WindowsServer2016JapaneseFullSQL2016SP1Standard = 'Windows_Server-2016-Japanese-Full-SQL_2016_SP1_Standard', - WindowsServer2019DutchFullBase = 'Windows_Server-2019-Dutch-Full-Base', - WindowsServer2008R2SP1English64BitCore = 'Windows_Server-2008-R2_SP1-English-64Bit-Core', - WindowsServer2012R2RTMEnglish64BitSQL2016SP2Web = 'Windows_Server-2012-R2_RTM-English-64Bit-SQL_2016_SP2_Web', - WindowsServer2012R2RTMKorean64BitBase = 'Windows_Server-2012-R2_RTM-Korean-64Bit-Base', - WindowsServer2012RTMDutch64BitBase = 'Windows_Server-2012-RTM-Dutch-64Bit-Base', - WindowsServer2016English64BitSQL2012SP4Enterprise = 'Windows_Server-2016-English-64Bit-SQL_2012_SP4_Enterprise', - WindowsServer2016EnglishCoreSQL2016SP1Standard = 'Windows_Server-2016-English-Core-SQL_2016_SP1_Standard', - WindowsServer2016EnglishCoreSQL2016SP2Express = 'Windows_Server-2016-English-Core-SQL_2016_SP2_Express', - WindowsServer2016EnglishCoreSQL2016SP2Web = 'Windows_Server-2016-English-Core-SQL_2016_SP2_Web', - WindowsServer2016EnglishFullSQL2017Standard = 'Windows_Server-2016-English-Full-SQL_2017_Standard', - WindowsServer2019PortugueseBrazilFullBase = 'Windows_Server-2019-Portuguese_Brazil-Full-Base', - WindowsServer2008R2SP1English64BitSQL2008R2SP3Standard = 'Windows_Server-2008-R2_SP1-English-64Bit-SQL_2008_R2_SP3_Standard', - WindowsServer2008R2SP1English64BitSharePoint2010SP2Foundation = 'Windows_Server-2008-R2_SP1-English-64Bit-SharePoint_2010_SP2_Foundation', - WindowsServer2012R2RTMEnglishP3 = 'Windows_Server-2012-R2_RTM-English-P3', - WindowsServer2012R2RTMJapanese64BitSQL2014SP3Standard = 'Windows_Server-2012-R2_RTM-Japanese-64Bit-SQL_2014_SP3_Standard', - WindowsServer2012R2RTMSpanish64BitBase = 'Windows_Server-2012-R2_RTM-Spanish-64Bit-Base', - WindowsServer2012RTMJapanese64BitSQL2014SP3Express = 'Windows_Server-2012-RTM-Japanese-64Bit-SQL_2014_SP3_Express', - WindowsServer2016EnglishCoreSQL2016SP2Standard = 'Windows_Server-2016-English-Core-SQL_2016_SP2_Standard', - WindowsServer2016JapaneseFullSQL2016SP2Standard = 'Windows_Server-2016-Japanese-Full-SQL_2016_SP2_Standard', - WindowsServer2019PortuguesePortugalFullBase = 'Windows_Server-2019-Portuguese_Portugal-Full-Base', - WindowsServer2019SwedishFullBase = 'Windows_Server-2019-Swedish-Full-Base', - WindowsServer2012R2RTMEnglish64BitHyperV = 'Windows_Server-2012-R2_RTM-English-64Bit-HyperV', - WindowsServer2012RTMKorean64BitBase = 'Windows_Server-2012-RTM-Korean-64Bit-Base', - WindowsServer2012RTMRussian64BitBase = 'Windows_Server-2012-RTM-Russian-64Bit-Base', - WindowsServer2016ChineseTraditionalFullBase = 'Windows_Server-2016-Chinese_Traditional-Full-Base', - WindowsServer2016EnglishFullSQL2016SP2Web = 'Windows_Server-2016-English-Full-SQL_2016_SP2_Web', - WindowsServer2016EnglishFullSQL2017Express = 'Windows_Server-2016-English-Full-SQL_2017_Express', + WINDOWS_SERVER_2008_SP2_ENGLISH_64BIT_SQL_2008_SP4_EXPRESS = 'Windows_Server-2008-SP2-English-64Bit-SQL_2008_SP4_Express', + WINDOWS_SERVER_2012_R2_RTM_CHINESE_SIMPLIFIED_64BIT_BASE = 'Windows_Server-2012-R2_RTM-Chinese_Simplified-64Bit-Base', + WINDOWS_SERVER_2012_R2_RTM_CHINESE_TRADITIONAL_64BIT_BASE = 'Windows_Server-2012-R2_RTM-Chinese_Traditional-64Bit-Base', + WINDOWS_SERVER_2012_R2_RTM_DUTCH_64BIT_BASE = 'Windows_Server-2012-R2_RTM-Dutch-64Bit-Base', + WINDOWS_SERVER_2012_R2_RTM_ENGLISH_64BIT_SQL_2014_SP2_ENTERPRISE = 'Windows_Server-2012-R2_RTM-English-64Bit-SQL_2014_SP2_Enterprise', + WINDOWS_SERVER_2012_R2_RTM_HUNGARIAN_64BIT_BASE = 'Windows_Server-2012-R2_RTM-Hungarian-64Bit-Base', + WINDOWS_SERVER_2012_R2_RTM_JAPANESE_64BIT_BASE = 'Windows_Server-2012-R2_RTM-Japanese-64Bit-Base', + WINDOWS_SERVER_2016_ENGLISH_CORE_CONTAINERS = 'Windows_Server-2016-English-Core-Containers', + WINDOWS_SERVER_2016_ENGLISH_CORE_SQL_2016_SP1_WEB = 'Windows_Server-2016-English-Core-SQL_2016_SP1_Web', + WINDOWS_SERVER_2016_GERMAL_FULL_BASE = 'Windows_Server-2016-German-Full-Base', + WINDOWS_SERVER_2003_R2_SP2_LANGUAGE_PACKS_32BIT_BASE = 'Windows_Server-2003-R2_SP2-Language_Packs-32Bit-Base', + WINDOWS_SERVER_2008_R2_SP1_ENGLISH_64BIT_SQL_2008_R2_SP3_WEB = 'Windows_Server-2008-R2_SP1-English-64Bit-SQL_2008_R2_SP3_Web', + WINDOWS_SERVER_2008_R2_SP1_ENGLISH_64BIT_SQL_2012_SP4_EXPRESS = 'Windows_Server-2008-R2_SP1-English-64Bit-SQL_2012_SP4_Express', + WINDOWS_SERVER_2012_R2_SP1_PORTUGESE_BRAZIL_64BIT_CORE = 'Windows_Server-2008-R2_SP1-Portuguese_Brazil-64Bit-Core', + WINDOWS_SERVER_2012_R2_RTM_ENGLISH_64BIT_SQL_2016_SP2_STANDARD = 'Windows_Server-2012-R2_RTM-English-64Bit-SQL_2016_SP2_Standard', + WINDOWS_SERVER_2012_RTM_ENGLISH_64BIT_SQL_2014_SP2_EXPRESS = 'Windows_Server-2012-RTM-English-64Bit-SQL_2014_SP2_Express', + WINDOWS_SERVER_2012_RTM_ITALIAN_64BIT_BASE = 'Windows_Server-2012-RTM-Italian-64Bit-Base', + WINDOWS_SERVER_2016_ENGLISH_CORE_SQL_2016_SP1_EXPRESS = 'Windows_Server-2016-English-Core-SQL_2016_SP1_Express', + WINDOWS_SERVER_2016_ENGLISH_DEEP_LEARNING = 'Windows_Server-2016-English-Deep-Learning', + WINDOWS_SERVER_2019_ITALIAN_FULL_BASE = 'Windows_Server-2019-Italian-Full-Base', + WINDOWS_SERVER_2008_R2_SP1_KOREAN_64BIT_BASE = 'Windows_Server-2008-R2_SP1-Korean-64Bit-Base', + WINDOWS_SERVER_2012_R2_RTM_ENGLISH_64BIT_SQL_2016_SP1_EXPRESS = 'Windows_Server-2012-R2_RTM-English-64Bit-SQL_2016_SP1_Express', + WINDOWS_SERVER_2012_R2_RTM_JAPANESE_64BIT_SQL_2016_SP2_WEB = 'Windows_Server-2012-R2_RTM-Japanese-64Bit-SQL_2016_SP2_Web', + WINDOWS_SERVER_2016_JAPANESE_FULL_FQL_2016_SP2_WEB = 'Windows_Server-2016-Japanese-Full-SQL_2016_SP2_Web', + WINDOWS_SERVER_2016_KOREAN_FULL_BASE = 'Windows_Server-2016-Korean-Full-Base', + WINDOWS_SERVER_2016_KOREAN_FULL_SQL_2016_SP2_STANDARD = 'Windows_Server-2016-Korean-Full-SQL_2016_SP2_Standard', + WINDOWS_SERVER_2016_PORTUGESE_PORTUGAL_FULL_BASE = 'Windows_Server-2016-Portuguese_Portugal-Full-Base', + WINDOWS_SERVER_2019_ENGLISH_FULL_SQL_2017_WEB = 'Windows_Server-2019-English-Full-SQL_2017_Web', + WINDOWS_SERVER_2019_FRENCH_FULL_BASE = 'Windows_Server-2019-French-Full-Base', + WINDOWS_SERVER_2019_KOREAN_FULL_BASE = 'Windows_Server-2019-Korean-Full-Base', + WINDOWS_SERVER_2008_R2_SP1_CHINESE_HONG_KONG_SAR_64BIT_BASE = 'Windows_Server-2008-R2_SP1-Chinese_Hong_Kong_SAR-64Bit-Base', + WINDOWS_SERVER_2008_R2_SP1_CHINESE_PRC_64BIT_BASE = 'Windows_Server-2008-R2_SP1-Chinese_PRC-64Bit-Base', + WINDOWS_SERVER_2012_RTM_FRENCH_64BIT_BASE = 'Windows_Server-2012-RTM-French-64Bit-Base', + WINDOWS_SERVER_2016_ENGLISH_FULL_CONTAINERS = 'Windows_Server-2016-English-Full-Containers', + WINDOWS_SERVER_2016_ENGLISH_FULL_SQL_2016_SP1_STANDARD = 'Windows_Server-2016-English-Full-SQL_2016_SP1_Standard', + WINDOWS_SERVER_2016_RUSSIAN_FULL_BASE = 'Windows_Server-2016-Russian-Full-Base', + WINDOWS_SERVER_2019_CHINESE_SIMPLIFIED_FULL_BASE = 'Windows_Server-2019-Chinese_Simplified-Full-Base', + WINDOWS_SERVER_2019_ENGLISH_FULL_SQL_2016_SP2_STANDARD = 'Windows_Server-2019-English-Full-SQL_2016_SP2_Standard', + WINDOWS_SERVER_2019_HUNGARIAN_FULL_BASE = 'Windows_Server-2019-Hungarian-Full-Base', + WINDOWS_SERVER_2008_R2_SP1_ENGLISH_64BIT_SQL_2008_R2_SP3_EXPRESS = 'Windows_Server-2008-R2_SP1-English-64Bit-SQL_2008_R2_SP3_Express', + WINDOWS_SERVER_2007_R2_SP1_LANGUAGE_PACKS_64BIT_BASE = 'Windows_Server-2008-R2_SP1-Language_Packs-64Bit-Base', + WINDOWS_SERVER_2008_SP2_ENGLISH_32BIT_BASE = 'Windows_Server-2008-SP2-English-32Bit-Base', + WINDOWS_SERVER_2012_R2_RTM_ENGLISH_64BIT_SQL_2012_SP4_ENTERPRISE = 'Windows_Server-2012-R2_RTM-English-64Bit-SQL_2012_SP4_Enterprise', + WINDOWS_SERVER_2012_RTM_CHINESE_TRADITIONAL_64BIT_BASE = 'Windows_Server-2012-RTM-Chinese_Traditional-64Bit-Base', + WINDOWS_SERVER_2012_RTM_ENGLISH_64BIT_SQL_2008_R2_SP3_EXPRESS = 'Windows_Server-2012-RTM-English-64Bit-SQL_2008_R2_SP3_Express', + WINDOWS_SERVER_2012_RTM_ENGLISH_64BIT_SQL_2014_SP2_STANDARD = 'Windows_Server-2012-RTM-English-64Bit-SQL_2014_SP2_Standard', + WINDOWS_SERVER_2012_RTM_JAPANESE_64BIT_SQL_2014_SP2_EXPRESS = 'Windows_Server-2012-RTM-Japanese-64Bit-SQL_2014_SP2_Express', + WINDOWS_SERVER_2016_POLISH_FULL_BASE = 'Windows_Server-2016-Polish-Full-Base', + WINDOWS_SERVER_2019_ENGLISH_FULL_SQL_2016_SP2_WEB = 'Windows_Server-2019-English-Full-SQL_2016_SP2_Web', + WINDOWS_SERVER_2012_R2_RTM_ENGLISH_64BIT_SQL_2014_SP3_STANDARD = 'Windows_Server-2012-R2_RTM-English-64Bit-SQL_2014_SP3_Standard', + WINDOWS_SERVER_2012_R2_RTM_ENGLISH_64BIT_SQL_2016_SP2_EXPRESS = 'Windows_Server-2012-R2_RTM-English-64Bit-SQL_2016_SP2_Express', + WINDOWS_SERVER_2012_R2_RTM_ENGLISH_DEEP_LEARNING = 'Windows_Server-2012-R2_RTM-English-Deep-Learning', + WINDOWS_SERVER_2012_R2_RTM_GERMAN_64BIT_BASE = 'Windows_Server-2012-R2_RTM-German-64Bit-Base', + WINDOWS_SERVER_2012_R2_RTM_JAPANESE_64BIT_SQL_2016_SP1_EXPRESS = 'Windows_Server-2012-R2_RTM-Japanese-64Bit-SQL_2016_SP1_Express', + WINDOWS_SERVER_2012_R2_RTM_RUSSIAN_64BIT_BASE = 'Windows_Server-2012-R2_RTM-Russian-64Bit-Base', + WINDOWS_SERVER_2012_RTM_CHINESE_TRADITIONAL_HONG_KONG_SAR_64BIT_BASE = 'Windows_Server-2012-RTM-Chinese_Traditional_Hong_Kong_SAR-64Bit-Base', + WINDOWS_SERVER_2012_RTM_HUNGARIAN_64BIT_BASE = 'Windows_Server-2012-RTM-Hungarian-64Bit-Base', + WINDOWS_SERVER_2012_RTM_JAPANESE_64BIT_SQL_2014_SP3_STANDARD = 'Windows_Server-2012-RTM-Japanese-64Bit-SQL_2014_SP3_Standard', + WINDOWS_SERVER_2019_ENGLISH_FULL_HYPERV = 'Windows_Server-2019-English-Full-HyperV', + WINDOWS_SERVER_2003_R2_SP2_ENGLISH_64BIT_SQL_2005_SP4_EXPRESS = 'Windows_Server-2003-R2_SP2-English-64Bit-SQL_2005_SP4_Express', + WINDOWS_SERVER_2008_R2_SP1_JAPANESE_64BIT_SQL_2012_SP4_EXPRESS = 'Windows_Server-2008-R2_SP1-Japanese-64Bit-SQL_2012_SP4_Express', + WINDOWS_SERVER_2012_RTM_GERMAN_64BIT_BASE = 'Windows_Server-2012-RTM-German-64Bit-Base', + WINDOWS_SERVER_2012_RTM_JAPANESE_64BIT_SQL_2008_R2_SP3_STANDARD = 'Windows_Server-2012-RTM-Japanese-64Bit-SQL_2008_R2_SP3_Standard', + WINDOWS_SERVER_2016_ENGLISH_FULL_SQL_2016_SP2_STANDARD = 'Windows_Server-2016-English-Full-SQL_2016_SP2_Standard', + WINDOWS_SERVER_2019_ENGLISH_FULL_SQL_2017_EXPRESS = 'Windows_Server-2019-English-Full-SQL_2017_Express', + WINDOWS_SERVER_2019_JAPANESE_FULL_BASE = 'Windows_Server-2019-Japanese-Full-Base', + WINDOWS_SERVER_2019_RUSSIAN_FULL_BASE = 'Windows_Server-2019-Russian-Full-Base', + WINDOWS_SERVER_2012_R2_RTM_ENGLISH_64BIT_SQL_2014_SP2_STANDARD = 'Windows_Server-2012-R2_RTM-English-64Bit-SQL_2014_SP2_Standard', + WINDOWS_SERVER_2012_R2_RTM_ITALIAN_64BIT_BASE = 'Windows_Server-2012-R2_RTM-Italian-64Bit-Base', + WINDOWS_SERVER_2012_RTM_ENGLISH_64BIT_BASE = 'Windows_Server-2012-RTM-English-64Bit-Base', + WINDOWS_SERVER_2012_RTM_ENGLISH_64BIT_SQL_2008_R2_SP3_STANDARD = 'Windows_Server-2012-RTM-English-64Bit-SQL_2008_R2_SP3_Standard', + WINDOWS_SERVER_2016_ENGLISH_FULL_HYPERV = 'Windows_Server-2016-English-Full-HyperV', + WINDOWS_SERVER_2016_ENGLISH_FULL_SQL_2016_SP2_ENTERPRISE = 'Windows_Server-2016-English-Full-SQL_2016_SP2_Enterprise', + WINDOWS_SERVER_2019_CHINESE_TRADITIONAL_FULL_BASE = 'Windows_Server-2019-Chinese_Traditional-Full-Base', + WINDOWS_SERVER_2019_ENGLISH_CORE_BASE = 'Windows_Server-2019-English-Core-Base', + WINDOWS_SERVER_2019_ENGLISH_CORE_CONTAINERSLATEST = 'Windows_Server-2019-English-Core-ContainersLatest', + WINDOWS_SERVER_2008_SP2_ENGLISH_64BIT_BASE = 'Windows_Server-2008-SP2-English-64Bit-Base', + WINDOWS_SERVER_2012_R2_RTM_FRENCH_64BIT_BASE = 'Windows_Server-2012-R2_RTM-French-64Bit-Base', + WINDOWS_SERVER_2012_R2_RTM_POLISH_64BIT_BASE = 'Windows_Server-2012-R2_RTM-Polish-64Bit-Base', + WINDOWS_SERVER_2012_RTM_ENGLISH_64BIT_SQL_2012_SP4_EXPRESS = 'Windows_Server-2012-RTM-English-64Bit-SQL_2012_SP4_Express', + WINDOWS_SERVER_2012_RTM_ENGLISH_64BIT_SQL_2014_SP3_STANDARD = 'Windows_Server-2012-RTM-English-64Bit-SQL_2014_SP3_Standard', + WINDOWS_SERVER_2012_RTM_JAPANESE_64BIT_2012_SP4_STANDARD = 'Windows_Server-2012-RTM-Japanese-64Bit-SQL_2012_SP4_Standard', + WINDOWS_SERVER_2016_ENGLISH_CORE_CONTAINERSLATEST = 'Windows_Server-2016-English-Core-ContainersLatest', + WINDOWS_SERVER_2019_ENGLISH_FULL_SQL_2016_SP2_EXPRESS = 'Windows_Server-2019-English-Full-SQL_2016_SP2_Express', + WINDOWS_SERVER_2019_TURKISH_FULL_BASE = 'Windows_Server-2019-Turkish-Full-Base', + WINDOWS_SERVER_2012_R2_RTM_ENGLISH_64BIT_SQL_2014_SP2_EXPRESS = 'Windows_Server-2012-R2_RTM-English-64Bit-SQL_2014_SP2_Express', + WINDOWS_SERVER_2012_R2_RTM_ENGLISH_64BIT_SQL_2014_SP3_WEB = 'Windows_Server-2012-R2_RTM-English-64Bit-SQL_2014_SP3_Web', + WINDOWS_SERVER_2012_R2_RTM_JAPANESE_64BIT_SQL_2016_SP1_WEB = 'Windows_Server-2012-R2_RTM-Japanese-64Bit-SQL_2016_SP1_Web', + WINDOWS_SERVER_2012_R2_RTM_PORTUGESE_BRAZIL_64BIT_BASE = 'Windows_Server-2012-R2_RTM-Portuguese_Brazil-64Bit-Base', + WINDOWS_SERVER_2012_R2_RTM_PORTUGESE_PORTUGAL_64BIT_BASE = 'Windows_Server-2012-R2_RTM-Portuguese_Portugal-64Bit-Base', + WINDOWS_SERVER_2012_R2_RTM_SWEDISH_64BIT_BASE = 'Windows_Server-2012-R2_RTM-Swedish-64Bit-Base', + WINDOWS_SERVER_2016_ENGLISH_FULL_SQL_2016_SP1_EXPRESS = 'Windows_Server-2016-English-Full-SQL_2016_SP1_Express', + WINDOWS_SERVER_2016_ITALIAN_FULL_BASE = 'Windows_Server-2016-Italian-Full-Base', + WINDOWS_SERVER_2016_SPANISH_FULL_BASE = 'Windows_Server-2016-Spanish-Full-Base', + WINDOWS_SERVER_2019_ENGLISH_FULL_SQL_2017_STANDARD = 'Windows_Server-2019-English-Full-SQL_2017_Standard', + WINDOWS_SERVER_2003_R2_SP2_LANGUAGE_PACKS_64BIT_SQL_2005_SP4_STANDARD = 'Windows_Server-2003-R2_SP2-Language_Packs-64Bit-SQL_2005_SP4_Standard', + WINDOWS_SERVER_2008_R2_SP1_JAPANESE_64BIT_SQL_2008_R2_SP3_STANDARD = 'Windows_Server-2008-R2_SP1-Japanese-64Bit-SQL_2008_R2_SP3_Standard', + WINDOWS_SERVER_2012_R2_RTM_JAPANESE_64BIT_SQL_2016_SP1_STANDARD = 'Windows_Server-2012-R2_RTM-Japanese-64Bit-SQL_2016_SP1_Standard', + WINDOWS_SERVER_2012_RTM_ENGLISH_64BIT_SQL_2007_R2_SP3_WEB = 'Windows_Server-2012-RTM-English-64Bit-SQL_2008_R2_SP3_Web', + WINDOWS_SERVER_2012_RTM_JAPANESE_64BIT_SQL_2014_SP2_WEB = 'Windows_Server-2012-RTM-Japanese-64Bit-SQL_2014_SP2_Web', + WINDOWS_SERVER_2016_ENGLISH_CORE_SQL_2016_SP2_ENTERPRISE = 'Windows_Server-2016-English-Core-SQL_2016_SP2_Enterprise', + WINDOWS_SERVER_2016_PORTUGESE_BRAZIL_FULL_BASE = 'Windows_Server-2016-Portuguese_Brazil-Full-Base', + WINDOWS_SERVER_2019_ENGLISH_FULL_BASE = 'Windows_Server-2019-English-Full-Base', + WINDOWS_SERVER_2003_R2_SP2_ENGLISH_32BIT_BASE = 'Windows_Server-2003-R2_SP2-English-32Bit-Base', + WINDOWS_SERVER_2012_R2_RTM_CZECH_64BIT_BASE = 'Windows_Server-2012-R2_RTM-Czech-64Bit-Base', + WINDOWS_SERVER_2012_R2_RTM_ENGLISH_64BIT_SQL_2016_SP1_STANDARD = 'Windows_Server-2012-R2_RTM-English-64Bit-SQL_2016_SP1_Standard', + WINDOWS_SERVER_2012_R2_RTM_JAPANESE_64BIT_SQL_2014_SP2_EXPRESS = 'Windows_Server-2012-R2_RTM-Japanese-64Bit-SQL_2014_SP2_Express', + WINDOWS_SERVER_2012_RTM_ENGLISH_64BIT_SQL_2012_SP4_STANDARD = 'Windows_Server-2012-RTM-English-64Bit-SQL_2012_SP4_Standard', + WINDOWS_SERVER_2016_ENGLISH_CORE_SQL_2016_SP1_ENTERPRISE = 'Windows_Server-2016-English-Core-SQL_2016_SP1_Enterprise', + WINDOWS_SERVER_2016_JAPANESE_FULL_SQL_2016_SP1_WEB = 'Windows_Server-2016-Japanese-Full-SQL_2016_SP1_Web', + WINDOWS_SERVER_2016_SWEDISH_FULL_BASE = 'Windows_Server-2016-Swedish-Full-Base', + WINDOWS_SERVER_2016_TURKISH_FULL_BASE = 'Windows_Server-2016-Turkish-Full-Base', + WINDOWS_SERVER_2008_R2_SP1_ENGLISH_64BIT_CORE_SQL_2012_SP4_STANDARD = 'Windows_Server-2008-R2_SP1-English-64Bit-Core_SQL_2012_SP4_Standard', +// tslint:disable-next-line: max-line-length + WINDOWS_SERVER_2008_R2_SP1_LANGUAGE_PACKS_64BIT_SQL_2008_R2_SP3_STANDARD = 'Windows_Server-2008-R2_SP1-Language_Packs-64Bit-SQL_2008_R2_SP3_Standard', + WINDOWS_SERVER_2012_RTM_CZECH_64BIT_BASE = 'Windows_Server-2012-RTM-Czech-64Bit-Base', + WINDOWS_SERVER_2012_RTM_TURKISH_64BIT_BASE = 'Windows_Server-2012-RTM-Turkish-64Bit-Base', + WINDOWS_SERVER_2016_DUTCH_FULL_BASE = 'Windows_Server-2016-Dutch-Full-Base', + WINDOWS_SERVER_2016_ENGLISH_FULL_SQL_2016_SP2_EXPRESS = 'Windows_Server-2016-English-Full-SQL_2016_SP2_Express', + WINDOWS_SERVER_2016_ENGLISH_FULL_SQL_2017_ENTERPRISE = 'Windows_Server-2016-English-Full-SQL_2017_Enterprise', + WINDOWS_SERVER_2016_HUNGARIAN_FULL_BASE = 'Windows_Server-2016-Hungarian-Full-Base', + WINDOWS_SERVER_2016_KOREAN_FULL_SQL_2016_SP1_STANDARD = 'Windows_Server-2016-Korean-Full-SQL_2016_SP1_Standard', + WINDOWS_SERVER_2019_SPANISH_FULL_BASE = 'Windows_Server-2019-Spanish-Full-Base', + WINDOWS_SERVER_2003_R2_SP2_ENGLISH_64BIT_BASE = 'Windows_Server-2003-R2_SP2-English-64Bit-Base', + WINDOWS_SERVER_2008_R2_SP1_ENGLISH_64BIT_BASE = 'Windows_Server-2008-R2_SP1-English-64Bit-Base', + WINDOWS_SERVER_2008_R2_SP1_LANGUAGE_PACKS_64BIT_SQL_2008_R2_SP3_EXPRESS = 'Windows_Server-2008-R2_SP1-Language_Packs-64Bit-SQL_2008_R2_SP3_Express', + WINDOWS_SERVER_2012_SP2_PORTUGESE_BRAZIL_64BIT_BASE = 'Windows_Server-2008-SP2-Portuguese_Brazil-64Bit-Base', + WINDOWS_SERVER_2012_R2_RTM_ENGLISH_64BIT_SQL_2016_SP1_WEB = 'Windows_Server-2012-R2_RTM-English-64Bit-SQL_2016_SP1_Web', + WINDOWS_SERVER_2012_R2_RTM_JAPANESE_64BIT_SQL_2014_SP3_EXPRESS = 'Windows_Server-2012-R2_RTM-Japanese-64Bit-SQL_2014_SP3_Express', + WINDOWS_SERVER_2012_R2_RTM_JAPANESE_64BIT_SQL_2016_SP2_ENTERPRISE = 'Windows_Server-2012-R2_RTM-Japanese-64Bit-SQL_2016_SP2_Enterprise', + WINDOWS_SERVER_2012_RTM_JAPANESE_64BIT_BASE = 'Windows_Server-2012-RTM-Japanese-64Bit-Base', + WINDOWS_SERVER_2019_ENGLISH_FULL_CONTAINERSLATEST = 'Windows_Server-2019-English-Full-ContainersLatest', + WINDOWS_SERVER_2019_ENGLISH_FULL_SQL_2017_ENTERPRISE = 'Windows_Server-2019-English-Full-SQL_2017_Enterprise', + WINDOWS_SERVER_1709_ENGLISH_CORE_CONTAINERSLATEST = 'Windows_Server-1709-English-Core-ContainersLatest', + WINDOWS_SERVER_1803_ENGLISH_CORE_BASE = 'Windows_Server-1803-English-Core-Base', + WINDOWS_SERVER_2008_R2_SP1_ENGLISH_64BIT_SQL_2012_SP4_WEB = 'Windows_Server-2008-R2_SP1-English-64Bit-SQL_2012_SP4_Web', + WINDOWS_SERVER_2008_R2_SP1_JAPANESE_64BIT_BASE = 'Windows_Server-2008-R2_SP1-Japanese-64Bit-Base', + WINDOWS_SERVER_2008_SP2_ENGLISH_64BIT_SQL_2008_SP4_STANDARD = 'Windows_Server-2008-SP2-English-64Bit-SQL_2008_SP4_Standard', + WINDOWS_SERVER_2012_R2_RTM_ENGLISH_64BIT_BASE = 'Windows_Server-2012-R2_RTM-English-64Bit-Base', + WINDOWS_SERVER_2012_RTM_PORTUGESE_BRAZIL_64BIT_BASE = 'Windows_Server-2012-RTM-Portuguese_Brazil-64Bit-Base', + WINDOWS_SERVER_2016_ENGLISH_FULL_SQL_2016_SP1_WEB = 'Windows_Server-2016-English-Full-SQL_2016_SP1_Web', + WINDOWS_SERVER_2016_ENGLISH_P3 = 'Windows_Server-2016-English-P3', + WINDOWS_SERVER_2016_JAPANESE_FULL_SQL_2016_SP1_ENTERPRISE = 'Windows_Server-2016-Japanese-Full-SQL_2016_SP1_Enterprise', + WINDOWS_SERVER_2003_R2_SP2_LANGUAGE_PACKS_64BIT_BASE = 'Windows_Server-2003-R2_SP2-Language_Packs-64Bit-Base', + WINDOWS_SERVER_2012_R2_RTM_CHINESE_TRADITIONAL_HONG_KONG_64BIT_BASE = 'Windows_Server-2012-R2_RTM-Chinese_Traditional_Hong_Kong-64Bit-Base', + WINDOWS_SERVER_2012_R2_RTM_ENGLISH_64BIT_SQL_2014_SP3_EXPRESS = 'Windows_Server-2012-R2_RTM-English-64Bit-SQL_2014_SP3_Express', + WINDOWS_SERVER_2012_R2_RTM_ENGLISH_64BIT_SQL_2016_SP2_ENTERPRISE = 'Windows_Server-2012-R2_RTM-English-64Bit-SQL_2016_SP2_Enterprise', + WINDOWS_SERVER_2012_RTM_CHINESE_SIMPLIFIED_64BIT_BASE = 'Windows_Server-2012-RTM-Chinese_Simplified-64Bit-Base', + WINDOWS_SERVER_2012_RTM_ENGLISH_64BIT_SQL_2012_SP4_WEB = 'Windows_Server-2012-RTM-English-64Bit-SQL_2012_SP4_Web', + WINDOWS_SERVER_2012_RTM_JAPANESE_64BIT_SQL_2014_SP3_WEB = 'Windows_Server-2012-RTM-Japanese-64Bit-SQL_2014_SP3_Web', + WINDOWS_SERVER_2016_JAPANESE_FULL_BASE = 'Windows_Server-2016-Japanese-Full-Base', + WINDOWS_SERVER_2016_JAPANESE_FULL_SQL_2016_SP1_EXPRESS = 'Windows_Server-2016-Japanese-Full-SQL_2016_SP1_Express', + WINDOWS_SERVER_1803_ENGLISH_CORE_CONTAINERSLATEST = 'Windows_Server-1803-English-Core-ContainersLatest', + WINDOWS_SERVER_2008_R2_SP1_JAPANESE_64BIT_SQL_2012_SP4_STANDARD = 'Windows_Server-2008-R2_SP1-Japanese-64Bit-SQL_2012_SP4_Standard', + WINDOWS_SERVER_2012_R2_RTM_ENGLISH_64BIT_CORE = 'Windows_Server-2012-R2_RTM-English-64Bit-Core', + WINDOWS_SERVER_2012_R2_RTM_ENGLISH_64BIT_SQL_2014_SP2_WEB = 'Windows_Server-2012-R2_RTM-English-64Bit-SQL_2014_SP2_Web', + WINDOWS_SERVER_2012_R2_RTM_ENGLISH_64BIT_SQL_2014_SP3_ENTERPRISE = 'Windows_Server-2012-R2_RTM-English-64Bit-SQL_2014_SP3_Enterprise', + WINDOWS_SERVER_2012_R2_RTM_JAPANESE_64BIT_SQL_2016_SP2_STANDARD = 'Windows_Server-2012-R2_RTM-Japanese-64Bit-SQL_2016_SP2_Standard', + WINDOWS_SERVER_2012_RTM_ENGLISH_64BIT_2014_SP3_WEB = 'Windows_Server-2012-RTM-English-64Bit-SQL_2014_SP3_Web', + WINDOWS_SERVER_2012_RTM_SWEDISH_64BIT_BASE = 'Windows_Server-2012-RTM-Swedish-64Bit-Base', + WINDOWS_SERVER_2016_CHINESE_SIMPLIFIED_FULL_BASE = 'Windows_Server-2016-Chinese_Simplified-Full-Base', + WINDOWS_SERVER_2019_POLISH_FULL_BASE = 'Windows_Server-2019-Polish-Full-Base', + WINDOWS_SERVER_2008_R2_SP1_JAPANESE_64BIT_SQL_2008_R2_SP3_WEB = 'Windows_Server-2008-R2_SP1-Japanese-64Bit-SQL_2008_R2_SP3_Web', + WINDOWS_SERVER_2008_R2_SP1_PORTUGESE_BRAZIL_64BIT_BASE = 'Windows_Server-2008-R2_SP1-Portuguese_Brazil-64Bit-Base', + WINDOWS_SERVER_2012_R2_RTM_JAPANESE_64BIT_SQL_2016_SP1_ENTERPRISE = 'Windows_Server-2012-R2_RTM-Japanese-64Bit-SQL_2016_SP1_Enterprise', + WINDOWS_SERVER_2012_RTM_JAPANESE_64BIT_SQL_2016_SP2_EXPRESS = 'Windows_Server-2012-R2_RTM-Japanese-64Bit-SQL_2016_SP2_Express', + WINDOWS_SERVER_2012_RTM_ENGLISH_64BIT_SQL_2014_SP3_EXPRESS = 'Windows_Server-2012-RTM-English-64Bit-SQL_2014_SP3_Express', + WINDOWS_SERVER_2012_RTM_JAPANESE_64BIT_SQL_2014_SP2_STANDARD = 'Windows_Server-2012-RTM-Japanese-64Bit-SQL_2014_SP2_Standard', + WINDOWS_SERVER_2016_ENGLISH_CORE_BASE = 'Windows_Server-2016-English-Core-Base', + WINDOWS_SERVER_2016_ENGLISH_FULL_BASE = 'Windows_Server-2016-English-Full-Base', + WINDOWS_SERVER_2016_ENGLISH_FULL_SQL_2017_WEB = 'Windows_Server-2016-English-Full-SQL_2017_Web', + WINDOWS_SERVER_2019_GERMAN_FULL_BASE = 'Windows_Server-2019-German-Full-Base', + WINDOWS_SERVER_2003_R2_SP2_ENGLISH_64BIT_SQL_2005_SP4_STANDARD = 'Windows_Server-2003-R2_SP2-English-64Bit-SQL_2005_SP4_Standard', + WINDOWS_SERVER_2008_R2_SP1_ENGLISH_64BIT_SQL_2012_SP4_ENTERPRISE = 'Windows_Server-2008-R2_SP1-English-64Bit-SQL_2012_SP4_Enterprise', + WINDOWS_SERVER_2008_R2_SP1_JAPANESE_64BIT_SQL_2008_R2_SP3_EXPRESS = 'Windows_Server-2008-R2_SP1-Japanese-64Bit-SQL_2008_R2_SP3_Express', + WINDOWS_SERVER_2012_R2_RTM_ENGLISH_64BIT_SQL_2016_SP1_ENTERPRISE = 'Windows_Server-2012-R2_RTM-English-64Bit-SQL_2016_SP1_Enterprise', + WINDOWS_SERVER_2012_RTM_ENGLISH_64BIT_SQL_2014_SP2_WEB = 'Windows_Server-2012-RTM-English-64Bit-SQL_2014_SP2_Web', + WINDOWS_SERVER_2012_RTM_JAPANESE_64BIT_SQL_2008_R2_SP3_EXPRESS = 'Windows_Server-2012-RTM-Japanese-64Bit-SQL_2008_R2_SP3_Express', + WINDOWS_SERVER_2016_FRENCH_FULL_BASE = 'Windows_Server-2016-French-Full-Base', + WINDOWS_SERVER_2016_JAPANESE_FULL_SQL_2016_SP2_ENTERPRISE = 'Windows_Server-2016-Japanese-Full-SQL_2016_SP2_Enterprise', + WINDOWS_SERVER_2019_CZECH_FULL_BASE = 'Windows_Server-2019-Czech-Full-Base', + WINDOWS_SERVER_1809_ENGLISH_CORE_BASE = 'Windows_Server-1809-English-Core-Base', + WINDOWS_SERVER_1809_ENGLISH_CORE_CONTAINERSLATEST = 'Windows_Server-1809-English-Core-ContainersLatest', + WINDOWS_SERVER_2003_R2_SP2_LANGUAGE_PACKS_64BIT_SQL_2005_SP4_EXPRESS = 'Windows_Server-2003-R2_SP2-Language_Packs-64Bit-SQL_2005_SP4_Express', + WINDOWS_SERVER_2012_R2_RTM_TURKISH_64BIT_BASE = 'Windows_Server-2012-R2_RTM-Turkish-64Bit-Base', + WINDOWS_SERVER_2012_RTM_JAPANESE_64BIT_SQL_2012_SP4_WEB = 'Windows_Server-2012-RTM-Japanese-64Bit-SQL_2012_SP4_Web', + WINDOWS_SERVER_2012_RTM_POLISH_64BIT_BASE = 'Windows_Server-2012-RTM-Polish-64Bit-Base', + WINDOWS_SERVER_2012_RTM_SPANISH_64BIT_BASE = 'Windows_Server-2012-RTM-Spanish-64Bit-Base', + WINDOWS_SERVER_2016_ENGLISH_FULL_SQL_2016_SP1_ENTERPRISE = 'Windows_Server-2016-English-Full-SQL_2016_SP1_Enterprise', + WINDOWS_SERVER_2016_JAPANESE_FULL_SQL_2016_SP2_EXPRESS = 'Windows_Server-2016-Japanese-Full-SQL_2016_SP2_Express', + WINDOWS_SERVER_2019_ENGLISH_FULL_SQL_2016_SP2_ENTERPRISE = 'Windows_Server-2019-English-Full-SQL_2016_SP2_Enterprise', + WINDOWS_SERVER_1709_ENGLISH_CORE_BASE = 'Windows_Server-1709-English-Core-Base', + WINDOWS_SERVER_2008_R2_SP1_ENGLISH_61BIT_SQL_2012_RTM_SP2_ENTERPRISE = 'Windows_Server-2008-R2_SP1-English-64Bit-SQL_2012_RTM_SP2_Enterprise', + WINDOWS_SERVER_2008_R2_SP1_ENGLISH_64BIT_SQL_2012_SP4_STANDARD = 'Windows_Server-2008-R2_SP1-English-64Bit-SQL_2012_SP4_Standard', + WINDOWS_SERVER_2008_SP2_PORTUGESE_BRAZIL_32BIT_BASE = 'Windows_Server-2008-SP2-Portuguese_Brazil-32Bit-Base', + WINDOWS_SERVER_2012_R2_RTM_JAPANESE_64BIT_SQL_2014_SP2_STANDARD = 'Windows_Server-2012-R2_RTM-Japanese-64Bit-SQL_2014_SP2_Standard', + WINDOWS_SERVER_2012_RTM_JAPANESE_64BIT_SQL_2012_SP4_EXPRESS = 'Windows_Server-2012-RTM-Japanese-64Bit-SQL_2012_SP4_Express', + WINDOWS_SERVER_2012_RTM_PORTUGESE_PORTUGAL_64BIT_BASE = 'Windows_Server-2012-RTM-Portuguese_Portugal-64Bit-Base', + WINDOWS_SERVER_2016_CZECH_FULL_BASE = 'Windows_Server-2016-Czech-Full-Base', + WINDOWS_SERVER_2016_JAPANESE_FULL_SQL_2016_SP1_STANDARD = 'Windows_Server-2016-Japanese-Full-SQL_2016_SP1_Standard', + WINDOWS_SERVER_2019_DUTCH_FULL_BASE = 'Windows_Server-2019-Dutch-Full-Base', + WINDOWS_SERVER_2008_R2_SP1_ENGLISH_64BIT_CORE = 'Windows_Server-2008-R2_SP1-English-64Bit-Core', + WINDOWS_SERVER_2012_R2_RTM_ENGLISH_64BIT_SQL_2016_SP2_WEB = 'Windows_Server-2012-R2_RTM-English-64Bit-SQL_2016_SP2_Web', + WINDOWS_SERVER_2012_R2_RTM_KOREAN_64BIT_BASE = 'Windows_Server-2012-R2_RTM-Korean-64Bit-Base', + WINDOWS_SERVER_2012_RTM_DUTCH_64BIT_BASE = 'Windows_Server-2012-RTM-Dutch-64Bit-Base', + WINDOWS_SERVER_2016_ENGLISH_64BIT_SQL_2012_SP4_ENTERPRISE = 'Windows_Server-2016-English-64Bit-SQL_2012_SP4_Enterprise', + WINDOWS_SERVER_2016_ENGLISH_CORE_SQL_2016_SP1_STANDARD = 'Windows_Server-2016-English-Core-SQL_2016_SP1_Standard', + WINDOWS_SERVER_2016_ENGLISH_CORE_SQL_2016_SP2_EXPRESS = 'Windows_Server-2016-English-Core-SQL_2016_SP2_Express', + WINDOWS_SERVER_2016_ENGLISH_CORE_SQL_2016_SP2_WEB = 'Windows_Server-2016-English-Core-SQL_2016_SP2_Web', + WINDOWS_SERVER_2016_ENGLISH_FULL_SQL_2017_STANDARD = 'Windows_Server-2016-English-Full-SQL_2017_Standard', + WINDOWS_SERVER_2019_PORTUGESE_BRAZIL_FULL_BASE = 'Windows_Server-2019-Portuguese_Brazil-Full-Base', + WINDOWS_SERVER_2008_R2_SP1_ENGLISH_64BIT_SQL_2008_R2_SP3_STANDARD = 'Windows_Server-2008-R2_SP1-English-64Bit-SQL_2008_R2_SP3_Standard', + WINDOWS_SERVER_2008_R2_SP1_ENGLISH_64BIT_SHAREPOINT_2010_SP2_FOUNDATION = 'Windows_Server-2008-R2_SP1-English-64Bit-SharePoint_2010_SP2_Foundation', + WINDOWS_SERVER_2012_R2_RTM_ENGLISH_P3 = 'Windows_Server-2012-R2_RTM-English-P3', + WINDOWS_SERVER_2012_R2_RTM_JAPANESE_64BIT_SQL_2014_SP3_STANDARD = 'Windows_Server-2012-R2_RTM-Japanese-64Bit-SQL_2014_SP3_Standard', + WINDOWS_SERVER_2012_R2_RTM_SPANISH_64BIT_BASE = 'Windows_Server-2012-R2_RTM-Spanish-64Bit-Base', + WINDOWS_SERVER_2012_RTM_JAPANESE_64BIT_SQL_2014_SP3_EXPRESS = 'Windows_Server-2012-RTM-Japanese-64Bit-SQL_2014_SP3_Express', + WINDOWS_SERVER_2016_ENGLISH_CORE_SQL_2016_SP2_STANDARD = 'Windows_Server-2016-English-Core-SQL_2016_SP2_Standard', + WINDOWS_SERVER_2016_JAPANESE_FULL_SQL_2016_SP2_STANDARD = 'Windows_Server-2016-Japanese-Full-SQL_2016_SP2_Standard', + WINDOWS_SERVER_2019_PORTUGESE_PORTUGAL_FULL_BASE = 'Windows_Server-2019-Portuguese_Portugal-Full-Base', + WINDOWS_SERVER_2019_SWEDISH_FULL_BASE = 'Windows_Server-2019-Swedish-Full-Base', + WINDOWS_SERVER_2012_R2_RTM_ENGLISH_64BIT_HYPERV = 'Windows_Server-2012-R2_RTM-English-64Bit-HyperV', + WINDOWS_SERVER_2012_RTM_KOREAN_64BIT_BASE = 'Windows_Server-2012-RTM-Korean-64Bit-Base', + WINDOWS_SERVER_2012_RTM_RUSSIAN_64BIT_BASE = 'Windows_Server-2012-RTM-Russian-64Bit-Base', + WINDOWS_SERVER_2016_CHINESE_TRADITIONAL_FULL_BASE = 'Windows_Server-2016-Chinese_Traditional-Full-Base', + WINDOWS_SERVER_2016_ENGLISH_FULL_SQL_2016_SP2_WEB = 'Windows_Server-2016-English-Full-SQL_2016_SP2_Web', + WINDOWS_SERVER_2016_ENGLISH_FULL_SQL_2017_EXPRESS = 'Windows_Server-2016-English-Full-SQL_2017_Express', } /** @@ -442,8 +443,8 @@ export class MachineImage { * The OS type of a particular image */ export enum OperatingSystemType { - Linux, - Windows, + LINUX, + WINDOWS, } /** @@ -463,7 +464,7 @@ export class WindowsOS extends OperatingSystem { } get type(): OperatingSystemType { - return OperatingSystemType.Windows; + return OperatingSystemType.WINDOWS; } } @@ -476,6 +477,6 @@ export class LinuxOS extends OperatingSystem { } get type(): OperatingSystemType { - return OperatingSystemType.Linux; + return OperatingSystemType.LINUX; } } diff --git a/packages/@aws-cdk/aws-ec2/lib/security-group-rule.ts b/packages/@aws-cdk/aws-ec2/lib/security-group-rule.ts index e968eeb9555ff..3cea0347f1020 100644 --- a/packages/@aws-cdk/aws-ec2/lib/security-group-rule.ts +++ b/packages/@aws-cdk/aws-ec2/lib/security-group-rule.ts @@ -142,11 +142,11 @@ export interface IPortRange { * Protocol for use in Connection Rules */ export enum Protocol { - All = '-1', - Tcp = 'tcp', - Udp = 'udp', - Icmp = 'icmp', - Icmpv6 = '58', + ALL = '-1', + TCP = 'tcp', + UDP = 'udp', + ICMP = 'icmp', + ICMP_V6 = '58', } /** @@ -160,7 +160,7 @@ export class TcpPort implements IPortRange { public toRuleJSON(): any { return { - ipProtocol: Protocol.Tcp, + ipProtocol: Protocol.TCP, fromPort: this.port, toPort: this.port }; @@ -182,7 +182,7 @@ export class TcpPortRange implements IPortRange { public toRuleJSON(): any { return { - ipProtocol: Protocol.Tcp, + ipProtocol: Protocol.TCP, fromPort: this.startPort, toPort: this.endPort }; @@ -201,7 +201,7 @@ export class TcpAllPorts implements IPortRange { public toRuleJSON(): any { return { - ipProtocol: Protocol.Tcp, + ipProtocol: Protocol.TCP, fromPort: 0, toPort: 65535 }; @@ -223,7 +223,7 @@ export class UdpPort implements IPortRange { public toRuleJSON(): any { return { - ipProtocol: Protocol.Udp, + ipProtocol: Protocol.UDP, fromPort: this.port, toPort: this.port }; @@ -246,7 +246,7 @@ export class UdpPortRange implements IPortRange { public toRuleJSON(): any { return { - ipProtocol: Protocol.Udp, + ipProtocol: Protocol.UDP, fromPort: this.startPort, toPort: this.endPort }; @@ -265,7 +265,7 @@ export class UdpAllPorts implements IPortRange { public toRuleJSON(): any { return { - ipProtocol: Protocol.Udp, + ipProtocol: Protocol.UDP, fromPort: 0, toPort: 65535 }; @@ -287,7 +287,7 @@ export class IcmpTypeAndCode implements IPortRange { public toRuleJSON(): any { return { - ipProtocol: Protocol.Icmp, + ipProtocol: Protocol.ICMP, fromPort: this.type, toPort: this.code }; @@ -306,7 +306,7 @@ export class IcmpPing implements IPortRange { public toRuleJSON(): any { return { - ipProtocol: Protocol.Icmp, + ipProtocol: Protocol.ICMP, fromPort: 8, toPort: -1 }; @@ -328,7 +328,7 @@ export class IcmpAllTypeCodes implements IPortRange { public toRuleJSON(): any { return { - ipProtocol: Protocol.Icmp, + ipProtocol: Protocol.ICMP, fromPort: this.type, toPort: -1 }; @@ -347,7 +347,7 @@ export class IcmpAllTypesAndCodes implements IPortRange { public toRuleJSON(): any { return { - ipProtocol: Protocol.Icmp, + ipProtocol: Protocol.ICMP, fromPort: -1, toPort: -1 }; diff --git a/packages/@aws-cdk/aws-ec2/lib/util.ts b/packages/@aws-cdk/aws-ec2/lib/util.ts index ee28b8646f90e..b880a4a11f236 100644 --- a/packages/@aws-cdk/aws-ec2/lib/util.ts +++ b/packages/@aws-cdk/aws-ec2/lib/util.ts @@ -15,9 +15,9 @@ export function slugify(x: string): string { */ export function defaultSubnetName(type: SubnetType) { switch (type) { - case SubnetType.Public: return 'Public'; - case SubnetType.Private: return 'Private'; - case SubnetType.Isolated: return 'Isolated'; + case SubnetType.PUBLIC: return 'Public'; + case SubnetType.PRIVATE: return 'Private'; + case SubnetType.ISOLATED: return 'Isolated'; } } diff --git a/packages/@aws-cdk/aws-ec2/lib/vpc-endpoint.ts b/packages/@aws-cdk/aws-ec2/lib/vpc-endpoint.ts index 9582322ca133d..4ab5b930280db 100644 --- a/packages/@aws-cdk/aws-ec2/lib/vpc-endpoint.ts +++ b/packages/@aws-cdk/aws-ec2/lib/vpc-endpoint.ts @@ -61,7 +61,7 @@ export enum VpcEndpointType { * address that serves as an entry point for traffic destined to a supported * service. */ - Interface = 'Interface', + INTERFACE = 'Interface', /** * Gateway @@ -69,7 +69,7 @@ export enum VpcEndpointType { * A gateway endpoint is a gateway that is a target for a specified route in * your route table, used for traffic destined to a supported AWS service. */ - Gateway = 'Gateway' + GATEWAY = 'Gateway' } /** @@ -164,7 +164,7 @@ export class GatewayVpcEndpoint extends VpcEndpoint implements IGatewayVpcEndpoi constructor(scope: Construct, id: string, props: GatewayVpcEndpointProps) { super(scope, id); - const subnets = props.subnets || [{ subnetType: SubnetType.Private }]; + const subnets = props.subnets || [{ subnetType: SubnetType.PRIVATE }]; const routeTableIds = [...new Set(Array().concat(...subnets.map(s => props.vpc.selectSubnets(s).routeTableIds)))]; if (routeTableIds.length === 0) { @@ -175,7 +175,7 @@ export class GatewayVpcEndpoint extends VpcEndpoint implements IGatewayVpcEndpoi policyDocument: Lazy.anyValue({ produce: () => this.policyDocument }), routeTableIds, serviceName: props.service.name, - vpcEndpointType: VpcEndpointType.Gateway, + vpcEndpointType: VpcEndpointType.GATEWAY, vpcId: props.vpc.vpcId }); @@ -376,7 +376,7 @@ export class InterfaceVpcEndpoint extends VpcEndpoint implements IInterfaceVpcEn policyDocument: Lazy.anyValue({ produce: () => this.policyDocument }), securityGroupIds: [this.securityGroupId], serviceName: props.service.name, - vpcEndpointType: VpcEndpointType.Interface, + vpcEndpointType: VpcEndpointType.INTERFACE, subnetIds, vpcId: props.vpc.vpcId }); diff --git a/packages/@aws-cdk/aws-ec2/lib/vpc.ts b/packages/@aws-cdk/aws-ec2/lib/vpc.ts index 50006a700a30b..ba1b898be5562 100644 --- a/packages/@aws-cdk/aws-ec2/lib/vpc.ts +++ b/packages/@aws-cdk/aws-ec2/lib/vpc.ts @@ -125,7 +125,7 @@ export enum SubnetType { * This can be good for subnets with RDS or * Elasticache endpoints */ - Isolated = 'Isolated', + ISOLATED = 'Isolated', /** * Subnet that routes to the internet, but not vice versa. @@ -139,7 +139,7 @@ export enum SubnetType { * experimental cost conscious accounts or accounts where HA outbound * traffic is not needed. */ - Private = 'Private', + PRIVATE = 'Private', /** * Subnet connected to the Internet @@ -151,7 +151,7 @@ export enum SubnetType { * * Public subnets route outbound traffic via an Internet Gateway. */ - Public = 'Public' + PUBLIC = 'Public' } /** @@ -326,10 +326,10 @@ abstract class VpcBase extends Resource implements IVpc { subnets = allSubnets.filter(s => subnetName(s) === selection.subnetName); } else { // Select by type subnets = { - [SubnetType.Isolated]: this.isolatedSubnets, - [SubnetType.Private]: this.privateSubnets, - [SubnetType.Public]: this.publicSubnets, - }[selection.subnetType || SubnetType.Private]; + [SubnetType.ISOLATED]: this.isolatedSubnets, + [SubnetType.PRIVATE]: this.privateSubnets, + [SubnetType.PUBLIC]: this.publicSubnets, + }[selection.subnetType || SubnetType.PRIVATE]; if (selection.onePerAz && subnets.length > 0) { // Restrict to at most one subnet group @@ -579,12 +579,12 @@ export enum DefaultInstanceTenancy { /** * Instances can be launched with any tenancy. */ - Default = 'default', + DEFAULT = 'default', /** * Any instance launched into the VPC automatically has dedicated tenancy, unless you launch it with the default tenancy. */ - Dedicated = 'dedicated' + DEDICATED = 'dedicated' } /** @@ -664,12 +664,12 @@ export class Vpc extends VpcBase { */ public static readonly DEFAULT_SUBNETS: SubnetConfiguration[] = [ { - subnetType: SubnetType.Public, - name: defaultSubnetName(SubnetType.Public), + subnetType: SubnetType.PUBLIC, + name: defaultSubnetName(SubnetType.PUBLIC), }, { - subnetType: SubnetType.Private, - name: defaultSubnetName(SubnetType.Private), + subnetType: SubnetType.PRIVATE, + name: defaultSubnetName(SubnetType.PRIVATE), } ]; @@ -828,7 +828,7 @@ export class Vpc extends VpcBase { this.createSubnets(); const allowOutbound = this.subnetConfiguration.filter( - subnet => (subnet.subnetType !== SubnetType.Isolated)).length > 0; + subnet => (subnet.subnetType !== SubnetType.ISOLATED)).length > 0; // Create an Internet Gateway and attach it if necessary if (allowOutbound) { @@ -865,7 +865,7 @@ export class Vpc extends VpcBase { if (props.vpnGateway || props.vpnConnections || props.vpnGatewayAsn) { const vpnGateway = new CfnVPNGateway(this, 'VpnGateway', { amazonSideAsn: props.vpnGatewayAsn, - type: VpnConnectionType.IPsec1 + type: VpnConnectionType.IPSEC_1 }); const attachment = new CfnVPCGatewayAttachment(this, 'VPCVPNGW', { @@ -876,7 +876,7 @@ export class Vpc extends VpcBase { this.vpnGatewayId = vpnGateway.refAsString; // Propagate routes on route tables associated with the right subnets - const vpnRoutePropagation = props.vpnRoutePropagation || [{ subnetType: SubnetType.Private }]; + const vpnRoutePropagation = props.vpnRoutePropagation || [{ subnetType: SubnetType.PRIVATE }]; const routeTableIds = [...new Set(Array().concat(...vpnRoutePropagation.map(s => this.selectSubnets(s).routeTableIds)))]; const routePropagation = new CfnVPNGatewayRoutePropagation(this, 'RoutePropagation', { routeTableIds, @@ -938,7 +938,7 @@ export class Vpc extends VpcBase { private createNatGateways(gateways?: number, placement?: SubnetSelection): void { const useNatGateway = this.subnetConfiguration.filter( - subnet => (subnet.subnetType === SubnetType.Private)).length > 0; + subnet => (subnet.subnetType === SubnetType.PRIVATE)).length > 0; const natCount = ifUndefined(gateways, useNatGateway ? this.availabilityZones.length : 0); @@ -999,22 +999,22 @@ export class Vpc extends VpcBase { availabilityZone: zone, vpcId: this.vpcId, cidrBlock: this.networkBuilder.addSubnet(cidrMask), - mapPublicIpOnLaunch: (subnetConfig.subnetType === SubnetType.Public), + mapPublicIpOnLaunch: (subnetConfig.subnetType === SubnetType.PUBLIC), }; let subnet: Subnet; switch (subnetConfig.subnetType) { - case SubnetType.Public: + case SubnetType.PUBLIC: const publicSubnet = new PublicSubnet(this, name, subnetProps); this.publicSubnets.push(publicSubnet); subnet = publicSubnet; break; - case SubnetType.Private: + case SubnetType.PRIVATE: const privateSubnet = new PrivateSubnet(this, name, subnetProps); this.privateSubnets.push(privateSubnet); subnet = privateSubnet; break; - case SubnetType.Isolated: + case SubnetType.ISOLATED: const isolatedSubnet = new PrivateSubnet(this, name, subnetProps); this.isolatedSubnets.push(isolatedSubnet); subnet = isolatedSubnet; @@ -1036,9 +1036,9 @@ const SUBNETNAME_TAG = 'aws-cdk:subnet-name'; function subnetTypeTagValue(type: SubnetType) { switch (type) { - case SubnetType.Public: return 'Public'; - case SubnetType.Private: return 'Private'; - case SubnetType.Isolated: return 'Isolated'; + case SubnetType.PUBLIC: return 'Public'; + case SubnetType.PRIVATE: return 'Private'; + case SubnetType.ISOLATED: return 'Isolated'; } } @@ -1278,9 +1278,9 @@ class ImportedVpc extends VpcBase { this.vpnGatewayId = props.vpnGatewayId; // tslint:disable:max-line-length - const pub = new ImportSubnetGroup(props.publicSubnetIds, props.publicSubnetNames, SubnetType.Public, this.availabilityZones, 'publicSubnetIds', 'publicSubnetNames'); - const priv = new ImportSubnetGroup(props.privateSubnetIds, props.privateSubnetNames, SubnetType.Private, this.availabilityZones, 'privateSubnetIds', 'privateSubnetNames'); - const iso = new ImportSubnetGroup(props.isolatedSubnetIds, props.isolatedSubnetNames, SubnetType.Isolated, this.availabilityZones, 'isolatedSubnetIds', 'isolatedSubnetNames'); + const pub = new ImportSubnetGroup(props.publicSubnetIds, props.publicSubnetNames, SubnetType.PUBLIC, this.availabilityZones, 'publicSubnetIds', 'publicSubnetNames'); + const priv = new ImportSubnetGroup(props.privateSubnetIds, props.privateSubnetNames, SubnetType.PRIVATE, this.availabilityZones, 'privateSubnetIds', 'privateSubnetNames'); + const iso = new ImportSubnetGroup(props.isolatedSubnetIds, props.isolatedSubnetNames, SubnetType.ISOLATED, this.availabilityZones, 'isolatedSubnetIds', 'isolatedSubnetNames'); // tslint:enable:max-line-length this.publicSubnets = pub.import(this); @@ -1301,7 +1301,7 @@ function reifySelectionDefaults(placement: SubnetSelection): SubnetSelection { } if (placement.subnetType === undefined && placement.subnetName === undefined) { - return { subnetType: SubnetType.Private, onePerAz: placement.onePerAz }; + return { subnetType: SubnetType.PRIVATE, onePerAz: placement.onePerAz }; } return placement; diff --git a/packages/@aws-cdk/aws-ec2/lib/vpn.ts b/packages/@aws-cdk/aws-ec2/lib/vpn.ts index 63e4a2fd562c0..9a5cde4633eb7 100644 --- a/packages/@aws-cdk/aws-ec2/lib/vpn.ts +++ b/packages/@aws-cdk/aws-ec2/lib/vpn.ts @@ -89,13 +89,13 @@ export enum VpnConnectionType { /** * The IPsec 1 VPN connection type. */ - IPsec1 = 'ipsec.1', + IPSEC_1 = 'ipsec.1', /** * Dummy member * TODO: remove once https://github.com/awslabs/jsii/issues/231 is fixed */ - Dummy = 'dummy' + DUMMY = 'dummy' } export class VpnConnection extends cdk.Construct implements IVpnConnection { @@ -153,7 +153,7 @@ export class VpnConnection extends cdk.Construct implements IVpnConnection { throw new Error(`The \`ip\` ${props.ip} is not a valid IPv4 address.`); } - const type = VpnConnectionType.IPsec1; + const type = VpnConnectionType.IPSEC_1; const bgpAsn = props.asn || 65000; const customerGateway = new CfnCustomerGateway(this, 'CustomerGateway', { diff --git a/packages/@aws-cdk/aws-ec2/test/example.images.lit.ts b/packages/@aws-cdk/aws-ec2/test/example.images.lit.ts index 1a43bec421a6a..f11d9148f7a38 100644 --- a/packages/@aws-cdk/aws-ec2/test/example.images.lit.ts +++ b/packages/@aws-cdk/aws-ec2/test/example.images.lit.ts @@ -2,15 +2,15 @@ import ec2 = require("../lib"); /// !show // Pick a Windows edition to use -const windows = new ec2.WindowsImage(ec2.WindowsVersion.WindowsServer2019EnglishFullBase); +const windows = new ec2.WindowsImage(ec2.WindowsVersion.WINDOWS_SERVER_2019_ENGLISH_FULL_BASE); // Pick the right Amazon Linux edition. All arguments shown are optional // and will default to these values when omitted. const amznLinux = new ec2.AmazonLinuxImage({ - generation: ec2.AmazonLinuxGeneration.AmazonLinux, - edition: ec2.AmazonLinuxEdition.Standard, + generation: ec2.AmazonLinuxGeneration.AMAZON_LINUX, + edition: ec2.AmazonLinuxEdition.STANDARD, virtualization: ec2.AmazonLinuxVirt.HVM, - storage: ec2.AmazonLinuxStorage.GeneralPurpose, + storage: ec2.AmazonLinuxStorage.GENERAL_PURPOSE, }); // For other custom (Linux) images, instantiate a `GenericLinuxImage` with diff --git a/packages/@aws-cdk/aws-ec2/test/export-helper.ts b/packages/@aws-cdk/aws-ec2/test/export-helper.ts index 978c77d52ee18..bfc3443a4402f 100644 --- a/packages/@aws-cdk/aws-ec2/test/export-helper.ts +++ b/packages/@aws-cdk/aws-ec2/test/export-helper.ts @@ -3,9 +3,9 @@ import { ISubnet, SubnetType, Vpc } from '../lib'; import { defaultSubnetName, range, subnetName } from '../lib/util'; export function exportVpc(vpc: Vpc) { - const pub = new ExportSubnetGroup(vpc, 'PublicSubnetIDs', vpc.publicSubnets, SubnetType.Public, vpc.availabilityZones.length); - const priv = new ExportSubnetGroup(vpc, 'PrivateSubnetIDs', vpc.privateSubnets, SubnetType.Private, vpc.availabilityZones.length); - const iso = new ExportSubnetGroup(vpc, 'IsolatedSubnetIDs', vpc.isolatedSubnets, SubnetType.Isolated, vpc.availabilityZones.length); + const pub = new ExportSubnetGroup(vpc, 'PublicSubnetIDs', vpc.publicSubnets, SubnetType.PUBLIC, vpc.availabilityZones.length); + const priv = new ExportSubnetGroup(vpc, 'PrivateSubnetIDs', vpc.privateSubnets, SubnetType.PRIVATE, vpc.availabilityZones.length); + const iso = new ExportSubnetGroup(vpc, 'IsolatedSubnetIDs', vpc.isolatedSubnets, SubnetType.ISOLATED, vpc.availabilityZones.length); const vpnGatewayId = vpc.vpnGatewayId ? new CfnOutput(vpc, 'VpnGatewayId', { value: vpc.vpnGatewayId }).makeImportValue().toString() 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 a30369a980163..2187987045462 100644 --- a/packages/@aws-cdk/aws-ec2/test/test.vpc-endpoint.ts +++ b/packages/@aws-cdk/aws-ec2/test/test.vpc-endpoint.ts @@ -62,10 +62,10 @@ export = { service: GatewayVpcEndpointAwsService.S3, subnets: [ { - subnetType: SubnetType.Public + subnetType: SubnetType.PUBLIC }, { - subnetType: SubnetType.Private + subnetType: SubnetType.PRIVATE } ] } diff --git a/packages/@aws-cdk/aws-ec2/test/test.vpc.ts b/packages/@aws-cdk/aws-ec2/test/test.vpc.ts index e0e19f4246443..c4a39456abcfa 100644 --- a/packages/@aws-cdk/aws-ec2/test/test.vpc.ts +++ b/packages/@aws-cdk/aws-ec2/test/test.vpc.ts @@ -22,7 +22,7 @@ export = { CidrBlock: Vpc.DEFAULT_CIDR_RANGE, EnableDnsHostnames: true, EnableDnsSupport: true, - InstanceTenancy: DefaultInstanceTenancy.Default, + InstanceTenancy: DefaultInstanceTenancy.DEFAULT, })); test.done(); }, @@ -48,14 +48,14 @@ export = { cidr: "192.168.0.0/16", enableDnsHostnames: false, enableDnsSupport: false, - defaultInstanceTenancy: DefaultInstanceTenancy.Dedicated, + defaultInstanceTenancy: DefaultInstanceTenancy.DEDICATED, }); expect(stack).to(haveResource('AWS::EC2::VPC', { CidrBlock: '192.168.0.0/16', EnableDnsHostnames: false, EnableDnsSupport: false, - InstanceTenancy: DefaultInstanceTenancy.Dedicated, + InstanceTenancy: DefaultInstanceTenancy.DEDICATED, })); test.done(); }, @@ -75,7 +75,7 @@ export = { new Vpc(stack, 'TheVPC', { subnetConfiguration: [ { - subnetType: SubnetType.Isolated, + subnetType: SubnetType.ISOLATED, name: 'Isolated', } ] @@ -93,11 +93,11 @@ export = { new Vpc(stack, 'TheVPC', { subnetConfiguration: [ { - subnetType: SubnetType.Public, + subnetType: SubnetType.PUBLIC, name: 'Public', }, { - subnetType: SubnetType.Isolated, + subnetType: SubnetType.ISOLATED, name: 'Isolated', } ] @@ -123,19 +123,19 @@ export = { subnetConfiguration: [ { cidrMask: 24, - subnetType: SubnetType.Private, + subnetType: SubnetType.PRIVATE, name: 'Private', }, { cidrMask: 24, name: 'reserved', - subnetType: SubnetType.Private, + subnetType: SubnetType.PRIVATE, reserved: true, }, { cidrMask: 28, name: 'rds', - subnetType: SubnetType.Isolated, + subnetType: SubnetType.ISOLATED, } ], maxAZs: 3 @@ -151,18 +151,18 @@ export = { { cidrMask: 24, name: 'ingress', - subnetType: SubnetType.Private, + subnetType: SubnetType.PRIVATE, }, { cidrMask: 24, name: 'reserved', - subnetType: SubnetType.Private, + subnetType: SubnetType.PRIVATE, reserved: true, }, { cidrMask: 24, name: 'rds', - subnetType: SubnetType.Private, + subnetType: SubnetType.PRIVATE, } ], maxAZs: 3 @@ -193,17 +193,17 @@ export = { { cidrMask: 24, name: 'ingress', - subnetType: SubnetType.Public, + subnetType: SubnetType.PUBLIC, }, { cidrMask: 24, name: 'application', - subnetType: SubnetType.Private, + subnetType: SubnetType.PRIVATE, }, { cidrMask: 28, name: 'rds', - subnetType: SubnetType.Isolated, + subnetType: SubnetType.ISOLATED, } ], maxAZs: 3 @@ -232,17 +232,17 @@ export = { { cidrMask: 24, name: 'ingress', - subnetType: SubnetType.Public, + subnetType: SubnetType.PUBLIC, }, { cidrMask: 24, name: 'application', - subnetType: SubnetType.Private, + subnetType: SubnetType.PRIVATE, }, { cidrMask: 28, name: 'rds', - subnetType: SubnetType.Isolated, + subnetType: SubnetType.ISOLATED, } ], maxAZs: 3 @@ -278,7 +278,7 @@ export = { { cidrMask: 24, name: 'ingress', - subnetType: SubnetType.Public, + subnetType: SubnetType.PUBLIC, } ], }); @@ -345,17 +345,17 @@ export = { { cidrMask: 24, name: 'ingress', - subnetType: SubnetType.Public, + subnetType: SubnetType.PUBLIC, }, { cidrMask: 24, name: 'egress', - subnetType: SubnetType.Public, + subnetType: SubnetType.PUBLIC, }, { cidrMask: 24, name: 'private', - subnetType: SubnetType.Private, + subnetType: SubnetType.PRIVATE, }, ], natGatewaySubnets: { @@ -378,12 +378,12 @@ export = { { cidrMask: 24, name: 'ingress', - subnetType: SubnetType.Public, + subnetType: SubnetType.PUBLIC, }, { cidrMask: 24, name: 'private', - subnetType: SubnetType.Private, + subnetType: SubnetType.PRIVATE, }, ], natGatewaySubnets: { @@ -436,13 +436,13 @@ export = { const stack = getTestStack(); new Vpc(stack, 'VPC', { subnetConfiguration: [ - { subnetType: SubnetType.Private, name: 'Private' }, - { subnetType: SubnetType.Isolated, name: 'Isolated' }, + { subnetType: SubnetType.PRIVATE, name: 'Private' }, + { subnetType: SubnetType.ISOLATED, name: 'Isolated' }, ], vpnGateway: true, vpnRoutePropagation: [ { - subnetType: SubnetType.Isolated + subnetType: SubnetType.ISOLATED } ] }); @@ -470,16 +470,16 @@ export = { const stack = getTestStack(); new Vpc(stack, 'VPC', { subnetConfiguration: [ - { subnetType: SubnetType.Private, name: 'Private' }, - { subnetType: SubnetType.Isolated, name: 'Isolated' }, + { subnetType: SubnetType.PRIVATE, name: 'Private' }, + { subnetType: SubnetType.ISOLATED, name: 'Isolated' }, ], vpnGateway: true, vpnRoutePropagation: [ { - subnetType: SubnetType.Private + subnetType: SubnetType.PRIVATE }, { - subnetType: SubnetType.Isolated + subnetType: SubnetType.ISOLATED } ] }); @@ -623,7 +623,7 @@ export = { const vpc = new Vpc(stack, 'VPC'); // WHEN - const { subnetIds } = vpc.selectSubnets({ subnetType: SubnetType.Public }); + const { subnetIds } = vpc.selectSubnets({ subnetType: SubnetType.PUBLIC }); // THEN test.deepEqual(subnetIds, vpc.publicSubnets.map(s => s.subnetId)); @@ -636,13 +636,13 @@ export = { const stack = getTestStack(); const vpc = new Vpc(stack, 'VPC', { subnetConfiguration: [ - { subnetType: SubnetType.Private, name: 'Private' }, - { subnetType: SubnetType.Isolated, name: 'Isolated' }, + { subnetType: SubnetType.PRIVATE, name: 'Private' }, + { subnetType: SubnetType.ISOLATED, name: 'Isolated' }, ] }); // WHEN - const { subnetIds } = vpc.selectSubnets({ subnetType: SubnetType.Isolated }); + const { subnetIds } = vpc.selectSubnets({ subnetType: SubnetType.ISOLATED }); // THEN test.deepEqual(subnetIds, vpc.isolatedSubnets.map(s => s.subnetId)); @@ -655,8 +655,8 @@ export = { const stack = getTestStack(); const vpc = new Vpc(stack, 'VPC', { subnetConfiguration: [ - { subnetType: SubnetType.Private, name: 'DontTalkToMe' }, - { subnetType: SubnetType.Isolated, name: 'DontTalkAtAll' }, + { subnetType: SubnetType.PRIVATE, name: 'DontTalkToMe' }, + { subnetType: SubnetType.ISOLATED, name: 'DontTalkAtAll' }, ] }); @@ -690,8 +690,8 @@ export = { const vpc = new Vpc(stack, 'VpcNetwork', { maxAZs: 1, subnetConfiguration: [ - {name: 'app', subnetType: SubnetType.Private }, - {name: 'db', subnetType: SubnetType.Private }, + {name: 'app', subnetType: SubnetType.PRIVATE }, + {name: 'db', subnetType: SubnetType.PRIVATE }, ] }); @@ -725,8 +725,8 @@ export = { const imported = doImportExportTest(stack => { return new Vpc(stack, 'TheVPC', { subnetConfiguration: [ - { name: 'Ingress', subnetType: SubnetType.Public }, - { name: 'Egress', subnetType: SubnetType.Public }, + { name: 'Ingress', subnetType: SubnetType.PUBLIC }, + { name: 'Egress', subnetType: SubnetType.PUBLIC }, ] }); }); @@ -755,14 +755,14 @@ export = { const importedVpc = doImportExportTest(stack => { return new Vpc(stack, 'TheVPC', { subnetConfiguration: [ - { subnetType: SubnetType.Private, name: 'Private' }, - { subnetType: SubnetType.Isolated, name: 'Isolated' }, + { subnetType: SubnetType.PRIVATE, name: 'Private' }, + { subnetType: SubnetType.ISOLATED, name: 'Isolated' }, ] }); }); // WHEN - const { subnetIds } = importedVpc.selectSubnets({ subnetType: SubnetType.Isolated }); + const { subnetIds } = importedVpc.selectSubnets({ subnetType: SubnetType.ISOLATED }); // THEN test.equal(3, importedVpc.isolatedSubnets.length); @@ -778,8 +778,8 @@ export = { const importedVpc = doImportExportTest(stack => { return new Vpc(stack, 'TheVPC', { subnetConfiguration: [ - { subnetType: SubnetType.Private, name: 'Private' }, - { subnetType: SubnetType.Isolated, name: isolatedName }, + { subnetType: SubnetType.PRIVATE, name: 'Private' }, + { subnetType: SubnetType.ISOLATED, name: isolatedName }, ] }); }); diff --git a/packages/@aws-cdk/aws-ecr/lib/lifecycle.ts b/packages/@aws-cdk/aws-ecr/lib/lifecycle.ts index d86bb540c7e7b..74d688c1285fd 100644 --- a/packages/@aws-cdk/aws-ecr/lib/lifecycle.ts +++ b/packages/@aws-cdk/aws-ecr/lib/lifecycle.ts @@ -64,17 +64,17 @@ export enum TagStatus { /** * Rule applies to all images */ - Any = 'any', + ANY = 'any', /** * Rule applies to tagged images */ - Tagged = 'tagged', + TAGGED = 'tagged', /** * Rule applies to untagged images */ - Untagged = 'untagged', + UNTAGGED = 'untagged', } /** @@ -84,10 +84,10 @@ export enum CountType { /** * Set a limit on the number of images in your repository */ - ImageCountMoreThan = 'imageCountMoreThan', + IMAGE_COUNT_MORE_THAN = 'imageCountMoreThan', /** * Set an age limit on the images in your repository */ - SinceImagePushed = 'sinceImagePushed', + SINCE_IMAGE_PUSHED = 'sinceImagePushed', } diff --git a/packages/@aws-cdk/aws-ecr/lib/repository.ts b/packages/@aws-cdk/aws-ecr/lib/repository.ts index 3beafc29ccfa7..7da17a6686a9d 100644 --- a/packages/@aws-cdk/aws-ecr/lib/repository.ts +++ b/packages/@aws-cdk/aws-ecr/lib/repository.ts @@ -382,20 +382,20 @@ export class Repository extends RepositoryBase { public addLifecycleRule(rule: LifecycleRule) { // Validate rule here so users get errors at the expected location if (rule.tagStatus === undefined) { - rule = { ...rule, tagStatus: rule.tagPrefixList === undefined ? TagStatus.Any : TagStatus.Tagged }; + rule = { ...rule, tagStatus: rule.tagPrefixList === undefined ? TagStatus.ANY : TagStatus.TAGGED }; } - if (rule.tagStatus === TagStatus.Tagged && (rule.tagPrefixList === undefined || rule.tagPrefixList.length === 0)) { + if (rule.tagStatus === TagStatus.TAGGED && (rule.tagPrefixList === undefined || rule.tagPrefixList.length === 0)) { throw new Error('TagStatus.Tagged requires the specification of a tagPrefixList'); } - if (rule.tagStatus !== TagStatus.Tagged && rule.tagPrefixList !== undefined) { + if (rule.tagStatus !== TagStatus.TAGGED && rule.tagPrefixList !== undefined) { throw new Error('tagPrefixList can only be specified when tagStatus is set to Tagged'); } if ((rule.maxImageAgeDays !== undefined) === (rule.maxImageCount !== undefined)) { throw new Error(`Life cycle rule must contain exactly one of 'maxImageAgeDays' and 'maxImageCount', got: ${JSON.stringify(rule)}`); } - if (rule.tagStatus === TagStatus.Any && this.lifecycleRules.filter(r => r.tagStatus === TagStatus.Any).length > 0) { + if (rule.tagStatus === TagStatus.ANY && this.lifecycleRules.filter(r => r.tagStatus === TagStatus.ANY).length > 0) { throw new Error('Life cycle can only have one TagStatus.Any rule'); } @@ -431,9 +431,9 @@ export class Repository extends RepositoryBase { private orderedLifecycleRules(): LifecycleRule[] { if (this.lifecycleRules.length === 0) { return []; } - const prioritizedRules = this.lifecycleRules.filter(r => r.rulePriority !== undefined && r.tagStatus !== TagStatus.Any); - const autoPrioritizedRules = this.lifecycleRules.filter(r => r.rulePriority === undefined && r.tagStatus !== TagStatus.Any); - const anyRules = this.lifecycleRules.filter(r => r.tagStatus === TagStatus.Any); + const prioritizedRules = this.lifecycleRules.filter(r => r.rulePriority !== undefined && r.tagStatus !== TagStatus.ANY); + const autoPrioritizedRules = this.lifecycleRules.filter(r => r.rulePriority === undefined && r.tagStatus !== TagStatus.ANY); + const anyRules = this.lifecycleRules.filter(r => r.tagStatus === TagStatus.ANY); if (anyRules.length > 0 && anyRules[0].rulePriority !== undefined && autoPrioritizedRules.length > 0) { // Supporting this is too complex for very little value. We just prohibit it. throw new Error("Cannot combine prioritized TagStatus.Any rule with unprioritized rules. Remove rulePriority from the 'Any' rule."); @@ -457,7 +457,7 @@ export class Repository extends RepositoryBase { } function validateAnyRuleLast(rules: LifecycleRule[]) { - const anyRules = rules.filter(r => r.tagStatus === TagStatus.Any); + const anyRules = rules.filter(r => r.tagStatus === TagStatus.ANY); if (anyRules.length === 1) { const maxPrio = Math.max(...rules.map(r => r.rulePriority!)); if (anyRules[0].rulePriority !== maxPrio) { @@ -474,9 +474,9 @@ function renderLifecycleRule(rule: LifecycleRule) { rulePriority: rule.rulePriority, description: rule.description, selection: { - tagStatus: rule.tagStatus || TagStatus.Any, + tagStatus: rule.tagStatus || TagStatus.ANY, tagPrefixList: rule.tagPrefixList, - countType: rule.maxImageAgeDays !== undefined ? CountType.SinceImagePushed : CountType.ImageCountMoreThan, + countType: rule.maxImageAgeDays !== undefined ? CountType.SINCE_IMAGE_PUSHED : CountType.IMAGE_COUNT_MORE_THAN, countNumber: rule.maxImageAgeDays !== undefined ? rule.maxImageAgeDays : rule.maxImageCount, countUnit: rule.maxImageAgeDays !== undefined ? 'days' : undefined, }, diff --git a/packages/@aws-cdk/aws-ecr/test/test.repository.ts b/packages/@aws-cdk/aws-ecr/test/test.repository.ts index 169b31a3aa4b7..aebe2c44b317e 100644 --- a/packages/@aws-cdk/aws-ecr/test/test.repository.ts +++ b/packages/@aws-cdk/aws-ecr/test/test.repository.ts @@ -95,8 +95,8 @@ export = { const repo = new ecr.Repository(stack, 'Repo'); // WHEN - repo.addLifecycleRule({ tagStatus: ecr.TagStatus.Tagged, tagPrefixList: ['a'], maxImageCount: 5 }); - repo.addLifecycleRule({ rulePriority: 10, tagStatus: ecr.TagStatus.Tagged, tagPrefixList: ['b'], maxImageCount: 5 }); + repo.addLifecycleRule({ tagStatus: ecr.TagStatus.TAGGED, tagPrefixList: ['a'], maxImageCount: 5 }); + repo.addLifecycleRule({ rulePriority: 10, tagStatus: ecr.TagStatus.TAGGED, tagPrefixList: ['b'], maxImageCount: 5 }); // THEN expect(stack).to(haveResource('AWS::ECR::Repository', { @@ -116,7 +116,7 @@ export = { // WHEN repo.addLifecycleRule({ maxImageCount: 5 }); - repo.addLifecycleRule({ tagStatus: ecr.TagStatus.Tagged, tagPrefixList: ['important'], maxImageCount: 999 }); + repo.addLifecycleRule({ tagStatus: ecr.TagStatus.TAGGED, tagPrefixList: ['important'], maxImageCount: 999 }); // THEN expect(stack).to(haveResource('AWS::ECR::Repository', { diff --git a/packages/@aws-cdk/aws-ecs/lib/base/base-service.ts b/packages/@aws-cdk/aws-ecs/lib/base/base-service.ts index 81b90352e94cd..969adcce23f0f 100644 --- a/packages/@aws-cdk/aws-ecs/lib/base/base-service.ts +++ b/packages/@aws-cdk/aws-ecs/lib/base/base-service.ts @@ -224,7 +224,7 @@ export abstract class BaseService extends Resource } return this.scalableTaskCount = new ScalableTaskCount(this, 'TaskCount', { - serviceNamespace: appscaling.ServiceNamespace.Ecs, + serviceNamespace: appscaling.ServiceNamespace.ECS, resourceId: `service/${this.clusterName}/${this.serviceName}`, dimension: 'ecs:service:DesiredCount', role: this.makeAutoScalingRole(), @@ -268,7 +268,7 @@ export abstract class BaseService extends Resource // tslint:disable-next-line:max-line-length protected configureAwsVpcNetworking(vpc: ec2.IVpc, assignPublicIp?: boolean, vpcSubnets?: ec2.SubnetSelection, securityGroup?: ec2.ISecurityGroup) { if (vpcSubnets === undefined) { - vpcSubnets = { subnetType: assignPublicIp ? ec2.SubnetType.Public : ec2.SubnetType.Private }; + vpcSubnets = { subnetType: assignPublicIp ? ec2.SubnetType.PUBLIC : ec2.SubnetType.PRIVATE }; } if (securityGroup === undefined) { securityGroup = new ec2.SecurityGroup(this, 'SecurityGroup', { vpc }); diff --git a/packages/@aws-cdk/aws-ecs/lib/base/scalable-task-count.ts b/packages/@aws-cdk/aws-ecs/lib/base/scalable-task-count.ts index 1b495a57b00ae..f983469152860 100644 --- a/packages/@aws-cdk/aws-ecs/lib/base/scalable-task-count.ts +++ b/packages/@aws-cdk/aws-ecs/lib/base/scalable-task-count.ts @@ -36,7 +36,7 @@ export class ScalableTaskCount extends appscaling.BaseScalableAttribute { */ public scaleOnCpuUtilization(id: string, props: CpuUtilizationScalingProps) { return super.doScaleToTrackMetric(id, { - predefinedMetric: appscaling.PredefinedMetric.ECSServiceAverageCPUUtilization, + predefinedMetric: appscaling.PredefinedMetric.ECS_SERVICE_AVERAGE_CPU_UTILIZATION, policyName: props.policyName, disableScaleIn: props.disableScaleIn, targetValue: props.targetUtilizationPercent, @@ -50,7 +50,7 @@ export class ScalableTaskCount extends appscaling.BaseScalableAttribute { */ public scaleOnMemoryUtilization(id: string, props: MemoryUtilizationScalingProps) { return super.doScaleToTrackMetric(id, { - predefinedMetric: appscaling.PredefinedMetric.ECSServiceAverageMemoryUtilization, + predefinedMetric: appscaling.PredefinedMetric.ECS_SERVICE_AVERAGE_MEMORY_UTILIZATION, targetValue: props.targetUtilizationPercent, policyName: props.policyName, disableScaleIn: props.disableScaleIn, @@ -67,7 +67,7 @@ export class ScalableTaskCount extends appscaling.BaseScalableAttribute { '/' + props.targetGroup.targetGroupFullName; return super.doScaleToTrackMetric(id, { - predefinedMetric: appscaling.PredefinedMetric.ALBRequestCountPerTarget, + predefinedMetric: appscaling.PredefinedMetric.ALB_REQUEST_COUNT_PER_TARGET, resourceLabel, targetValue: props.requestsPerTarget, policyName: props.policyName, diff --git a/packages/@aws-cdk/aws-ecs/lib/cluster.ts b/packages/@aws-cdk/aws-ecs/lib/cluster.ts index be4a359092f18..617415de3cbae 100644 --- a/packages/@aws-cdk/aws-ecs/lib/cluster.ts +++ b/packages/@aws-cdk/aws-ecs/lib/cluster.ts @@ -100,11 +100,11 @@ export class Cluster extends Resource implements ICluster { throw new Error("Can only add default namespace once."); } - const namespaceType = options.type === undefined || options.type === NamespaceType.PrivateDns - ? cloudmap.NamespaceType.DnsPrivate - : cloudmap.NamespaceType.DnsPublic; + const namespaceType = options.type === undefined || options.type === NamespaceType.PRIVATE_DNS + ? cloudmap.NamespaceType.DNS_PRIVATE + : cloudmap.NamespaceType.DNS_PUBLIC; - const sdNamespace = namespaceType === cloudmap.NamespaceType.DnsPrivate ? + const sdNamespace = namespaceType === cloudmap.NamespaceType.DNS_PRIVATE ? new cloudmap.PrivateDnsNamespace(this, 'DefaultServiceDiscoveryNamespace', { name: options.name, vpc: this.vpc @@ -135,7 +135,7 @@ export class Cluster extends Resource implements ICluster { ...options, vpc: this.vpc, machineImage: options.machineImage || new EcsOptimizedAmi(), - updateType: options.updateType || autoscaling.UpdateType.ReplacingUpdate, + updateType: options.updateType || autoscaling.UpdateType.REPLACING_UPDATE, instanceType: options.instanceType, }); @@ -258,27 +258,27 @@ export class EcsOptimizedAmi implements ec2.IMachineImageSource { private readonly amiParameterName: string; constructor(props?: EcsOptimizedAmiProps) { - this.hwType = (props && props.hardwareType) || AmiHardwareType.Standard; + this.hwType = (props && props.hardwareType) || AmiHardwareType.STANDARD; if (props && props.generation) { // generation defined in the props object - if (props.generation === ec2.AmazonLinuxGeneration.AmazonLinux && this.hwType !== AmiHardwareType.Standard) { + if (props.generation === ec2.AmazonLinuxGeneration.AMAZON_LINUX && this.hwType !== AmiHardwareType.STANDARD) { throw new Error(`Amazon Linux does not support special hardware type. Use Amazon Linux 2 instead`); } else { this.generation = props.generation; } } else { // generation not defined in props object - if (this.hwType === AmiHardwareType.Standard) { // default to Amazon Linux v1 if no HW is standard - this.generation = ec2.AmazonLinuxGeneration.AmazonLinux; + if (this.hwType === AmiHardwareType.STANDARD) { // default to Amazon Linux v1 if no HW is standard + this.generation = ec2.AmazonLinuxGeneration.AMAZON_LINUX; } else { // default to Amazon Linux v2 if special HW - this.generation = ec2.AmazonLinuxGeneration.AmazonLinux2; + this.generation = ec2.AmazonLinuxGeneration.AMAZON_LINUX_2; } } // set the SSM parameter name this.amiParameterName = "/aws/service/ecs/optimized-ami/" - + ( this.generation === ec2.AmazonLinuxGeneration.AmazonLinux ? "amazon-linux/" : "" ) - + ( this.generation === ec2.AmazonLinuxGeneration.AmazonLinux2 ? "amazon-linux-2/" : "" ) - + ( this.hwType === AmiHardwareType.Gpu ? "gpu/" : "" ) - + ( this.hwType === AmiHardwareType.Arm ? "arm64/" : "" ) + + ( this.generation === ec2.AmazonLinuxGeneration.AMAZON_LINUX ? "amazon-linux/" : "" ) + + ( this.generation === ec2.AmazonLinuxGeneration.AMAZON_LINUX_2 ? "amazon-linux-2/" : "" ) + + ( this.hwType === AmiHardwareType.GPU ? "gpu/" : "" ) + + ( this.hwType === AmiHardwareType.ARM ? "arm64/" : "" ) + "recommended/image_id"; } @@ -498,12 +498,12 @@ export enum NamespaceType { /** * Create a private DNS namespace */ - PrivateDns = 'PrivateDns', + PRIVATE_DNS = 'PrivateDns', /** * Create a public DNS namespace */ - PublicDns = 'PublicDns', + PUBLIC_DNS = 'PublicDns', } /** @@ -514,15 +514,15 @@ export enum AmiHardwareType { /** * Create a standard AMI */ - Standard = 'Standard', + STANDARD = 'Standard', /** * Create a GPU optimized AMI */ - Gpu = 'GPU', + GPU = 'GPU', /** * Create a ARM64 optimized AMI */ - Arm = 'ARM64', + ARM = 'ARM64', } diff --git a/packages/@aws-cdk/aws-ecs/lib/container-definition.ts b/packages/@aws-cdk/aws-ecs/lib/container-definition.ts index 59f8e08e0c660..5f0d6facaa517 100644 --- a/packages/@aws-cdk/aws-ecs/lib/container-definition.ts +++ b/packages/@aws-cdk/aws-ecs/lib/container-definition.ts @@ -534,21 +534,21 @@ export interface Ulimit { * Type of resource to set a limit on */ export enum UlimitName { - Core = "core", - Cpu = "cpu", - Data = "data", - Fsize = "fsize", - Locks = "locks", - Memlock = "memlock", - Msgqueue = "msgqueue", - Nice = "nice", - Nofile = "nofile", - Nproc = "nproc", - Rss = "rss", - Rtprio = "rtprio", - Rttime = "rttime", - Sigpending = "sigpending", - Stack = "stack" + CORE = "core", + CPU = "cpu", + DATA = "data", + FSIZE = "fsize", + LOCKS = "locks", + MEMLOCK = "memlock", + MSGQUEUE = "msgqueue", + NICE = "nice", + NOFILE = "nofile", + NPROC = "nproc", + RSS = "rss", + RTPRIO = "rtprio", + RTTIME = "rttime", + SIGPENDING = "sigpending", + STACK = "stack" } function renderUlimit(ulimit: Ulimit): CfnTaskDefinition.UlimitProperty { @@ -594,19 +594,19 @@ export enum Protocol { /** * TCP */ - Tcp = "tcp", + TCP = "tcp", /** * UDP */ - Udp = "udp", + UDP = "udp", } function renderPortMapping(pm: PortMapping): CfnTaskDefinition.PortMappingProperty { return { containerPort: pm.containerPort, hostPort: pm.hostPort, - protocol: pm.protocol || Protocol.Tcp, + protocol: pm.protocol || Protocol.TCP, }; } 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 a8fc401e198ea..d3a8c8b55577c 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 @@ -63,8 +63,8 @@ export class InstanceDrainHook extends cdk.Construct { // Hook everything up: ASG -> Topic, Topic -> Lambda props.autoScalingGroup.addLifecycleHook('DrainHook', { - lifecycleTransition: autoscaling.LifecycleTransition.InstanceTerminating, - defaultResult: autoscaling.DefaultResult.Continue, + lifecycleTransition: autoscaling.LifecycleTransition.INSTANCE_TERMINATING, + defaultResult: autoscaling.DefaultResult.CONTINUE, notificationTarget: new hooks.FunctionHook(fn), heartbeatTimeoutSec: drainTimeSeconds, }); diff --git a/packages/@aws-cdk/aws-ecs/lib/linux-parameters.ts b/packages/@aws-cdk/aws-ecs/lib/linux-parameters.ts index 4630cf7a18420..715ec3f66d0d4 100644 --- a/packages/@aws-cdk/aws-ecs/lib/linux-parameters.ts +++ b/packages/@aws-cdk/aws-ecs/lib/linux-parameters.ts @@ -176,44 +176,44 @@ function renderTmpfs(tmpfs: Tmpfs): CfnTaskDefinition.TmpfsProperty { * A Linux capability */ export enum Capability { - All = "ALL", - AuditControl = "AUDIT_CONTROL", - AuditWrite = "AUDIT_WRITE", - BlockSuspend = "BLOCK_SUSPEND", - Chown = "CHOWN", - DacOverride = "DAC_OVERRIDE", - DacReadSearch = "DAC_READ_SEARCH", - Fowner = "FOWNER", - Fsetid = "FSETID", - IpcLock = "IPC_LOCK", - IpcOwner = "IPC_OWNER", - Kill = "KILL", - Lease = "LEASE", - LinuxImmutable = "LINUX_IMMUTABLE", - MacAdmin = "MAC_ADMIN", - MacOverride = "MAC_OVERRIDE", - Mknod = "MKNOD", - NetAdmin = "NET_ADMIN", - NetBindService = "NET_BIND_SERVICE", - NetBroadcast = "NET_BROADCAST", - NetRaw = "NET_RAW", - Setfcap = "SETFCAP", - Setgid = "SETGID", - Setpcap = "SETPCAP", - Setuid = "SETUID", - SysAdmin = "SYS_ADMIN", - SysBoot = "SYS_BOOT", - SysChroot = "SYS_CHROOT", - SysModule = "SYS_MODULE", - SysNice = "SYS_NICE", - SysPacct = "SYS_PACCT", - SysPtrace = "SYS_PTRACE", - SysRawio = "SYS_RAWIO", - SysResource = "SYS_RESOURCE", - SysTime = "SYS_TIME", - SysTtyConfig = "SYS_TTY_CONFIG", - Syslog = "SYSLOG", - WakeAlarm = "WAKE_ALARM" + ALL = "ALL", + AUDIT_CONTROL = "AUDIT_CONTROL", + AUDIT_WRITE = "AUDIT_WRITE", + BLOCK_SUSPEND = "BLOCK_SUSPEND", + CHOWN = "CHOWN", + DAC_OVERRIDE = "DAC_OVERRIDE", + DAC_READ_SEARCH = "DAC_READ_SEARCH", + FOWNER = "FOWNER", + FSETID = "FSETID", + IPC_LOCK = "IPC_LOCK", + IPC_OWNER = "IPC_OWNER", + KILL = "KILL", + LEASE = "LEASE", + LINUX_IMMUTABLE = "LINUX_IMMUTABLE", + MAC_ADMIN = "MAC_ADMIN", + MAC_OVERRIDE = "MAC_OVERRIDE", + MKNOD = "MKNOD", + NET_ADMIN = "NET_ADMIN", + NET_BIND_SERVICE = "NET_BIND_SERVICE", + NET_BROADCAST = "NET_BROADCAST", + NET_RAW = "NET_RAW", + SETFCAP = "SETFCAP", + SETGID = "SETGID", + SETPCAP = "SETPCAP", + SETUID = "SETUID", + SYS_ADMIN = "SYS_ADMIN", + SYS_BOOT = "SYS_BOOT", + SYS_CHROOT = "SYS_CHROOT", + SYS_MODULE = "SYS_MODULE", + SYS_NICE = "SYS_NICE", + SYS_PACCT = "SYS_PACCT", + SYS_PTRACE = "SYS_PTRACE", + SYS_RAWIO = "SYS_RAWIO", + SYS_RESOURCE = "SYS_RESOURCE", + SYS_TIME = "SYS_TIME", + SYS_TTY_CONFIG = "SYS_TTY_CONFIG", + SYSLOG = "SYSLOG", + WAKE_ALARM = "WAKE_ALARM" } /** @@ -223,60 +223,60 @@ export enum DevicePermission { /** * Read */ - Read = "read", + READ = "read", /** * Write */ - Write = "write", + WRITE = "write", /** * Make a node */ - Mknod = "mknod", + MKNOD = "mknod", } /** * Options for a tmpfs mount */ export enum TmpfsMountOption { - Defaults = "defaults", - Ro = "ro", - Rw = "rw", - Suid = "suid", - Nosuid = "nosuid", - Dev = "dev", - Nodev = "nodev", - Exec = "exec", - Noexec = "noexec", - Sync = "sync", - Async = "async", - Dirsync = "dirsync", - Remount = "remount", - Mand = "mand", - Nomand = "nomand", - Atime = "atime", - Noatime = "noatime", - Diratime = "diratime", - Nodiratime = "nodiratime", - Bind = "bind", - Rbind = "rbind", - Unbindable = "unbindable", - Runbindable = "runbindable", - Private = "private", - Rprivate = "rprivate", - Shared = "shared", - Rshared = "rshared", - Slave = "slave", - Rslave = "rslave", - Relatime = "relatime", - Norelatime = "norelatime", - Strictatime = "strictatime", - Nostrictatime = "nostrictatime", - Mode = "mode", - Uid = "uid", - Gid = "gid", - NrInodes = "nr_inodes", - NrBlocks = "nr_blocks", - Mpol = "mpol" + DEFAULTS = "defaults", + RO = "ro", + RW = "rw", + SUID = "suid", + NOSUID = "nosuid", + DEV = "dev", + NODEV = "nodev", + EXEC = "exec", + NOEXEC = "noexec", + SYNC = "sync", + ASYNC = "async", + DIRSYNC = "dirsync", + REMOUNT = "remount", + MAND = "mand", + NOMAND = "nomand", + ATIME = "atime", + NOATIME = "noatime", + DIRATIME = "diratime", + NODIRATIME = "nodiratime", + BIND = "bind", + RBIND = "rbind", + UNBINDABLE = "unbindable", + RUNBINDABLE = "runbindable", + PRIVATE = "private", + RPRIVATE = "rprivate", + SHARED = "shared", + RSHARED = "rshared", + SLAVE = "slave", + RSLAVE = "rslave", + RELATIME = "relatime", + NORELATIME = "norelatime", + STRICTATIME = "strictatime", + NOSTRICTATIME = "nostrictatime", + MODE = "mode", + UID = "uid", + GID = "gid", + NR_INODES = "nr_inodes", + NR_BLOCKS = "nr_blocks", + MPOL = "mpol" } diff --git a/packages/@aws-cdk/aws-ecs/lib/placement.ts b/packages/@aws-cdk/aws-ecs/lib/placement.ts index cacc8530de8fc..05477b89e5fba 100644 --- a/packages/@aws-cdk/aws-ecs/lib/placement.ts +++ b/packages/@aws-cdk/aws-ecs/lib/placement.ts @@ -8,12 +8,12 @@ export enum BinPackResource { /** * Fill up hosts' CPU allocations first */ - Cpu = 'cpu', + CPU = 'cpu', /** * Fill up hosts' memory allocations first */ - Memory = 'memory', + MEMORY = 'memory', } /** @@ -51,7 +51,7 @@ export class PlacementStrategy { * This ensures the total consumption of CPU is lowest */ public static packedByCpu() { - return PlacementStrategy.packedBy(BinPackResource.Cpu); + return PlacementStrategy.packedBy(BinPackResource.CPU); } /** @@ -60,7 +60,7 @@ export class PlacementStrategy { * This ensures the total consumption of memory is lowest */ public static packedByMemory() { - return PlacementStrategy.packedBy(BinPackResource.Memory); + return PlacementStrategy.packedBy(BinPackResource.MEMORY); } /** diff --git a/packages/@aws-cdk/aws-ecs/test/ec2/integ.lb-awsvpc-nw.ts b/packages/@aws-cdk/aws-ecs/test/ec2/integ.lb-awsvpc-nw.ts index c4dbf378c848f..993db77c86c9d 100644 --- a/packages/@aws-cdk/aws-ecs/test/ec2/integ.lb-awsvpc-nw.ts +++ b/packages/@aws-cdk/aws-ecs/test/ec2/integ.lb-awsvpc-nw.ts @@ -25,7 +25,7 @@ const container = taskDefinition.addContainer('web', { container.addPortMappings({ containerPort: 80, - protocol: ecs.Protocol.Tcp + protocol: ecs.Protocol.TCP }); const service = new ecs.Ec2Service(stack, "Service", { diff --git a/packages/@aws-cdk/aws-ecs/test/ec2/integ.lb-bridge-nw.ts b/packages/@aws-cdk/aws-ecs/test/ec2/integ.lb-bridge-nw.ts index c09cf9f14f1ee..7ee82b239b07d 100644 --- a/packages/@aws-cdk/aws-ecs/test/ec2/integ.lb-bridge-nw.ts +++ b/packages/@aws-cdk/aws-ecs/test/ec2/integ.lb-bridge-nw.ts @@ -27,7 +27,7 @@ const container = taskDefinition.addContainer('web', { container.addPortMappings({ containerPort: 80, hostPort: 8080, - protocol: ecs.Protocol.Tcp + protocol: ecs.Protocol.TCP }); const service = new ecs.Ec2Service(stack, "Service", { diff --git a/packages/@aws-cdk/aws-ecs/test/ec2/integ.sd-awsvpc-nw.ts b/packages/@aws-cdk/aws-ecs/test/ec2/integ.sd-awsvpc-nw.ts index 410e72a4d2dfa..acdc57a6f07af 100644 --- a/packages/@aws-cdk/aws-ecs/test/ec2/integ.sd-awsvpc-nw.ts +++ b/packages/@aws-cdk/aws-ecs/test/ec2/integ.sd-awsvpc-nw.ts @@ -33,7 +33,7 @@ const frontend = frontendTD.addContainer('frontend', { frontend.addPortMappings({ containerPort: 80, hostPort: 80, - protocol: ecs.Protocol.Tcp + protocol: ecs.Protocol.TCP }); new ecs.Ec2Service(stack, "FrontendService", { diff --git a/packages/@aws-cdk/aws-ecs/test/ec2/integ.sd-bridge-nw.ts b/packages/@aws-cdk/aws-ecs/test/ec2/integ.sd-bridge-nw.ts index 63aec63f1f896..fb5add39517f3 100644 --- a/packages/@aws-cdk/aws-ecs/test/ec2/integ.sd-bridge-nw.ts +++ b/packages/@aws-cdk/aws-ecs/test/ec2/integ.sd-bridge-nw.ts @@ -31,7 +31,7 @@ const frontend = frontendTD.addContainer('frontend', { frontend.addPortMappings({ containerPort: 80, hostPort: 80, - protocol: ecs.Protocol.Tcp + protocol: ecs.Protocol.TCP }); new ecs.Ec2Service(stack, "FrontendService", { 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 571ca2579cd0e..9c94f43dd0be2 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 @@ -221,7 +221,7 @@ export = { cluster, taskDefinition, vpcSubnets: { - subnetType: ec2.SubnetType.Public + subnetType: ec2.SubnetType.PUBLIC } }); }); @@ -327,7 +327,7 @@ export = { cluster, taskDefinition, vpcSubnets: { - subnetType: ec2.SubnetType.Public + subnetType: ec2.SubnetType.PUBLIC } }); @@ -529,7 +529,7 @@ export = { taskDefinition }); - service.placePackedBy(BinPackResource.Memory); + service.placePackedBy(BinPackResource.MEMORY); // THEN expect(stack).to(haveResource("AWS::ECS::Service", { @@ -563,7 +563,7 @@ export = { // THEN test.throws(() => { - service.placePackedBy(BinPackResource.Memory); + service.placePackedBy(BinPackResource.MEMORY); }); test.done(); @@ -683,7 +683,7 @@ export = { // WHEN cluster.addDefaultCloudMapNamespace({ name: 'foo.com', - type: NamespaceType.PrivateDns + type: NamespaceType.PRIVATE_DNS }); new ecs.Ec2Service(stack, 'Service', { @@ -760,7 +760,7 @@ export = { // WHEN cluster.addDefaultCloudMapNamespace({ name: 'foo.com', - type: NamespaceType.PrivateDns + type: NamespaceType.PRIVATE_DNS }); new ecs.Ec2Service(stack, 'Service', { @@ -871,7 +871,7 @@ export = { // WHEN cluster.addDefaultCloudMapNamespace({ name: 'foo.com', - type: NamespaceType.PrivateDns + type: NamespaceType.PRIVATE_DNS }); new ecs.Ec2Service(stack, 'Service', { @@ -946,7 +946,7 @@ export = { // WHEN cluster.addDefaultCloudMapNamespace({ name: 'foo.com', - type: NamespaceType.PrivateDns + type: NamespaceType.PRIVATE_DNS }); new ecs.Ec2Service(stack, 'Service', { diff --git a/packages/@aws-cdk/aws-ecs/test/ec2/test.ec2-task-definition.ts b/packages/@aws-cdk/aws-ecs/test/ec2/test.ec2-task-definition.ts index 51669be9b32a9..aa56762d8a96d 100644 --- a/packages/@aws-cdk/aws-ecs/test/ec2/test.ec2-task-definition.ts +++ b/packages/@aws-cdk/aws-ecs/test/ec2/test.ec2-task-definition.ts @@ -58,7 +58,7 @@ export = { container.addUlimits({ hardLimit: 128, - name: ecs.UlimitName.Rss, + name: ecs.UlimitName.RSS, softLimit: 128 }); @@ -75,7 +75,7 @@ export = { PortMappings: [{ ContainerPort: 3000, HostPort: 0, - Protocol: Protocol.Tcp + Protocol: Protocol.TCP }], Ulimits: [{ HardLimit: 128, diff --git a/packages/@aws-cdk/aws-ecs/test/fargate/integ.lb-awsvpc-nw.ts b/packages/@aws-cdk/aws-ecs/test/fargate/integ.lb-awsvpc-nw.ts index 17361f85235ff..c21f8c1072087 100644 --- a/packages/@aws-cdk/aws-ecs/test/fargate/integ.lb-awsvpc-nw.ts +++ b/packages/@aws-cdk/aws-ecs/test/fargate/integ.lb-awsvpc-nw.ts @@ -21,7 +21,7 @@ const container = taskDefinition.addContainer('web', { container.addPortMappings({ containerPort: 80, - protocol: ecs.Protocol.Tcp + protocol: ecs.Protocol.TCP }); const service = new ecs.FargateService(stack, "Service", { diff --git a/packages/@aws-cdk/aws-ecs/test/fargate/test.fargate-service.ts b/packages/@aws-cdk/aws-ecs/test/fargate/test.fargate-service.ts index d050d3b3f9987..18a1c6f58d888 100644 --- a/packages/@aws-cdk/aws-ecs/test/fargate/test.fargate-service.ts +++ b/packages/@aws-cdk/aws-ecs/test/fargate/test.fargate-service.ts @@ -361,7 +361,7 @@ export = { // WHEN cluster.addDefaultCloudMapNamespace({ name: 'foo.com', - type: NamespaceType.PrivateDns + type: NamespaceType.PRIVATE_DNS }); new ecs.FargateService(stack, 'Service', { @@ -421,7 +421,7 @@ export = { // WHEN cluster.addDefaultCloudMapNamespace({ name: 'foo.com', - type: NamespaceType.PrivateDns + type: NamespaceType.PRIVATE_DNS }); new ecs.FargateService(stack, 'Service', { diff --git a/packages/@aws-cdk/aws-ecs/test/test.aws-log-driver.ts b/packages/@aws-cdk/aws-ecs/test/test.aws-log-driver.ts index 159205c50d31b..9083c83276ecc 100644 --- a/packages/@aws-cdk/aws-ecs/test/test.aws-log-driver.ts +++ b/packages/@aws-cdk/aws-ecs/test/test.aws-log-driver.ts @@ -12,14 +12,14 @@ export = { // WHEN const driver = new ecs.AwsLogDriver(stack, 'Log', { datetimeFormat: 'format', - logRetentionDays: logs.RetentionDays.OneMonth, + logRetentionDays: logs.RetentionDays.ONE_MONTH, multilinePattern: 'pattern', streamPrefix: 'hello' }); // THEN expect(stack).to(haveResource('AWS::Logs::LogGroup', { - RetentionInDays: logs.RetentionDays.OneMonth + RetentionInDays: logs.RetentionDays.ONE_MONTH })); test.deepEqual( @@ -74,7 +74,7 @@ export = { // THEN test.throws(() => new ecs.AwsLogDriver(stack, 'Log', { logGroup, - logRetentionDays: logs.RetentionDays.FiveDays, + logRetentionDays: logs.RetentionDays.FIVE_DAYS, streamPrefix: 'hello' }), /`logGroup`.*`logRetentionDays`/); diff --git a/packages/@aws-cdk/aws-ecs/test/test.container-definition.ts b/packages/@aws-cdk/aws-ecs/test/test.container-definition.ts index e0661b909e510..c75f5aa7e8285 100644 --- a/packages/@aws-cdk/aws-ecs/test/test.container-definition.ts +++ b/packages/@aws-cdk/aws-ecs/test/test.container-definition.ts @@ -522,8 +522,8 @@ export = { sharedMemorySize: 1024, }); - linuxParameters.addCapabilities(ecs.Capability.All); - linuxParameters.dropCapabilities(ecs.Capability.Kill); + linuxParameters.addCapabilities(ecs.Capability.ALL); + linuxParameters.dropCapabilities(ecs.Capability.KILL); // WHEN taskDefinition.addContainer('cont', { @@ -564,7 +564,7 @@ export = { sharedMemorySize: 1024, }); - linuxParameters.addCapabilities(ecs.Capability.All); + linuxParameters.addCapabilities(ecs.Capability.ALL); // WHEN taskDefinition.addContainer('cont', { @@ -574,7 +574,7 @@ export = { }); // Mutate linuxParameter after added to a container - linuxParameters.dropCapabilities(ecs.Capability.Setuid); + linuxParameters.dropCapabilities(ecs.Capability.SETUID); // THEN expect(stack).to(haveResourceLike('AWS::ECS::TaskDefinition', { diff --git a/packages/@aws-cdk/aws-ecs/test/test.ecs-cluster.ts b/packages/@aws-cdk/aws-ecs/test/test.ecs-cluster.ts index 40ebfd0db6377..04333445f8ce1 100644 --- a/packages/@aws-cdk/aws-ecs/test/test.ecs-cluster.ts +++ b/packages/@aws-cdk/aws-ecs/test/test.ecs-cluster.ts @@ -26,7 +26,7 @@ export = { CidrBlock: '10.0.0.0/16', EnableDnsHostnames: true, EnableDnsSupport: true, - InstanceTenancy: ec2.DefaultInstanceTenancy.Default, + InstanceTenancy: ec2.DefaultInstanceTenancy.DEFAULT, Tags: [ { Key: "Name", @@ -228,7 +228,7 @@ export = { cluster.addCapacity('GpuAutoScalingGroup', { instanceType: new ec2.InstanceType('t2.micro'), machineImage: new ecs.EcsOptimizedAmi({ - hardwareType: ecs.AmiHardwareType.Gpu + hardwareType: ecs.AmiHardwareType.GPU }), }); @@ -254,8 +254,8 @@ export = { cluster.addCapacity('GpuAutoScalingGroup', { instanceType: new ec2.InstanceType('t2.micro'), machineImage: new ecs.EcsOptimizedAmi({ - generation: ec2.AmazonLinuxGeneration.AmazonLinux, - hardwareType: ecs.AmiHardwareType.Gpu, + generation: ec2.AmazonLinuxGeneration.AMAZON_LINUX, + hardwareType: ecs.AmiHardwareType.GPU, }), }); }); @@ -321,7 +321,7 @@ export = { // WHEN cluster.addDefaultCloudMapNamespace({ name: "foo.com", - type: ecs.NamespaceType.PublicDns + type: ecs.NamespaceType.PUBLIC_DNS }); // THEN @@ -381,7 +381,7 @@ export = { }); // THEN - test.equal(cluster2.defaultNamespace!.type, cloudmap.NamespaceType.DnsPrivate); + test.equal(cluster2.defaultNamespace!.type, cloudmap.NamespaceType.DNS_PRIVATE); test.deepEqual(stack2.resolve(cluster2.defaultNamespace!.namespaceId), 'import-namespace-id'); // Can retrieve subnets from VPC - will throw 'There are no 'Private' subnets in this VPC. Use a different VPC subnet selection.' if broken. diff --git a/packages/@aws-cdk/aws-eks/lib/ami.ts b/packages/@aws-cdk/aws-eks/lib/ami.ts index c7d4a868b6921..ba699b8300a8d 100644 --- a/packages/@aws-cdk/aws-eks/lib/ami.ts +++ b/packages/@aws-cdk/aws-eks/lib/ami.ts @@ -28,7 +28,7 @@ export class EksOptimizedAmi extends ec2.GenericLinuxImage implements ec2.IMachi if (!(version in EKS_AMI)) { throw new Error(`We don't have an AMI for kubernetes version ${version}`); } - super(EKS_AMI[version][props.nodeType || NodeType.Normal]); + super(EKS_AMI[version][props.nodeType || NodeType.NORMAL]); } } @@ -41,7 +41,7 @@ export enum NodeType { /** * Normal instances */ - Normal = 'Normal', + NORMAL = 'Normal', /** * GPU instances @@ -50,7 +50,7 @@ export enum NodeType { } export function nodeTypeForInstanceType(instanceType: ec2.InstanceType) { - return instanceType.toString().startsWith('p2') || instanceType.toString().startsWith('p3') ? NodeType.GPU : NodeType.Normal; + return instanceType.toString().startsWith('p2') || instanceType.toString().startsWith('p3') ? NodeType.GPU : NodeType.NORMAL; } /** @@ -119,6 +119,6 @@ function parseTable(contents: string): {[type: string]: {[region: string]: strin return { [NodeType.GPU]: gpuTable, - [NodeType.Normal]: normalTable + [NodeType.NORMAL]: normalTable }; } diff --git a/packages/@aws-cdk/aws-eks/lib/cluster.ts b/packages/@aws-cdk/aws-eks/lib/cluster.ts index 3b57e9c95e98e..edd6a267d9785 100644 --- a/packages/@aws-cdk/aws-eks/lib/cluster.ts +++ b/packages/@aws-cdk/aws-eks/lib/cluster.ts @@ -227,7 +227,7 @@ export class Cluster extends Resource implements ICluster { }); // Get subnetIds for all selected subnets - const placements = props.vpcSubnets || [{ subnetType: ec2.SubnetType.Public }, { subnetType: ec2.SubnetType.Private }]; + const placements = props.vpcSubnets || [{ subnetType: ec2.SubnetType.PUBLIC }, { subnetType: ec2.SubnetType.PRIVATE }]; const subnetIds = [...new Set(Array().concat(...placements.map(s => props.vpc.selectSubnets(s).subnetIds)))]; const resource = new CfnCluster(this, 'Resource', { @@ -272,7 +272,7 @@ export class Cluster extends Resource implements ICluster { nodeType: nodeTypeForInstanceType(options.instanceType), kubernetesVersion: this.version, }), - updateType: options.updateType || autoscaling.UpdateType.RollingUpdate, + updateType: options.updateType || autoscaling.UpdateType.ROLLING_UPDATE, instanceType: options.instanceType, }); diff --git a/packages/@aws-cdk/aws-eks/test/example.ssh-into-nodes.lit.ts b/packages/@aws-cdk/aws-eks/test/example.ssh-into-nodes.lit.ts index 5d3c275b9e88b..399981c515093 100644 --- a/packages/@aws-cdk/aws-eks/test/example.ssh-into-nodes.lit.ts +++ b/packages/@aws-cdk/aws-eks/test/example.ssh-into-nodes.lit.ts @@ -15,7 +15,7 @@ class EksClusterStack extends cdk.Stack { /// !show const asg = cluster.addCapacity('Nodes', { instanceType: new ec2.InstanceType('t2.medium'), - vpcSubnets: { subnetType: ec2.SubnetType.Public }, + vpcSubnets: { subnetType: ec2.SubnetType.PUBLIC }, keyName: 'my-key-name', }); diff --git a/packages/@aws-cdk/aws-elasticloadbalancing/lib/load-balancer.ts b/packages/@aws-cdk/aws-elasticloadbalancing/lib/load-balancer.ts index a868047bbc65e..fd33454bab454 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancing/lib/load-balancer.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancing/lib/load-balancer.ts @@ -192,10 +192,10 @@ export interface LoadBalancerListener { } export enum LoadBalancingProtocol { - Tcp = 'tcp', - Ssl = 'ssl', - Http = 'http', - Https = 'https' + TCP = 'tcp', + SSL = 'ssl', + HTTP = 'http', + HTTPS = 'https' } /** @@ -256,7 +256,7 @@ export class LoadBalancer extends Resource implements IConnectable { const instancePort = listener.internalPort || listener.externalPort; const instanceProtocol = ifUndefined(listener.internalProtocol, ifUndefined(tryWellKnownProtocol(instancePort), - isHttpProtocol(protocol) ? LoadBalancingProtocol.Http : LoadBalancingProtocol.Tcp)); + isHttpProtocol(protocol) ? LoadBalancingProtocol.HTTP : LoadBalancingProtocol.TCP)); this.listeners.push({ loadBalancerPort: listener.externalPort.toString(), @@ -391,13 +391,13 @@ function wellKnownProtocol(port: number): LoadBalancingProtocol { } function tryWellKnownProtocol(port: number): LoadBalancingProtocol | undefined { - if (port === 80) { return LoadBalancingProtocol.Http; } - if (port === 443) { return LoadBalancingProtocol.Https; } + if (port === 80) { return LoadBalancingProtocol.HTTP; } + if (port === 443) { return LoadBalancingProtocol.HTTPS; } return undefined; } function isHttpProtocol(proto: LoadBalancingProtocol): boolean { - return proto === LoadBalancingProtocol.Https || proto === LoadBalancingProtocol.Http; + return proto === LoadBalancingProtocol.HTTPS || proto === LoadBalancingProtocol.HTTP; } function ifUndefined(x: T | undefined, def: T): T { @@ -414,9 +414,9 @@ function ifUndefinedLazy(x: T | undefined, def: () => T): T { function healthCheckToJSON(healthCheck: HealthCheck): CfnLoadBalancer.HealthCheckProperty { const protocol = ifUndefined(healthCheck.protocol, ifUndefined(tryWellKnownProtocol(healthCheck.port), - LoadBalancingProtocol.Tcp)); + LoadBalancingProtocol.TCP)); - const path = protocol === LoadBalancingProtocol.Http || protocol === LoadBalancingProtocol.Https ? ifUndefined(healthCheck.path, "/") : ""; + const path = protocol === LoadBalancingProtocol.HTTP || protocol === LoadBalancingProtocol.HTTPS ? ifUndefined(healthCheck.path, "/") : ""; const target = `${protocol.toUpperCase()}:${healthCheck.port}${path}`; diff --git a/packages/@aws-cdk/aws-elasticloadbalancing/test/test.loadbalancer.ts b/packages/@aws-cdk/aws-elasticloadbalancing/test/test.loadbalancer.ts index e228d4bce9f35..63468e3938d34 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancing/test/test.loadbalancer.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancing/test/test.loadbalancer.ts @@ -13,9 +13,9 @@ export = { const lb = new LoadBalancer(stack, 'LB', { vpc }); lb.addListener({ - externalProtocol: LoadBalancingProtocol.Http, + externalProtocol: LoadBalancingProtocol.HTTP, externalPort: 8080, - internalProtocol: LoadBalancingProtocol.Http, + internalProtocol: LoadBalancingProtocol.HTTP, internalPort: 8080, }); @@ -42,7 +42,7 @@ export = { healthCheck: { interval: 60, path: '/ping', - protocol: LoadBalancingProtocol.Https, + protocol: LoadBalancingProtocol.HTTPS, port: 443, } }); @@ -70,7 +70,7 @@ export = { healthCheck: { interval: 60, path: '/ping', - protocol: LoadBalancingProtocol.Https, + protocol: LoadBalancingProtocol.HTTPS, port: 443, } }); diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/base-load-balancer.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/base-load-balancer.ts index 2d88265554d33..0f986b2cb502f 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/base-load-balancer.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/base-load-balancer.ts @@ -128,7 +128,7 @@ export abstract class BaseLoadBalancer extends Resource { const internetFacing = ifUndefined(baseProps.internetFacing, false); const vpcSubnets = ifUndefined(baseProps.vpcSubnets, - { subnetType: internetFacing ? ec2.SubnetType.Public : ec2.SubnetType.Private }); + { subnetType: internetFacing ? ec2.SubnetType.PUBLIC : ec2.SubnetType.PRIVATE }); const { subnetIds, internetConnectedDependency } = baseProps.vpc.selectSubnets(vpcSubnets); diff --git a/packages/@aws-cdk/aws-events-targets/lib/ecs-task.ts b/packages/@aws-cdk/aws-events-targets/lib/ecs-task.ts index 62fd51bb8f7cc..6b6d706b676a0 100644 --- a/packages/@aws-cdk/aws-events-targets/lib/ecs-task.ts +++ b/packages/@aws-cdk/aws-events-targets/lib/ecs-task.ts @@ -115,8 +115,8 @@ export class EcsTask implements events.IRuleTarget { // Use a custom resource to "enhance" the target with network configuration // when using awsvpc network mode. if (this.taskDefinition.networkMode === ecs.NetworkMode.AwsVpc) { - const subnetSelection = this.props.subnetSelection || { subnetType: ec2.SubnetType.Private }; - const assignPublicIp = subnetSelection.subnetType === ec2.SubnetType.Private ? 'DISABLED' : 'ENABLED'; + const subnetSelection = this.props.subnetSelection || { subnetType: ec2.SubnetType.PRIVATE }; + const assignPublicIp = subnetSelection.subnetType === ec2.SubnetType.PRIVATE ? 'DISABLED' : 'ENABLED'; new cloudformation.AwsCustomResource(this.taskDefinition, 'PutTargets', { // `onCreate´ defaults to `onUpdate` and we don't need an `onDelete` here diff --git a/packages/@aws-cdk/aws-events-targets/test/codepipeline/integ.pipeline-event-target.ts b/packages/@aws-cdk/aws-events-targets/test/codepipeline/integ.pipeline-event-target.ts index b9d5c4be4f03b..c9944cbe8d5b1 100644 --- a/packages/@aws-cdk/aws-events-targets/test/codepipeline/integ.pipeline-event-target.ts +++ b/packages/@aws-cdk/aws-events-targets/test/codepipeline/integ.pipeline-event-target.ts @@ -24,7 +24,7 @@ pipeline.addStage({ stageName: 'Source', actions: [new MockAction({ actionName: 'CodeCommit', - category: codepipeline.ActionCategory.Source, + category: codepipeline.ActionCategory.SOURCE, provider: 'CodeCommit', artifactBounds: { minInputs: 0, maxInputs: 0 , minOutputs: 1, maxOutputs: 1, }, configuration: { @@ -37,7 +37,7 @@ pipeline.addStage({ stageName: 'Build', actions: [new MockAction({ actionName: 'Hello', - category: codepipeline.ActionCategory.Approval, + category: codepipeline.ActionCategory.APPROVAL, provider: 'Manual', artifactBounds: { minInputs: 0, maxInputs: 0 , minOutputs: 0, maxOutputs: 0, }})] }); diff --git a/packages/@aws-cdk/aws-events-targets/test/codepipeline/pipeline.test.ts b/packages/@aws-cdk/aws-events-targets/test/codepipeline/pipeline.test.ts index 52126d994a8fe..639f7d1ad3e1a 100644 --- a/packages/@aws-cdk/aws-events-targets/test/codepipeline/pipeline.test.ts +++ b/packages/@aws-cdk/aws-events-targets/test/codepipeline/pipeline.test.ts @@ -15,7 +15,7 @@ test('use codebuild project as an eventrule target', () => { stageName: 'Source', actions: [new TestAction({ actionName: 'Hello', - category: codepipeline.ActionCategory.Source, + category: codepipeline.ActionCategory.SOURCE, provider: 'x', artifactBounds: { minInputs: 0, maxInputs: 0 , minOutputs: 1, maxOutputs: 1, }, outputs: [srcArtifact]})] @@ -24,7 +24,7 @@ test('use codebuild project as an eventrule target', () => { stageName: 'Build', actions: [new TestAction({ actionName: 'Hello', - category: codepipeline.ActionCategory.Build, + category: codepipeline.ActionCategory.BUILD, provider: 'y', inputs: [srcArtifact], outputs: [buildArtifact], diff --git a/packages/@aws-cdk/aws-glue/lib/table.ts b/packages/@aws-cdk/aws-glue/lib/table.ts index e9f877bf7593a..9135f89e91ca1 100644 --- a/packages/@aws-cdk/aws-glue/lib/table.ts +++ b/packages/@aws-cdk/aws-glue/lib/table.ts @@ -25,33 +25,33 @@ export interface ITable extends IResource { * @see https://docs.aws.amazon.com/athena/latest/ug/encryption.html */ export enum TableEncryption { - Unencrypted = 'Unencrypted', + UNENCRYPTED = 'Unencrypted', /** * Server side encryption (SSE) with an Amazon S3-managed key. * * @see https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html */ - S3Managed = 'SSE-S3', + S3_MANAGED = 'SSE-S3', /** * Server-side encryption (SSE) with an AWS KMS key managed by the account owner. * * @see https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html */ - Kms = 'SSE-KMS', + KMS = 'SSE-KMS', /** * Server-side encryption (SSE) with an AWS KMS key managed by the KMS service. */ - KmsManaged = 'SSE-KMS-MANAGED', + KMS_MANAGED = 'SSE-KMS-MANAGED', /** * Client-side encryption (CSE) with an AWS KMS key managed by the account owner. * * @see https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingClientSideEncryption.html */ - ClientSideKms = 'CSE-KMS' + CLIENT_SIDE_KMS = 'CSE-KMS' } export interface TableAttributes { @@ -260,7 +260,7 @@ export class Table extends Resource implements ITable { partitionKeys: renderColumns(props.partitionKeys), parameters: { - has_encrypted_data: this.encryption !== TableEncryption.Unencrypted + has_encrypted_data: this.encryption !== TableEncryption.UNENCRYPTED }, storageDescriptor: { location: `s3://${this.bucket.bucketName}/${this.s3Prefix}`, @@ -302,7 +302,7 @@ export class Table extends Resource implements ITable { */ public grantRead(grantee: iam.IGrantable): iam.Grant { const ret = this.grant(grantee, readPermissions); - if (this.encryptionKey && this.encryption === TableEncryption.ClientSideKms) { this.encryptionKey.grantDecrypt(grantee); } + if (this.encryptionKey && this.encryption === TableEncryption.CLIENT_SIDE_KMS) { this.encryptionKey.grantDecrypt(grantee); } this.bucket.grantRead(grantee, this.s3Prefix); return ret; } @@ -314,7 +314,7 @@ export class Table extends Resource implements ITable { */ public grantWrite(grantee: iam.IGrantable): iam.Grant { const ret = this.grant(grantee, writePermissions); - if (this.encryptionKey && this.encryption === TableEncryption.ClientSideKms) { this.encryptionKey.grantEncrypt(grantee); } + if (this.encryptionKey && this.encryption === TableEncryption.CLIENT_SIDE_KMS) { this.encryptionKey.grantEncrypt(grantee); } this.bucket.grantWrite(grantee, this.s3Prefix); return ret; } @@ -326,7 +326,7 @@ export class Table extends Resource implements ITable { */ public grantReadWrite(grantee: iam.IGrantable): iam.Grant { const ret = this.grant(grantee, [...readPermissions, ...writePermissions]); - if (this.encryptionKey && this.encryption === TableEncryption.ClientSideKms) { this.encryptionKey.grantEncryptDecrypt(grantee); } + if (this.encryptionKey && this.encryption === TableEncryption.CLIENT_SIDE_KMS) { this.encryptionKey.grantEncryptDecrypt(grantee); } this.bucket.grantReadWrite(grantee, this.s3Prefix); return ret; } @@ -356,24 +356,24 @@ function validateSchema(columns: Column[], partitionKeys?: Column[]): void { // map TableEncryption to bucket's SSE configuration (s3.BucketEncryption) const encryptionMappings = { - [TableEncryption.S3Managed]: s3.BucketEncryption.S3Managed, - [TableEncryption.KmsManaged]: s3.BucketEncryption.KmsManaged, - [TableEncryption.Kms]: s3.BucketEncryption.Kms, - [TableEncryption.ClientSideKms]: s3.BucketEncryption.Unencrypted, - [TableEncryption.Unencrypted]: s3.BucketEncryption.Unencrypted, + [TableEncryption.S3_MANAGED]: s3.BucketEncryption.S3_MANAGED, + [TableEncryption.KMS_MANAGED]: s3.BucketEncryption.KMS_MANAGED, + [TableEncryption.KMS]: s3.BucketEncryption.KMS, + [TableEncryption.CLIENT_SIDE_KMS]: s3.BucketEncryption.UNENCRYPTED, + [TableEncryption.UNENCRYPTED]: s3.BucketEncryption.UNENCRYPTED, }; // create the bucket to store a table's data depending on the `encryption` and `encryptionKey` properties. function createBucket(table: Table, props: TableProps) { - const encryption = props.encryption || TableEncryption.Unencrypted; + const encryption = props.encryption || TableEncryption.UNENCRYPTED; let bucket = props.bucket; - if (bucket && (encryption !== TableEncryption.Unencrypted && encryption !== TableEncryption.ClientSideKms)) { + if (bucket && (encryption !== TableEncryption.UNENCRYPTED && encryption !== TableEncryption.CLIENT_SIDE_KMS)) { throw new Error('you can not specify encryption settings if you also provide a bucket'); } let encryptionKey: kms.IKey | undefined; - if (encryption === TableEncryption.ClientSideKms && props.encryptionKey === undefined) { + if (encryption === TableEncryption.CLIENT_SIDE_KMS && props.encryptionKey === undefined) { // CSE-KMS should behave the same as SSE-KMS - use the provided key or create one automatically // Since Bucket only knows about SSE, we repeat the logic for CSE-KMS at the Table level. encryptionKey = new kms.Key(table, 'Key'); @@ -383,7 +383,7 @@ function createBucket(table: Table, props: TableProps) { // create the bucket if none was provided if (!bucket) { - if (encryption === TableEncryption.ClientSideKms) { + if (encryption === TableEncryption.CLIENT_SIDE_KMS) { bucket = new s3.Bucket(table, 'Bucket'); } else { bucket = new s3.Bucket(table, 'Bucket', { diff --git a/packages/@aws-cdk/aws-glue/test/integ.table.ts b/packages/@aws-cdk/aws-glue/test/integ.table.ts index f9ab375a7b46d..da6267689291c 100644 --- a/packages/@aws-cdk/aws-glue/test/integ.table.ts +++ b/packages/@aws-cdk/aws-glue/test/integ.table.ts @@ -70,7 +70,7 @@ const encryptedTable = new glue.Table(stack, 'MyEncryptedTable', { type: glue.Schema.smallint }], dataFormat: glue.DataFormat.Json, - encryption: glue.TableEncryption.Kms, + encryption: glue.TableEncryption.KMS, encryptionKey: new kms.Key(stack, 'MyKey') }); diff --git a/packages/@aws-cdk/aws-glue/test/test.table.ts b/packages/@aws-cdk/aws-glue/test/test.table.ts index fe1c7ebcab69d..f01be63f5d4de 100644 --- a/packages/@aws-cdk/aws-glue/test/test.table.ts +++ b/packages/@aws-cdk/aws-glue/test/test.table.ts @@ -24,7 +24,7 @@ export = { }], dataFormat: glue.DataFormat.Json, }); - test.equals(table.encryption, glue.TableEncryption.Unencrypted); + test.equals(table.encryption, glue.TableEncryption.UNENCRYPTED); expect(tableStack).to(haveResource('AWS::S3::Bucket', { Type: "AWS::S3::Bucket", @@ -99,7 +99,7 @@ export = { }], dataFormat: glue.DataFormat.Json, }); - test.equals(table.encryption, glue.TableEncryption.Unencrypted); + test.equals(table.encryption, glue.TableEncryption.UNENCRYPTED); test.equals(table.encryptionKey, undefined); test.equals(table.bucket.encryptionKey, undefined); @@ -236,10 +236,10 @@ export = { name: 'col', type: glue.Schema.string }], - encryption: glue.TableEncryption.S3Managed, + encryption: glue.TableEncryption.S3_MANAGED, dataFormat: glue.DataFormat.Json, }); - test.equals(table.encryption, glue.TableEncryption.S3Managed); + test.equals(table.encryption, glue.TableEncryption.S3_MANAGED); test.equals(table.encryptionKey, undefined); test.equals(table.bucket.encryptionKey, undefined); @@ -315,10 +315,10 @@ export = { name: 'col', type: glue.Schema.string }], - encryption: glue.TableEncryption.Kms, + encryption: glue.TableEncryption.KMS, dataFormat: glue.DataFormat.Json, }); - test.equals(table.encryption, glue.TableEncryption.Kms); + test.equals(table.encryption, glue.TableEncryption.KMS); test.equals(table.encryptionKey, table.bucket.encryptionKey); expect(stack).to(haveResource('AWS::KMS::Key', { @@ -445,11 +445,11 @@ export = { name: 'col', type: glue.Schema.string }], - encryption: glue.TableEncryption.Kms, + encryption: glue.TableEncryption.KMS, encryptionKey, dataFormat: glue.DataFormat.Json, }); - test.equals(table.encryption, glue.TableEncryption.Kms); + test.equals(table.encryption, glue.TableEncryption.KMS); test.equals(table.encryptionKey, table.bucket.encryptionKey); test.notEqual(table.encryptionKey, undefined); @@ -575,10 +575,10 @@ export = { name: 'col', type: glue.Schema.string }], - encryption: glue.TableEncryption.KmsManaged, + encryption: glue.TableEncryption.KMS_MANAGED, dataFormat: glue.DataFormat.Json, }); - test.equals(table.encryption, glue.TableEncryption.KmsManaged); + test.equals(table.encryption, glue.TableEncryption.KMS_MANAGED); test.equals(table.encryptionKey, undefined); test.equals(table.bucket.encryptionKey, undefined); @@ -654,10 +654,10 @@ export = { name: 'col', type: glue.Schema.string }], - encryption: glue.TableEncryption.ClientSideKms, + encryption: glue.TableEncryption.CLIENT_SIDE_KMS, dataFormat: glue.DataFormat.Json, }); - test.equals(table.encryption, glue.TableEncryption.ClientSideKms); + test.equals(table.encryption, glue.TableEncryption.CLIENT_SIDE_KMS); test.notEqual(table.encryptionKey, undefined); test.equals(table.bucket.encryptionKey, undefined); @@ -766,11 +766,11 @@ export = { name: 'col', type: glue.Schema.string }], - encryption: glue.TableEncryption.ClientSideKms, + encryption: glue.TableEncryption.CLIENT_SIDE_KMS, encryptionKey, dataFormat: glue.DataFormat.Json, }); - test.equals(table.encryption, glue.TableEncryption.ClientSideKms); + test.equals(table.encryption, glue.TableEncryption.CLIENT_SIDE_KMS); test.notEqual(table.encryptionKey, undefined); test.equals(table.bucket.encryptionKey, undefined); @@ -881,11 +881,11 @@ export = { type: glue.Schema.string }], bucket, - encryption: glue.TableEncryption.ClientSideKms, + encryption: glue.TableEncryption.CLIENT_SIDE_KMS, encryptionKey, dataFormat: glue.DataFormat.Json, }); - test.equals(table.encryption, glue.TableEncryption.ClientSideKms); + test.equals(table.encryption, glue.TableEncryption.CLIENT_SIDE_KMS); test.notEqual(table.encryptionKey, undefined); test.equals(table.bucket.encryptionKey, undefined); @@ -1447,7 +1447,7 @@ export = { type: glue.Schema.string }], bucket: new s3.Bucket(new cdk.Stack(), 'Bucket'), - encryption: glue.TableEncryption.Kms + encryption: glue.TableEncryption.KMS }), undefined, 'you can not specify encryption settings if you also provide a bucket'); test.done(); }, @@ -1486,7 +1486,7 @@ export = { type: glue.Schema.string }], bucket: new s3.Bucket(new cdk.Stack(), 'Bucket'), - encryption: glue.TableEncryption.ClientSideKms + encryption: glue.TableEncryption.CLIENT_SIDE_KMS })); test.done(); } diff --git a/packages/@aws-cdk/aws-iam/lib/policy-statement.ts b/packages/@aws-cdk/aws-iam/lib/policy-statement.ts index 376d3c37fa6e5..ec3f58e5d8864 100644 --- a/packages/@aws-cdk/aws-iam/lib/policy-statement.ts +++ b/packages/@aws-cdk/aws-iam/lib/policy-statement.ts @@ -19,7 +19,7 @@ export class PolicyStatement { private condition: { [key: string]: any } = { }; constructor(props: PolicyStatementProps = {}) { - this.effect = Effect.Allow; + this.effect = Effect.ALLOW; this.addActions(...props.actions || []); this.addPrincipals(...props.principals || []); @@ -214,8 +214,8 @@ export class PolicyStatement { } export enum Effect { - Allow = 'Allow', - Deny = 'Deny', + ALLOW = 'Allow', + DENY = 'Deny', } /** diff --git a/packages/@aws-cdk/aws-iam/test/test.policy-document.ts b/packages/@aws-cdk/aws-iam/test/test.policy-document.ts index d2f3965a9eeb3..7da37983c8221 100644 --- a/packages/@aws-cdk/aws-iam/test/test.policy-document.ts +++ b/packages/@aws-cdk/aws-iam/test/test.policy-document.ts @@ -45,7 +45,7 @@ export = { p1.addResources('*'); const p2 = new PolicyStatement(); - p2.effect = Effect.Deny; + p2.effect = Effect.DENY; p2.addActions('cloudformation:CreateStack'); doc.addStatements(p1); diff --git a/packages/@aws-cdk/aws-kinesis/lib/stream.ts b/packages/@aws-cdk/aws-kinesis/lib/stream.ts index 274917f6a9eb8..329b6324eec23 100644 --- a/packages/@aws-cdk/aws-kinesis/lib/stream.ts +++ b/packages/@aws-cdk/aws-kinesis/lib/stream.ts @@ -287,18 +287,18 @@ export class Stream extends StreamBase { } { // default to unencrypted. - const encryptionType = props.encryption || StreamEncryption.Unencrypted; + const encryptionType = props.encryption || StreamEncryption.UNENCRYPTED; // if encryption key is set, encryption must be set to KMS. - if (encryptionType !== StreamEncryption.Kms && props.encryptionKey) { + if (encryptionType !== StreamEncryption.KMS && props.encryptionKey) { throw new Error(`encryptionKey is specified, so 'encryption' must be set to KMS (value: ${encryptionType})`); } - if (encryptionType === StreamEncryption.Unencrypted) { + if (encryptionType === StreamEncryption.UNENCRYPTED) { return { streamEncryption: undefined, encryptionKey: undefined }; } - if (encryptionType === StreamEncryption.Kms) { + if (encryptionType === StreamEncryption.KMS) { const encryptionKey = props.encryptionKey || new kms.Key(this, 'Key', { description: `Created by ${this.node.path}` }); @@ -321,11 +321,11 @@ export enum StreamEncryption { /** * Records in the stream are not encrypted. */ - Unencrypted = 'NONE', + UNENCRYPTED = 'NONE', /** * Server-side encryption with a KMS key managed by the user. * If `encryptionKey` is specified, this key will be used, otherwise, one will be defined. */ - Kms = 'KMS', + KMS = 'KMS', } diff --git a/packages/@aws-cdk/aws-kinesis/test/test.stream.ts b/packages/@aws-cdk/aws-kinesis/test/test.stream.ts index 14d8261b86eeb..c784c27de1e02 100644 --- a/packages/@aws-cdk/aws-kinesis/test/test.stream.ts +++ b/packages/@aws-cdk/aws-kinesis/test/test.stream.ts @@ -107,7 +107,7 @@ export = { const stack = new Stack(); new Stream(stack, 'MyStream', { - encryption: StreamEncryption.Kms + encryption: StreamEncryption.KMS }); expect(stack).toMatch({ @@ -189,7 +189,7 @@ export = { }); new Stream(stack, 'MyStream', { - encryption: StreamEncryption.Kms, + encryption: StreamEncryption.KMS, encryptionKey: explicitKey }); @@ -269,7 +269,7 @@ export = { "grantRead creates and attaches a policy with read only access to Stream and EncryptionKey"(test: Test) { const stack = new Stack(); const stream = new Stream(stack, 'MyStream', { - encryption: StreamEncryption.Kms + encryption: StreamEncryption.KMS }); const user = new iam.User(stack, "MyUser"); @@ -405,7 +405,7 @@ export = { "grantWrite creates and attaches a policy with write only access to Stream and EncryptionKey"(test: Test) { const stack = new Stack(); const stream = new Stream(stack, 'MyStream', { - encryption: StreamEncryption.Kms + encryption: StreamEncryption.KMS }); const user = new iam.User(stack, "MyUser"); @@ -549,7 +549,7 @@ export = { "grantReadWrite creates and attaches a policy with access to Stream and EncryptionKey"(test: Test) { const stack = new Stack(); const stream = new Stream(stack, 'MyStream', { - encryption: StreamEncryption.Kms + encryption: StreamEncryption.KMS }); const user = new iam.User(stack, "MyUser"); @@ -938,7 +938,7 @@ export = { const app = new App(); const stackA = new Stack(app, 'stackA'); const streamFromStackA = new Stream(stackA, 'MyStream', { - encryption: StreamEncryption.Kms + encryption: StreamEncryption.KMS }); const stackB = new Stack(app, 'stackB'); diff --git a/packages/@aws-cdk/aws-lambda-event-sources/test/integ.dynamodb.ts b/packages/@aws-cdk/aws-lambda-event-sources/test/integ.dynamodb.ts index 2c9379dc60acf..6069440dd7014 100644 --- a/packages/@aws-cdk/aws-lambda-event-sources/test/integ.dynamodb.ts +++ b/packages/@aws-cdk/aws-lambda-event-sources/test/integ.dynamodb.ts @@ -12,14 +12,14 @@ class DynamoEventSourceTest extends cdk.Stack { const queue = new dynamodb.Table(this, 'T', { partitionKey: { name: 'id', - type: dynamodb.AttributeType.String + type: dynamodb.AttributeType.STRING }, - stream: dynamodb.StreamViewType.NewImage + stream: dynamodb.StreamViewType.NEW_IMAGE }); fn.addEventSource(new DynamoEventSource(queue, { batchSize: 5, - startingPosition: lambda.StartingPosition.TrimHorizon + startingPosition: lambda.StartingPosition.TRIM_HORIZON })); } } diff --git a/packages/@aws-cdk/aws-lambda-event-sources/test/integ.kinesis.ts b/packages/@aws-cdk/aws-lambda-event-sources/test/integ.kinesis.ts index 56ade188b85ce..f4670fe3e341f 100644 --- a/packages/@aws-cdk/aws-lambda-event-sources/test/integ.kinesis.ts +++ b/packages/@aws-cdk/aws-lambda-event-sources/test/integ.kinesis.ts @@ -12,7 +12,7 @@ class KinesisEventSourceTest extends cdk.Stack { const stream = new kinesis.Stream(this, 'Q'); fn.addEventSource(new KinesisEventSource(stream, { - startingPosition: lambda.StartingPosition.TrimHorizon + startingPosition: lambda.StartingPosition.TRIM_HORIZON })); } } diff --git a/packages/@aws-cdk/aws-lambda-event-sources/test/integ.s3.ts b/packages/@aws-cdk/aws-lambda-event-sources/test/integ.s3.ts index 15cf4291712cd..013d6a959b419 100644 --- a/packages/@aws-cdk/aws-lambda-event-sources/test/integ.s3.ts +++ b/packages/@aws-cdk/aws-lambda-event-sources/test/integ.s3.ts @@ -13,7 +13,7 @@ class S3EventSourceTest extends cdk.Stack { }); fn.addEventSource(new S3EventSource(bucket, { - events: [ s3.EventType.ObjectCreated ], + events: [ s3.EventType.OBJECT_CREATED ], filters: [ { prefix: 'subdir/' } ] })); } diff --git a/packages/@aws-cdk/aws-lambda-event-sources/test/test.dynamo.ts b/packages/@aws-cdk/aws-lambda-event-sources/test/test.dynamo.ts index 90afc443559a5..e51cbf01d32d9 100644 --- a/packages/@aws-cdk/aws-lambda-event-sources/test/test.dynamo.ts +++ b/packages/@aws-cdk/aws-lambda-event-sources/test/test.dynamo.ts @@ -16,14 +16,14 @@ export = { const table = new dynamodb.Table(stack, 'T', { partitionKey: { name: 'id', - type: dynamodb.AttributeType.String + type: dynamodb.AttributeType.STRING }, - stream: dynamodb.StreamViewType.NewImage + stream: dynamodb.StreamViewType.NEW_IMAGE }); // WHEN fn.addEventSource(new sources.DynamoEventSource(table, { - startingPosition: lambda.StartingPosition.TrimHorizon + startingPosition: lambda.StartingPosition.TRIM_HORIZON })); // THEN @@ -82,15 +82,15 @@ export = { const table = new dynamodb.Table(stack, 'T', { partitionKey: { name: 'id', - type: dynamodb.AttributeType.String + type: dynamodb.AttributeType.STRING }, - stream: dynamodb.StreamViewType.NewImage + stream: dynamodb.StreamViewType.NEW_IMAGE }); // WHEN fn.addEventSource(new sources.DynamoEventSource(table, { batchSize: 50, - startingPosition: lambda.StartingPosition.Latest + startingPosition: lambda.StartingPosition.LATEST })); // THEN @@ -118,15 +118,15 @@ export = { const table = new dynamodb.Table(stack, 'T', { partitionKey: { name: 'id', - type: dynamodb.AttributeType.String + type: dynamodb.AttributeType.STRING }, - stream: dynamodb.StreamViewType.NewImage + stream: dynamodb.StreamViewType.NEW_IMAGE }); // WHEN test.throws(() => fn.addEventSource(new sources.DynamoEventSource(table, { batchSize: 0, - startingPosition: lambda.StartingPosition.Latest + startingPosition: lambda.StartingPosition.LATEST })), /Maximum batch size must be between 1 and 1000 inclusive \(given 0\)/); test.done(); @@ -139,15 +139,15 @@ export = { const table = new dynamodb.Table(stack, 'T', { partitionKey: { name: 'id', - type: dynamodb.AttributeType.String + type: dynamodb.AttributeType.STRING }, - stream: dynamodb.StreamViewType.NewImage + stream: dynamodb.StreamViewType.NEW_IMAGE }); // WHEN test.throws(() => fn.addEventSource(new sources.DynamoEventSource(table, { batchSize: 1001, - startingPosition: lambda.StartingPosition.Latest + startingPosition: lambda.StartingPosition.LATEST })), /Maximum batch size must be between 1 and 1000 inclusive \(given 1001\)/); test.done(); diff --git a/packages/@aws-cdk/aws-lambda-event-sources/test/test.kinesis.ts b/packages/@aws-cdk/aws-lambda-event-sources/test/test.kinesis.ts index b9f95f6522f4a..d28e90f4daabb 100644 --- a/packages/@aws-cdk/aws-lambda-event-sources/test/test.kinesis.ts +++ b/packages/@aws-cdk/aws-lambda-event-sources/test/test.kinesis.ts @@ -17,7 +17,7 @@ export = { // WHEN fn.addEventSource(new sources.KinesisEventSource(stream, { - startingPosition: lambda.StartingPosition.TrimHorizon + startingPosition: lambda.StartingPosition.TRIM_HORIZON })); // THEN @@ -73,7 +73,7 @@ export = { // WHEN fn.addEventSource(new sources.KinesisEventSource(stream, { batchSize: 50, - startingPosition: lambda.StartingPosition.Latest + startingPosition: lambda.StartingPosition.LATEST })); // THEN @@ -103,7 +103,7 @@ export = { // WHEN test.throws(() => fn.addEventSource(new sources.KinesisEventSource(stream, { batchSize: 0, - startingPosition: lambda.StartingPosition.Latest + startingPosition: lambda.StartingPosition.LATEST })), /Maximum batch size must be between 1 and 10000 inclusive \(given 0\)/); test.done(); @@ -118,7 +118,7 @@ export = { // WHEN test.throws(() => fn.addEventSource(new sources.KinesisEventSource(stream, { batchSize: 10001, - startingPosition: lambda.StartingPosition.Latest + startingPosition: lambda.StartingPosition.LATEST })), /Maximum batch size must be between 1 and 10000 inclusive \(given 10001\)/); test.done(); diff --git a/packages/@aws-cdk/aws-lambda-event-sources/test/test.s3.ts b/packages/@aws-cdk/aws-lambda-event-sources/test/test.s3.ts index ef0a192ac618b..e8c11a5aa1999 100644 --- a/packages/@aws-cdk/aws-lambda-event-sources/test/test.s3.ts +++ b/packages/@aws-cdk/aws-lambda-event-sources/test/test.s3.ts @@ -16,7 +16,7 @@ export = { // WHEN fn.addEventSource(new sources.S3EventSource(bucket, { - events: [ s3.EventType.ObjectCreated, s3.EventType.ObjectRemoved ], + events: [ s3.EventType.OBJECT_CREATED, s3.EventType.OBJECT_REMOVED ], filters: [ { prefix: 'prefix/' }, { suffix: '.png' } diff --git a/packages/@aws-cdk/aws-lambda/lib/event-source-mapping.ts b/packages/@aws-cdk/aws-lambda/lib/event-source-mapping.ts index cd71bfa79fb99..25d7e2312843b 100644 --- a/packages/@aws-cdk/aws-lambda/lib/event-source-mapping.ts +++ b/packages/@aws-cdk/aws-lambda/lib/event-source-mapping.ts @@ -82,11 +82,11 @@ export enum StartingPosition { * Start reading at the last untrimmed record in the shard in the system, * which is the oldest data record in the shard. */ - TrimHorizon = 'TRIM_HORIZON', + TRIM_HORIZON = 'TRIM_HORIZON', /** * Start reading just after the most recent record in the shard, so that you * always read the most recent data in the shard */ - Latest = 'LATEST', + LATEST = 'LATEST', } diff --git a/packages/@aws-cdk/aws-lambda/lib/function.ts b/packages/@aws-cdk/aws-lambda/lib/function.ts index ee981704eae02..0d43a451e565c 100644 --- a/packages/@aws-cdk/aws-lambda/lib/function.ts +++ b/packages/@aws-cdk/aws-lambda/lib/function.ts @@ -21,16 +21,16 @@ export enum Tracing { * Lambda will respect any tracing header it receives from an upstream service. * If no tracing header is received, Lambda will call X-Ray for a tracing decision. */ - Active, + ACTIVE = "Active", /** * Lambda will only trace the request from an upstream service * if it contains a tracing header with "sampled=1" */ - PassThrough, + PASS_THROUGH = "PassThrough", /** * Lambda will not trace any request. */ - Disabled + DISABLED = "Disabled" } export interface FunctionProps { @@ -611,7 +611,7 @@ export class Function extends FunctionBase { } private buildTracingConfig(props: FunctionProps) { - if (props.tracing === undefined || props.tracing === Tracing.Disabled) { + if (props.tracing === undefined || props.tracing === Tracing.DISABLED) { return undefined; } @@ -621,7 +621,7 @@ export class Function extends FunctionBase { })); return { - mode: Tracing[props.tracing] + mode: props.tracing }; } } diff --git a/packages/@aws-cdk/aws-lambda/lib/runtime.ts b/packages/@aws-cdk/aws-lambda/lib/runtime.ts index 14c311d32595a..2c613c9f665bc 100644 --- a/packages/@aws-cdk/aws-lambda/lib/runtime.ts +++ b/packages/@aws-cdk/aws-lambda/lib/runtime.ts @@ -8,12 +8,12 @@ export interface LambdaRuntimeProps { export enum RuntimeFamily { NodeJS, - Java, - Python, - DotNetCore, - Go, - Ruby, - Other + JAVA, + PYTHON, + DOTNET_CORE, + GO, + RUBY, + OTHER } /** @@ -34,17 +34,17 @@ export class Runtime { 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.DotNetCore); + 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); /** @deprecated Use `DotNetCore21` */ - public static readonly DotNetCore2 = new Runtime('dotnetcore2.0', RuntimeFamily.DotNetCore); - public static readonly DotNetCore21 = new Runtime('dotnetcore2.1', RuntimeFamily.DotNetCore); - 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 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); /** * The name of this runtime, as expected by the Lambda resource. 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 9f2e60e68e79f..a994520a8bd7c 100644 --- a/packages/@aws-cdk/aws-lambda/test/integ.log-retention.ts +++ b/packages/@aws-cdk/aws-lambda/test/integ.log-retention.ts @@ -10,21 +10,21 @@ new lambda.Function(stack, 'OneWeek', { code: new lambda.InlineCode('exports.handler = (event) => console.log(JSON.stringify(event));'), handler: 'index.handler', runtime: lambda.Runtime.Nodejs810, - logRetentionDays: logs.RetentionDays.OneWeek + logRetentionDays: 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, - logRetentionDays: logs.RetentionDays.OneMonth + logRetentionDays: 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, - logRetentionDays: logs.RetentionDays.OneYear + logRetentionDays: logs.RetentionDays.ONE_YEAR }); app.synth(); diff --git a/packages/@aws-cdk/aws-lambda/test/test.lambda.ts b/packages/@aws-cdk/aws-lambda/test/test.lambda.ts index b31aba438f817..e5daf941aa100 100644 --- a/packages/@aws-cdk/aws-lambda/test/test.lambda.ts +++ b/packages/@aws-cdk/aws-lambda/test/test.lambda.ts @@ -823,7 +823,7 @@ export = { code: new lambda.InlineCode('foo'), handler: 'index.handler', runtime: lambda.Runtime.Nodejs810, - tracing: lambda.Tracing.Active + tracing: lambda.Tracing.ACTIVE }); expect(stack).to(haveResource('AWS::IAM::Policy', { @@ -881,7 +881,7 @@ export = { code: new lambda.InlineCode('foo'), handler: 'index.handler', runtime: lambda.Runtime.Nodejs810, - tracing: lambda.Tracing.PassThrough + tracing: lambda.Tracing.PASS_THROUGH }); expect(stack).to(haveResource('AWS::IAM::Policy', { @@ -939,7 +939,7 @@ export = { code: new lambda.InlineCode('foo'), handler: 'index.handler', runtime: lambda.Runtime.Nodejs810, - tracing: lambda.Tracing.Disabled + tracing: lambda.Tracing.DISABLED }); expect(stack).notTo(haveResource('AWS::IAM::Policy', { @@ -1323,7 +1323,7 @@ export = { code: new lambda.InlineCode('foo'), handler: 'index.handler', runtime: lambda.Runtime.Nodejs, - logRetentionDays: logs.RetentionDays.OneMonth + logRetentionDays: logs.RetentionDays.ONE_MONTH }); // THEN diff --git a/packages/@aws-cdk/aws-lambda/test/test.log-retention.ts b/packages/@aws-cdk/aws-lambda/test/test.log-retention.ts index 7cfacdbd3a638..3a514bff744f7 100644 --- a/packages/@aws-cdk/aws-lambda/test/test.log-retention.ts +++ b/packages/@aws-cdk/aws-lambda/test/test.log-retention.ts @@ -14,7 +14,7 @@ export = { // WHEN new LogRetention(stack, 'MyLambda', { logGroupName: 'group', - retentionDays: logs.RetentionDays.OneMonth + retentionDays: logs.RetentionDays.ONE_MONTH }); // THEN diff --git a/packages/@aws-cdk/aws-lambda/test/test.runtime.ts b/packages/@aws-cdk/aws-lambda/test/test.runtime.ts index a943810c1e88d..c24c06f261fd9 100644 --- a/packages/@aws-cdk/aws-lambda/test/test.runtime.ts +++ b/packages/@aws-cdk/aws-lambda/test/test.runtime.ts @@ -5,8 +5,8 @@ import lambda = require('../lib'); export = testCase({ 'runtimes are equal for different instances'(test: Test) { // GIVEN - const runtime1 = new lambda.Runtime('python3.7', RuntimeFamily.Python, {supportsInlineCode: true}); - const runtime2 = new lambda.Runtime('python3.7', RuntimeFamily.Python, {supportsInlineCode: true}); + const runtime1 = new lambda.Runtime('python3.7', RuntimeFamily.PYTHON, {supportsInlineCode: true}); + const runtime2 = new lambda.Runtime('python3.7', RuntimeFamily.PYTHON, {supportsInlineCode: true}); // WHEN const result = runtime1.runtimeEquals(runtime2); @@ -18,7 +18,7 @@ export = testCase({ }, 'runtimes are equal for same instance'(test: Test) { // GIVEN - const runtime = new lambda.Runtime('python3.7', RuntimeFamily.Python, {supportsInlineCode: true}); + const runtime = new lambda.Runtime('python3.7', RuntimeFamily.PYTHON, {supportsInlineCode: true}); // WHEN const result = runtime.runtimeEquals(runtime); @@ -30,8 +30,8 @@ export = testCase({ }, 'unequal when name changes'(test: Test) { // GIVEN - const runtime1 = new lambda.Runtime('python3.7', RuntimeFamily.Python, {supportsInlineCode: true}); - const runtime2 = new lambda.Runtime('python3.6', RuntimeFamily.Python, {supportsInlineCode: true}); + const runtime1 = new lambda.Runtime('python3.7', RuntimeFamily.PYTHON, {supportsInlineCode: true}); + const runtime2 = new lambda.Runtime('python3.6', RuntimeFamily.PYTHON, {supportsInlineCode: true}); // WHEN const result = runtime1.runtimeEquals(runtime2); @@ -43,8 +43,8 @@ export = testCase({ }, 'unequal when family changes'(test: Test) { // GIVEN - const runtime1 = new lambda.Runtime('python3.7', RuntimeFamily.Python, {supportsInlineCode: true}); - const runtime2 = new lambda.Runtime('python3.7', RuntimeFamily.Java, {supportsInlineCode: true}); + const runtime1 = new lambda.Runtime('python3.7', RuntimeFamily.PYTHON, {supportsInlineCode: true}); + const runtime2 = new lambda.Runtime('python3.7', RuntimeFamily.JAVA, {supportsInlineCode: true}); // WHEN const result = runtime1.runtimeEquals(runtime2); @@ -56,8 +56,8 @@ export = testCase({ }, 'unequal when supportsInlineCode changes'(test: Test) { // GIVEN - const runtime1 = new lambda.Runtime('python3.7', RuntimeFamily.Python, {supportsInlineCode: true}); - const runtime2 = new lambda.Runtime('python3.7', RuntimeFamily.Python, {supportsInlineCode: false}); + const runtime1 = new lambda.Runtime('python3.7', RuntimeFamily.PYTHON, {supportsInlineCode: true}); + const runtime2 = new lambda.Runtime('python3.7', RuntimeFamily.PYTHON, {supportsInlineCode: false}); // WHEN const result = runtime1.runtimeEquals(runtime2); 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 b96ef156bf1c6..511209cffbd99 100644 --- a/packages/@aws-cdk/aws-lambda/test/test.vpc-lambda.ts +++ b/packages/@aws-cdk/aws-lambda/test/test.vpc-lambda.ts @@ -151,7 +151,7 @@ export = { handler: 'index.handler', runtime: lambda.Runtime.Nodejs810, vpc, - vpcSubnets: { subnetType: ec2.SubnetType.Public } + vpcSubnets: { subnetType: ec2.SubnetType.PUBLIC } }); }); diff --git a/packages/@aws-cdk/aws-logs/lib/log-group.ts b/packages/@aws-cdk/aws-logs/lib/log-group.ts index aeed9fa6c956d..2fae3647099b7 100644 --- a/packages/@aws-cdk/aws-logs/lib/log-group.ts +++ b/packages/@aws-cdk/aws-logs/lib/log-group.ts @@ -179,87 +179,87 @@ export enum RetentionDays { /** * 1 day */ - OneDay = 1, + ONE_DAY = 1, /** * 3 days */ - ThreeDays = 3, + THREE_DAYS = 3, /** * 5 days */ - FiveDays = 5, + FIVE_DAYS = 5, /** * 1 week */ - OneWeek = 7, + ONE_WEEK = 7, /** * 2 weeks */ - TwoWeeks = 14, + TWO_WEEKS = 14, /** * 1 month */ - OneMonth = 30, + ONE_MONTH = 30, /** * 2 months */ - TwoMonths = 60, + TWO_MONTHS = 60, /** * 3 months */ - ThreeMonths = 90, + THREE_MONTHS = 90, /** * 4 months */ - FourMonths = 120, + FOUR_MONTHS = 120, /** * 5 months */ - FiveMonths = 150, + FIVE_MONTHS = 150, /** * 6 months */ - SixMonths = 180, + SIX_MONTHS = 180, /** * 1 year */ - OneYear = 365, + ONE_YEAR = 365, /** * 13 months */ - ThirteenMonths = 400, + THIRTEEN_MONTHS = 400, /** * 18 months */ - EighteenMonths = 545, + EIGHTEEN_MONTHS = 545, /** * 2 years */ - TwoYears = 731, + TWO_YEARS = 731, /** * 5 years */ - FiveYears = 1827, + FIVE_YEARS = 1827, /** * 10 years */ - TenYears = 3653 + TEN_YEARS = 3653 } /** @@ -327,7 +327,7 @@ export class LogGroup extends LogGroupBase { }); let retentionInDays = props.retentionDays; - if (retentionInDays === undefined) { retentionInDays = RetentionDays.TwoYears; } + if (retentionInDays === undefined) { retentionInDays = RetentionDays.TWO_YEARS; } if (retentionInDays === Infinity) { retentionInDays = undefined; } if (retentionInDays !== undefined && retentionInDays <= 0) { diff --git a/packages/@aws-cdk/aws-logs/test/example.retention.lit.ts b/packages/@aws-cdk/aws-logs/test/example.retention.lit.ts index ed0fd084e18d4..69b8b8a39f813 100644 --- a/packages/@aws-cdk/aws-logs/test/example.retention.lit.ts +++ b/packages/@aws-cdk/aws-logs/test/example.retention.lit.ts @@ -7,7 +7,7 @@ function shortLogGroup() { /// !show // Configure log group for short retention const logGroup = new LogGroup(stack, 'LogGroup', { - retentionDays: RetentionDays.OneWeek + retentionDays: RetentionDays.ONE_WEEK }); /// !hide return logGroup; diff --git a/packages/@aws-cdk/aws-logs/test/test.loggroup.ts b/packages/@aws-cdk/aws-logs/test/test.loggroup.ts index f1be0c5a64ecd..947d50e2e4268 100644 --- a/packages/@aws-cdk/aws-logs/test/test.loggroup.ts +++ b/packages/@aws-cdk/aws-logs/test/test.loggroup.ts @@ -11,7 +11,7 @@ export = { // WHEN new LogGroup(stack, 'LogGroup', { - retentionDays: RetentionDays.OneWeek + retentionDays: RetentionDays.ONE_WEEK }); // THEN diff --git a/packages/@aws-cdk/aws-rds/lib/cluster.ts b/packages/@aws-cdk/aws-rds/lib/cluster.ts index e8ea4034692b1..9339efffff502 100644 --- a/packages/@aws-cdk/aws-rds/lib/cluster.ts +++ b/packages/@aws-cdk/aws-rds/lib/cluster.ts @@ -174,7 +174,7 @@ abstract class DatabaseClusterBase extends Resource implements IDatabaseCluster public asSecretAttachmentTarget(): secretsmanager.SecretAttachmentTargetProps { return { targetId: this.clusterIdentifier, - targetType: secretsmanager.AttachmentTargetType.Cluster + targetType: secretsmanager.AttachmentTargetType.CLUSTER }; } } @@ -352,7 +352,7 @@ export class DatabaseCluster extends DatabaseClusterBase { props.clusterIdentifier != null ? `${props.clusterIdentifier}instance${instanceIndex}` : undefined; - const publiclyAccessible = props.instanceProps.vpcSubnets && props.instanceProps.vpcSubnets.subnetType === ec2.SubnetType.Public; + const publiclyAccessible = props.instanceProps.vpcSubnets && props.instanceProps.vpcSubnets.subnetType === ec2.SubnetType.PUBLIC; const instance = new CfnDBInstance(this, `Instance${instanceIndex}`, { // Link to cluster diff --git a/packages/@aws-cdk/aws-rds/lib/instance.ts b/packages/@aws-cdk/aws-rds/lib/instance.ts index fc157f19a4065..d5cbcd66d6af5 100644 --- a/packages/@aws-cdk/aws-rds/lib/instance.ts +++ b/packages/@aws-cdk/aws-rds/lib/instance.ts @@ -144,7 +144,7 @@ export abstract class DatabaseInstanceBase extends Resource implements IDatabase public asSecretAttachmentTarget(): secretsmanager.SecretAttachmentTargetProps { return { targetId: this.instanceIdentifier, - targetType: secretsmanager.AttachmentTargetType.Instance + targetType: secretsmanager.AttachmentTargetType.INSTANCE }; } } @@ -174,17 +174,17 @@ export enum LicenseModel { /** * License included. */ - LicenseIncluded = 'license-included', + LICENSE_INCLUDED = 'license-included', /** * Bring your own licencse. */ - BringYourOwnLicense = 'bring-your-own-license', + BRING_YOUR_OWN_LICENSE = 'bring-your-own-license', /** * General public license. */ - GeneralPublicLicense = 'general-public-license' + GENERAL_PUBLIC_LICENSE = 'general-public-license' } /** @@ -209,7 +209,7 @@ export enum StorageType { /** * Standard. */ - Standard = 'standard', + STANDARD = 'standard', /** * General purpose (SSD). @@ -229,12 +229,12 @@ export enum PerformanceInsightRetentionPeriod { /** * Default retention period of 7 days. */ - Default = 7, + DEFAULT = 7, /** * Long term retention period of 2 years. */ - LongTerm = 731 + LONG_TERM = 731 } /** @@ -520,13 +520,13 @@ abstract class DatabaseInstanceNew extends DatabaseInstanceBase implements IData ? props.performanceInsightKmsKey && props.performanceInsightKmsKey.keyArn : undefined, performanceInsightsRetentionPeriod: props.enablePerformanceInsights - ? (props.performanceInsightRetentionPeriod || PerformanceInsightRetentionPeriod.Default) + ? (props.performanceInsightRetentionPeriod || PerformanceInsightRetentionPeriod.DEFAULT) : undefined, port: props.port ? props.port.toString() : undefined, preferredBackupWindow: props.preferredBackupWindow, preferredMaintenanceWindow: props.preferredMaintenanceWindow, processorFeatures: props.processorFeatures && renderProcessorFeatures(props.processorFeatures), - publiclyAccessible: props.vpcPlacement && props.vpcPlacement.subnetType === ec2.SubnetType.Public, + publiclyAccessible: props.vpcPlacement && props.vpcPlacement.subnetType === ec2.SubnetType.PUBLIC, storageType, vpcSecurityGroups: [this.securityGroupId] }; 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 f9713e93f2f68..0dc1764e3024c 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 @@ -14,7 +14,7 @@ const cluster = new rds.DatabaseCluster(stack, 'Database', { username: 'admin' }, instanceProps: { - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.Burstable2, ec2.InstanceSize.Small), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL), vpc } }); diff --git a/packages/@aws-cdk/aws-rds/test/integ.cluster.ts b/packages/@aws-cdk/aws-rds/test/integ.cluster.ts index 50e0ea3c51f72..04c2468e91eae 100644 --- a/packages/@aws-cdk/aws-rds/test/integ.cluster.ts +++ b/packages/@aws-cdk/aws-rds/test/integ.cluster.ts @@ -26,8 +26,8 @@ const cluster = new DatabaseCluster(stack, 'Database', { password: SecretValue.plainText('7959866cacc02c2d243ecfe177464fe6'), }, instanceProps: { - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.Burstable2, ec2.InstanceSize.Small), - vpcSubnets: { subnetType: ec2.SubnetType.Public }, + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL), + vpcSubnets: { subnetType: ec2.SubnetType.PUBLIC }, vpc }, parameterGroup: params, 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 463dbc41f0685..9cdc4a129362b 100644 --- a/packages/@aws-cdk/aws-rds/test/integ.instance.lit.ts +++ b/packages/@aws-cdk/aws-rds/test/integ.instance.lit.ts @@ -45,8 +45,8 @@ class DatabaseInstanceStack extends cdk.Stack { // Database instance with production values const instance = new rds.DatabaseInstance(this, 'Instance', { engine: rds.DatabaseInstanceEngine.OracleSE1, - licenseModel: rds.LicenseModel.BringYourOwnLicense, - instanceClass: new ec2.InstanceTypePair(ec2.InstanceClass.Burstable2, ec2.InstanceSize.Medium), + licenseModel: rds.LicenseModel.BRING_YOUR_OWN_LICENSE, + instanceClass: new ec2.InstanceTypePair(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.MEDIUM), multiAz: true, storageType: rds.StorageType.IO1, masterUsername: 'syscdk', @@ -62,7 +62,7 @@ class DatabaseInstanceStack extends cdk.Stack { 'alert', 'listener' ], - cloudwatchLogsRetention: logs.RetentionDays.OneMonth, + cloudwatchLogsRetention: logs.RetentionDays.ONE_MONTH, autoMinorVersionUpgrade: false, optionGroup, parameterGroup diff --git a/packages/@aws-cdk/aws-rds/test/test.cluster.ts b/packages/@aws-cdk/aws-rds/test/test.cluster.ts index a56b720228e54..0d69e4c6ca341 100644 --- a/packages/@aws-cdk/aws-rds/test/test.cluster.ts +++ b/packages/@aws-cdk/aws-rds/test/test.cluster.ts @@ -20,7 +20,7 @@ export = { password: SecretValue.plainText('tooshort'), }, instanceProps: { - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.Burstable2, ec2.InstanceSize.Small), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL), vpc } }); @@ -59,7 +59,7 @@ export = { password: SecretValue.plainText('tooshort'), }, instanceProps: { - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.Burstable2, ec2.InstanceSize.Small), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL), vpc } }); @@ -93,7 +93,7 @@ export = { password: SecretValue.plainText('tooshort'), }, instanceProps: { - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.Burstable2, ec2.InstanceSize.Small), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL), vpc, securityGroup: sg } @@ -131,7 +131,7 @@ export = { password: SecretValue.plainText('tooshort'), }, instanceProps: { - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.Burstable2, ec2.InstanceSize.Small), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL), vpc }, parameterGroup: group @@ -157,7 +157,7 @@ export = { username: 'admin' }, instanceProps: { - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.Burstable2, ec2.InstanceSize.Small), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL), vpc } }); @@ -214,7 +214,7 @@ export = { username: 'admin' }, instanceProps: { - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.Burstable2, ec2.InstanceSize.Small), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL), vpc }, kmsKey: new kms.Key(stack, 'Key') @@ -251,7 +251,7 @@ export = { username: 'admin', }, instanceProps: { - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.Burstable2, ec2.InstanceSize.Small), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL), parameterGroup, vpc } @@ -280,7 +280,7 @@ export = { username: 'admin' }, instanceProps: { - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.Burstable2, ec2.InstanceSize.Small), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL), vpc }, }); @@ -307,7 +307,7 @@ export = { username: 'admin' }, instanceProps: { - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.Burstable2, ec2.InstanceSize.Small), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL), vpc }, }); diff --git a/packages/@aws-cdk/aws-rds/test/test.instance.ts b/packages/@aws-cdk/aws-rds/test/test.instance.ts index 0567d2f641744..4cc35da44ca7a 100644 --- a/packages/@aws-cdk/aws-rds/test/test.instance.ts +++ b/packages/@aws-cdk/aws-rds/test/test.instance.ts @@ -16,8 +16,8 @@ export = { // WHEN new rds.DatabaseInstance(stack, 'Instance', { engine: rds.DatabaseInstanceEngine.OracleSE1, - licenseModel: rds.LicenseModel.BringYourOwnLicense, - instanceClass: new ec2.InstanceTypePair(ec2.InstanceClass.Burstable2, ec2.InstanceSize.Medium), + licenseModel: rds.LicenseModel.BRING_YOUR_OWN_LICENSE, + instanceClass: new ec2.InstanceTypePair(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.MEDIUM), multiAz: true, storageType: rds.StorageType.IO1, masterUsername: 'syscdk', @@ -33,7 +33,7 @@ export = { 'alert', 'listener' ], - cloudwatchLogsRetention: logs.RetentionDays.OneMonth, + cloudwatchLogsRetention: logs.RetentionDays.ONE_MONTH, autoMinorVersionUpgrade: false, }); @@ -208,7 +208,7 @@ export = { // WHEN new rds.DatabaseInstance(stack, 'Database', { engine: rds.DatabaseInstanceEngine.SqlServerEE, - instanceClass: new ec2.InstanceTypePair(ec2.InstanceClass.Burstable2, ec2.InstanceSize.Small), + instanceClass: new ec2.InstanceTypePair(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL), masterUsername: 'syscdk', masterUserPassword: cdk.SecretValue.plainText('tooshort'), vpc, @@ -237,7 +237,7 @@ export = { new rds.DatabaseInstanceFromSnapshot(stack, 'Instance', { snapshotIdentifier: 'my-snapshot', engine: rds.DatabaseInstanceEngine.Postgres, - instanceClass: new ec2.InstanceTypePair(ec2.InstanceClass.Burstable2, ec2.InstanceSize.Large), + instanceClass: new ec2.InstanceTypePair(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.LARGE), vpc }); @@ -257,7 +257,7 @@ export = { test.throws(() => new rds.DatabaseInstanceFromSnapshot(stack, 'Instance', { snapshotIdentifier: 'my-snapshot', engine: rds.DatabaseInstanceEngine.Mysql, - instanceClass: new ec2.InstanceTypePair(ec2.InstanceClass.Burstable2, ec2.InstanceSize.Large), + instanceClass: new ec2.InstanceTypePair(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.LARGE), vpc, generateMasterUserPassword: true, }), /`masterUsername`.*`generateMasterUserPassword`/); @@ -271,7 +271,7 @@ export = { const vpc = new ec2.Vpc(stack, 'VPC'); const sourceInstance = new rds.DatabaseInstance(stack, 'Instance', { engine: rds.DatabaseInstanceEngine.Mysql, - instanceClass: new ec2.InstanceTypePair(ec2.InstanceClass.Burstable2, ec2.InstanceSize.Small), + instanceClass: new ec2.InstanceTypePair(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL), masterUsername: 'admin', vpc }); @@ -280,7 +280,7 @@ export = { new rds.DatabaseInstanceReadReplica(stack, 'ReadReplica', { sourceDatabaseInstance: sourceInstance, engine: rds.DatabaseInstanceEngine.Mysql, - instanceClass: new ec2.InstanceTypePair(ec2.InstanceClass.Burstable2, ec2.InstanceSize.Large), + instanceClass: new ec2.InstanceTypePair(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.LARGE), vpc }); @@ -300,7 +300,7 @@ export = { const vpc = new ec2.Vpc(stack, 'VPC'); const instance = new rds.DatabaseInstance(stack, 'Instance', { engine: rds.DatabaseInstanceEngine.Mysql, - instanceClass: new ec2.InstanceTypePair(ec2.InstanceClass.Burstable2, ec2.InstanceSize.Small), + instanceClass: new ec2.InstanceTypePair(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL), masterUsername: 'admin', vpc }); @@ -367,7 +367,7 @@ export = { const vpc = new ec2.Vpc(stack, 'VPC'); const instance = new rds.DatabaseInstance(stack, 'Instance', { engine: rds.DatabaseInstanceEngine.Mysql, - instanceClass: new ec2.InstanceTypePair(ec2.InstanceClass.Burstable2, ec2.InstanceSize.Small), + instanceClass: new ec2.InstanceTypePair(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL), masterUsername: 'admin', vpc }); @@ -420,7 +420,7 @@ export = { // WHEN const instance = new rds.DatabaseInstance(stack, 'Instance', { engine: rds.DatabaseInstanceEngine.Mysql, - instanceClass: new ec2.InstanceTypePair(ec2.InstanceClass.Burstable2, ec2.InstanceSize.Small), + instanceClass: new ec2.InstanceTypePair(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL), masterUsername: 'admin', vpc }); @@ -445,7 +445,7 @@ export = { // WHEN const instance = new rds.DatabaseInstance(stack, 'Instance', { engine: rds.DatabaseInstanceEngine.Mysql, - instanceClass: new ec2.InstanceTypePair(ec2.InstanceClass.Burstable2, ec2.InstanceSize.Small), + instanceClass: new ec2.InstanceTypePair(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL), masterUsername: 'admin', vpc }); @@ -476,7 +476,7 @@ export = { // WHEN new rds.DatabaseInstance(stack, 'Instance', { engine: rds.DatabaseInstanceEngine.Mysql, - instanceClass: new ec2.InstanceTypePair(ec2.InstanceClass.Burstable2, ec2.InstanceSize.Small), + instanceClass: new ec2.InstanceTypePair(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL), masterUsername: 'admin', vpc, backupRetentionPeriod: 0, 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 ecf4e761c2b10..6678d9338b409 100644 --- a/packages/@aws-cdk/aws-rds/test/test.secret-rotation.ts +++ b/packages/@aws-cdk/aws-rds/test/test.secret-rotation.ts @@ -20,7 +20,7 @@ export = { username: 'admin' }, instanceProps: { - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.Burstable2, ec2.InstanceSize.Small), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL), vpc } }); @@ -168,7 +168,7 @@ export = { password: SecretValue.plainText('tooshort') }, instanceProps: { - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.Burstable2, ec2.InstanceSize.Small), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL), vpc } }); @@ -210,7 +210,7 @@ export = { const vpc = new ec2.Vpc(stack, 'VPC'); const instance = new rds.DatabaseInstance(stack, 'Database', { engine: rds.DatabaseInstanceEngine.MariaDb, - instanceClass: new ec2.InstanceTypePair(ec2.InstanceClass.Burstable2, ec2.InstanceSize.Small), + instanceClass: new ec2.InstanceTypePair(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL), masterUsername: 'syscdk', vpc }); @@ -353,7 +353,7 @@ export = { // WHEN const instance = new rds.DatabaseInstance(stack, 'Database', { engine: rds.DatabaseInstanceEngine.SqlServerEE, - instanceClass: new ec2.InstanceTypePair(ec2.InstanceClass.Burstable2, ec2.InstanceSize.Small), + instanceClass: new ec2.InstanceTypePair(ec2.InstanceClass.BURSTABLE2, ec2.InstanceSize.SMALL), masterUsername: 'syscdk', masterUserPassword: SecretValue.plainText('tooshort'), vpc diff --git a/packages/@aws-cdk/aws-s3-notifications/lib/lambda.ts b/packages/@aws-cdk/aws-s3-notifications/lib/lambda.ts index 27ef63893f0fe..d308a24dd1056 100644 --- a/packages/@aws-cdk/aws-s3-notifications/lib/lambda.ts +++ b/packages/@aws-cdk/aws-s3-notifications/lib/lambda.ts @@ -26,7 +26,7 @@ export class LambdaDestination implements s3.IBucketNotificationDestination { const permission = this.fn.node.findChild(permissionId) as CfnResource; return { - type: s3.BucketNotificationDestinationType.Lambda, + type: s3.BucketNotificationDestinationType.LAMBDA, arn: this.fn.functionArn, dependencies: permission ? [ permission ] : undefined }; diff --git a/packages/@aws-cdk/aws-s3-notifications/lib/sns.ts b/packages/@aws-cdk/aws-s3-notifications/lib/sns.ts index 81a5bce07234b..a49a15de14ded 100644 --- a/packages/@aws-cdk/aws-s3-notifications/lib/sns.ts +++ b/packages/@aws-cdk/aws-s3-notifications/lib/sns.ts @@ -22,7 +22,7 @@ export class SnsDestination implements s3.IBucketNotificationDestination { return { arn: this.topic.topicArn, - type: s3.BucketNotificationDestinationType.Topic, + type: s3.BucketNotificationDestinationType.TOPIC, dependencies: [ this.topic ] // make sure the topic policy resource is created before the notification config }; } diff --git a/packages/@aws-cdk/aws-s3-notifications/lib/sqs.ts b/packages/@aws-cdk/aws-s3-notifications/lib/sqs.ts index 19de8e6ab7db7..48b2a83c0c360 100644 --- a/packages/@aws-cdk/aws-s3-notifications/lib/sqs.ts +++ b/packages/@aws-cdk/aws-s3-notifications/lib/sqs.ts @@ -33,7 +33,7 @@ export class SqsDestination implements s3.IBucketNotificationDestination { return { arn: this.queue.queueArn, - type: s3.BucketNotificationDestinationType.Queue, + type: s3.BucketNotificationDestinationType.QUEUE, dependencies: [ this.queue ] }; } diff --git a/packages/@aws-cdk/aws-s3-notifications/test/integ.notifications.ts b/packages/@aws-cdk/aws-s3-notifications/test/integ.notifications.ts index 8b6199d400c0d..c22c94adb1461 100644 --- a/packages/@aws-cdk/aws-s3-notifications/test/integ.notifications.ts +++ b/packages/@aws-cdk/aws-s3-notifications/test/integ.notifications.ts @@ -14,8 +14,8 @@ const bucket = new s3.Bucket(stack, 'Bucket', { const topic = new sns.Topic(stack, 'Topic'); const topic3 = new sns.Topic(stack, 'Topic3'); -bucket.addEventNotification(s3.EventType.ObjectCreatedPut, new s3n.SnsDestination(topic)); -bucket.addEventNotification(s3.EventType.ObjectRemoved, new s3n.SnsDestination(topic3), { prefix: 'home/myusername/' }); +bucket.addEventNotification(s3.EventType.OBJECT_CREATED_PUT, new s3n.SnsDestination(topic)); +bucket.addEventNotification(s3.EventType.OBJECT_REMOVED, new s3n.SnsDestination(topic3), { prefix: 'home/myusername/' }); const bucket2 = new s3.Bucket(stack, 'Bucket2', { removalPolicy: cdk.RemovalPolicy.Destroy 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 90e8a1d8be2e5..6579cd7c9822d 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 @@ -22,7 +22,7 @@ const bucketB = new s3.Bucket(stack, 'YourBucket', { }); bucketA.addObjectCreatedNotification(new s3n.LambdaDestination(fn), { suffix: '.png' }); -bucketB.addEventNotification(s3.EventType.ObjectRemoved, new s3n.LambdaDestination(fn)); +bucketB.addEventNotification(s3.EventType.OBJECT_REMOVED, new s3n.LambdaDestination(fn)); app.synth(); diff --git a/packages/@aws-cdk/aws-s3-notifications/test/notifications.test.ts b/packages/@aws-cdk/aws-s3-notifications/test/notifications.test.ts index 9dd6b4c793305..ddfcec88f7206 100644 --- a/packages/@aws-cdk/aws-s3-notifications/test/notifications.test.ts +++ b/packages/@aws-cdk/aws-s3-notifications/test/notifications.test.ts @@ -30,7 +30,7 @@ test('when notification are added, a custom resource is provisioned + a lambda h const bucket = new s3.Bucket(stack, 'MyBucket'); const topic = new sns.Topic(stack, 'MyTopic'); - bucket.addEventNotification(s3.EventType.ObjectCreated, new s3n.SnsDestination(topic)); + bucket.addEventNotification(s3.EventType.OBJECT_CREATED, new s3n.SnsDestination(topic)); expect(stack).toHaveResource('AWS::S3::Bucket'); expect(stack).toHaveResource('AWS::Lambda::Function', { Description: 'AWS CloudFormation handler for "Custom::S3BucketNotifications" resources (@aws-cdk/aws-s3)' }); @@ -45,7 +45,7 @@ test('when notification are added, you can tag the lambda', () => { const topic = new sns.Topic(stack, 'MyTopic'); - bucket.addEventNotification(s3.EventType.ObjectCreated, new s3n.SnsDestination(topic)); + bucket.addEventNotification(s3.EventType.OBJECT_CREATED, new s3n.SnsDestination(topic)); expect(stack).toHaveResource('AWS::S3::Bucket'); expect(stack).toHaveResource('AWS::Lambda::Function', { @@ -106,27 +106,27 @@ test('subscription types', () => { const queueTarget: s3.IBucketNotificationDestination = { bind: _ => ({ - type: s3.BucketNotificationDestinationType.Queue, + type: s3.BucketNotificationDestinationType.QUEUE, arn: 'arn:aws:sqs:...' }) }; const lambdaTarget: s3.IBucketNotificationDestination = { bind: _ => ({ - type: s3.BucketNotificationDestinationType.Lambda, + type: s3.BucketNotificationDestinationType.LAMBDA, arn: 'arn:aws:lambda:...' }) }; const topicTarget: s3.IBucketNotificationDestination = { bind: _ => ({ - type: s3.BucketNotificationDestinationType.Topic, + type: s3.BucketNotificationDestinationType.TOPIC, arn: 'arn:aws:sns:...' }) }; - bucket.addEventNotification(s3.EventType.ObjectCreated, queueTarget); - bucket.addEventNotification(s3.EventType.ObjectCreated, lambdaTarget); + bucket.addEventNotification(s3.EventType.OBJECT_CREATED, queueTarget); + bucket.addEventNotification(s3.EventType.OBJECT_CREATED, lambdaTarget); bucket.addObjectRemovedNotification(topicTarget, { prefix: 'prefix' }); expect(stack).toHaveResource('Custom::S3BucketNotifications', { @@ -183,16 +183,16 @@ test('multiple subscriptions of the same type', () => { const bucket = new s3.Bucket(stack, 'TestBucket'); - bucket.addEventNotification(s3.EventType.ObjectRemovedDelete, { + bucket.addEventNotification(s3.EventType.OBJECT_REMOVED_DELETE, { bind: _ => ({ - type: s3.BucketNotificationDestinationType.Queue, + type: s3.BucketNotificationDestinationType.QUEUE, arn: 'arn:aws:sqs:...:queue1' }) }); - bucket.addEventNotification(s3.EventType.ObjectRemovedDelete, { + bucket.addEventNotification(s3.EventType.OBJECT_REMOVED_DELETE, { bind: _ => ({ - type: s3.BucketNotificationDestinationType.Queue, + type: s3.BucketNotificationDestinationType.QUEUE, arn: 'arn:aws:sqs:...:queue2' }) }); @@ -232,11 +232,11 @@ test('prefix/suffix filters', () => { const bucket = new s3.Bucket(stack, 'TestBucket'); const bucketNotificationTarget = { - type: s3.BucketNotificationDestinationType.Queue, + type: s3.BucketNotificationDestinationType.QUEUE, arn: 'arn:aws:sqs:...' }; - bucket.addEventNotification(s3.EventType.ObjectRemovedDelete, { bind: _ => bucketNotificationTarget }, { prefix: 'images/', suffix: '.jpg' }); + bucket.addEventNotification(s3.EventType.OBJECT_REMOVED_DELETE, { bind: _ => bucketNotificationTarget }, { prefix: 'images/', suffix: '.jpg' }); expect(stack).toHaveResource('Custom::S3BucketNotifications', { "ServiceToken": { @@ -283,7 +283,7 @@ test('a notification destination can specify a set of dependencies that must be const dest: s3.IBucketNotificationDestination = { bind: () => ({ arn: 'arn', - type: s3.BucketNotificationDestinationType.Queue, + type: s3.BucketNotificationDestinationType.QUEUE, dependencies: [ dependent ] }) }; diff --git a/packages/@aws-cdk/aws-s3-notifications/test/queue.test.ts b/packages/@aws-cdk/aws-s3-notifications/test/queue.test.ts index 977cc00c5f7fb..24a6b4094e5d5 100644 --- a/packages/@aws-cdk/aws-s3-notifications/test/queue.test.ts +++ b/packages/@aws-cdk/aws-s3-notifications/test/queue.test.ts @@ -75,7 +75,7 @@ test('queues can be used as destinations', () => { test('if the queue is encrypted with a custom kms key, the key resource policy is updated to allow s3 to read messages', () => { const stack = new Stack(); const bucket = new s3.Bucket(stack, 'Bucket'); - const queue = new sqs.Queue(stack, 'Queue', { encryption: sqs.QueueEncryption.Kms }); + const queue = new sqs.Queue(stack, 'Queue', { encryption: sqs.QueueEncryption.KMS }); bucket.addObjectCreatedNotification(new notif.SqsDestination(queue)); @@ -142,7 +142,7 @@ test('if the queue is encrypted with a custom kms key, the key resource policy i test('fails if trying to subscribe to a queue with managed kms encryption', () => { const stack = new Stack(); - const queue = new sqs.Queue(stack, 'Queue', { encryption: sqs.QueueEncryption.KmsManaged }); + const queue = new sqs.Queue(stack, 'Queue', { encryption: sqs.QueueEncryption.KMS_MANAGED }); const bucket = new s3.Bucket(stack, 'Bucket'); expect(() => { bucket.addObjectRemovedNotification(new notif.SqsDestination(queue)); diff --git a/packages/@aws-cdk/aws-s3-notifications/test/sqs/integ.bucket-notifications.ts b/packages/@aws-cdk/aws-s3-notifications/test/sqs/integ.bucket-notifications.ts index ce0dec65408bd..257d84c99bd65 100644 --- a/packages/@aws-cdk/aws-s3-notifications/test/sqs/integ.bucket-notifications.ts +++ b/packages/@aws-cdk/aws-s3-notifications/test/sqs/integ.bucket-notifications.ts @@ -19,7 +19,7 @@ const bucket2 = new s3.Bucket(stack, 'Bucket2', { }); bucket2.addObjectCreatedNotification(new s3n.SqsDestination(queue), { suffix: '.png' }); -const encryptedQueue = new sqs.Queue(stack, 'EncryptedQueue', { encryption: sqs.QueueEncryption.Kms }); +const encryptedQueue = new sqs.Queue(stack, 'EncryptedQueue', { encryption: sqs.QueueEncryption.KMS }); bucket1.addObjectRemovedNotification(new s3n.SqsDestination(encryptedQueue)); app.synth(); diff --git a/packages/@aws-cdk/aws-s3/lib/bucket.ts b/packages/@aws-cdk/aws-s3/lib/bucket.ts index 79ad4318fe811..fb79be37d2713 100644 --- a/packages/@aws-cdk/aws-s3/lib/bucket.ts +++ b/packages/@aws-cdk/aws-s3/lib/bucket.ts @@ -1010,7 +1010,7 @@ export class Bucket extends BucketBase { * @param filters Filters (see onEvent) */ public addObjectCreatedNotification(dest: IBucketNotificationDestination, ...filters: NotificationKeyFilter[]) { - return this.addEventNotification(EventType.ObjectCreated, dest, ...filters); + return this.addEventNotification(EventType.OBJECT_CREATED, dest, ...filters); } /** @@ -1022,7 +1022,7 @@ export class Bucket extends BucketBase { * @param filters Filters (see onEvent) */ public addObjectRemovedNotification(dest: IBucketNotificationDestination, ...filters: NotificationKeyFilter[]) { - return this.addEventNotification(EventType.ObjectRemoved, dest, ...filters); + return this.addEventNotification(EventType.OBJECT_REMOVED, dest, ...filters); } private validateBucketName(physicalName: PhysicalName): void { @@ -1078,19 +1078,19 @@ export class Bucket extends BucketBase { // default based on whether encryptionKey is specified let encryptionType = props.encryption; if (encryptionType === undefined) { - encryptionType = props.encryptionKey ? BucketEncryption.Kms : BucketEncryption.Unencrypted; + encryptionType = props.encryptionKey ? BucketEncryption.KMS : BucketEncryption.UNENCRYPTED; } // if encryption key is set, encryption must be set to KMS. - if (encryptionType !== BucketEncryption.Kms && props.encryptionKey) { + if (encryptionType !== BucketEncryption.KMS && props.encryptionKey) { throw new Error(`encryptionKey is specified, so 'encryption' must be set to KMS (value: ${encryptionType})`); } - if (encryptionType === BucketEncryption.Unencrypted) { + if (encryptionType === BucketEncryption.UNENCRYPTED) { return { bucketEncryption: undefined, encryptionKey: undefined }; } - if (encryptionType === BucketEncryption.Kms) { + if (encryptionType === BucketEncryption.KMS) { const encryptionKey = props.encryptionKey || new kms.Key(this, 'Key', { description: `Created by ${this.node.path}` }); @@ -1108,7 +1108,7 @@ export class Bucket extends BucketBase { return { encryptionKey, bucketEncryption }; } - if (encryptionType === BucketEncryption.S3Managed) { + if (encryptionType === BucketEncryption.S3_MANAGED) { const bucketEncryption = { serverSideEncryptionConfiguration: [ { serverSideEncryptionByDefault: { sseAlgorithm: 'AES256' } } @@ -1118,7 +1118,7 @@ export class Bucket extends BucketBase { return { bucketEncryption }; } - if (encryptionType === BucketEncryption.KmsManaged) { + if (encryptionType === BucketEncryption.KMS_MANAGED) { const bucketEncryption = { serverSideEncryptionConfiguration: [ { serverSideEncryptionByDefault: { sseAlgorithm: 'aws:kms' } } @@ -1242,23 +1242,23 @@ export enum BucketEncryption { /** * Objects in the bucket are not encrypted. */ - Unencrypted = 'NONE', + UNENCRYPTED = 'NONE', /** * Server-side KMS encryption with a master key managed by KMS. */ - KmsManaged = 'MANAGED', + KMS_MANAGED = 'MANAGED', /** * Server-side encryption with a master key managed by S3. */ - S3Managed = 'S3MANAGED', + S3_MANAGED = 'S3MANAGED', /** * Server-side encryption with a KMS key managed by the user. * If `encryptionKey` is specified, this key will be used, otherwise, one will be defined. */ - Kms = 'KMS', + KMS = 'KMS', } /** @@ -1272,7 +1272,7 @@ export enum EventType { * request notification regardless of the API that was used to create an * object. */ - ObjectCreated = 's3:ObjectCreated:*', + OBJECT_CREATED = 's3:ObjectCreated:*', /** * Amazon S3 APIs such as PUT, POST, and COPY can create an object. Using @@ -1281,7 +1281,7 @@ export enum EventType { * request notification regardless of the API that was used to create an * object. */ - ObjectCreatedPut = 's3:ObjectCreated:Put', + OBJECT_CREATED_PUT = 's3:ObjectCreated:Put', /** * Amazon S3 APIs such as PUT, POST, and COPY can create an object. Using @@ -1290,7 +1290,7 @@ export enum EventType { * request notification regardless of the API that was used to create an * object. */ - ObjectCreatedPost = 's3:ObjectCreated:Post', + OBJECT_CREATED_POST = 's3:ObjectCreated:Post', /** * Amazon S3 APIs such as PUT, POST, and COPY can create an object. Using @@ -1299,7 +1299,7 @@ export enum EventType { * request notification regardless of the API that was used to create an * object. */ - ObjectCreatedCopy = 's3:ObjectCreated:Copy', + OBJECT_CREATED_COPY = 's3:ObjectCreated:Copy', /** * Amazon S3 APIs such as PUT, POST, and COPY can create an object. Using @@ -1308,7 +1308,7 @@ export enum EventType { * request notification regardless of the API that was used to create an * object. */ - ObjectCreatedCompleteMultipartUpload = 's3:ObjectCreated:CompleteMultipartUpload', + OBJECT_CREATED_COMPLETE_MULTIPART_UPLOAD = 's3:ObjectCreated:CompleteMultipartUpload', /** * By using the ObjectRemoved event types, you can enable notification when @@ -1325,7 +1325,7 @@ export enum EventType { * You will not receive event notifications from automatic deletes from * lifecycle policies or from failed operations. */ - ObjectRemoved = 's3:ObjectRemoved:*', + OBJECT_REMOVED = 's3:ObjectRemoved:*', /** * By using the ObjectRemoved event types, you can enable notification when @@ -1342,7 +1342,7 @@ export enum EventType { * You will not receive event notifications from automatic deletes from * lifecycle policies or from failed operations. */ - ObjectRemovedDelete = 's3:ObjectRemoved:Delete', + OBJECT_REMOVED_DELETE = 's3:ObjectRemoved:Delete', /** * By using the ObjectRemoved event types, you can enable notification when @@ -1359,14 +1359,14 @@ export enum EventType { * You will not receive event notifications from automatic deletes from * lifecycle policies or from failed operations. */ - ObjectRemovedDeleteMarkerCreated = 's3:ObjectRemoved:DeleteMarkerCreated', + OBJECT_REMOVED_DELETE_MARKER_CREATED = 's3:ObjectRemoved:DeleteMarkerCreated', /** * You can use this event type to request Amazon S3 to send a notification * message when Amazon S3 detects that an object of the RRS storage class is * lost. */ - ReducedRedundancyLostObject = 's3:ReducedRedundancyLostObject', + REDUCED_REDUNDANCY_LOST_OBJECT = 's3:ReducedRedundancyLostObject', } export interface NotificationKeyFilter { diff --git a/packages/@aws-cdk/aws-s3/lib/destination.ts b/packages/@aws-cdk/aws-s3/lib/destination.ts index 8a2c16c54608a..39e1f1b00a33c 100644 --- a/packages/@aws-cdk/aws-s3/lib/destination.ts +++ b/packages/@aws-cdk/aws-s3/lib/destination.ts @@ -40,7 +40,7 @@ export interface BucketNotificationDestinationConfig { * Supported types of notification destinations. */ export enum BucketNotificationDestinationType { - Lambda, - Queue, - Topic + LAMBDA, + QUEUE, + TOPIC } diff --git a/packages/@aws-cdk/aws-s3/lib/notifications-resource/notifications-resource.ts b/packages/@aws-cdk/aws-s3/lib/notifications-resource/notifications-resource.ts index 733df4e6f0956..ae1b09863a148 100644 --- a/packages/@aws-cdk/aws-s3/lib/notifications-resource/notifications-resource.ts +++ b/packages/@aws-cdk/aws-s3/lib/notifications-resource/notifications-resource.ts @@ -68,15 +68,15 @@ export class BucketNotifications extends cdk.Construct { // based on the target type, add the the correct configurations array switch (targetProps.type) { - case BucketNotificationDestinationType.Lambda: + case BucketNotificationDestinationType.LAMBDA: this.lambdaNotifications.push({ ...commonConfig, LambdaFunctionArn: targetProps.arn }); break; - case BucketNotificationDestinationType.Queue: + case BucketNotificationDestinationType.QUEUE: this.queueNotifications.push({ ...commonConfig, QueueArn: targetProps.arn }); break; - case BucketNotificationDestinationType.Topic: + case BucketNotificationDestinationType.TOPIC: this.topicNotifications.push({ ...commonConfig, TopicArn: targetProps.arn }); break; diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.ts b/packages/@aws-cdk/aws-s3/test/integ.bucket.ts index 5d88247867de3..48e239e4bdc0d 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket.ts +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.ts @@ -8,12 +8,12 @@ const app = new cdk.App(); const stack = new cdk.Stack(app, 'aws-cdk-s3'); const bucket = new s3.Bucket(stack, 'MyBucket', { - encryption: s3.BucketEncryption.Kms, + encryption: s3.BucketEncryption.KMS, removalPolicy: cdk.RemovalPolicy.Destroy }); const otherwiseEncryptedBucket = new s3.Bucket(stack, 'MyOtherBucket', { - encryption: s3.BucketEncryption.S3Managed, + encryption: s3.BucketEncryption.S3_MANAGED, removalPolicy: cdk.RemovalPolicy.Destroy }); diff --git a/packages/@aws-cdk/aws-s3/test/test.bucket.ts b/packages/@aws-cdk/aws-s3/test/test.bucket.ts index 012c3e169b701..dd78c0650e9f3 100644 --- a/packages/@aws-cdk/aws-s3/test/test.bucket.ts +++ b/packages/@aws-cdk/aws-s3/test/test.bucket.ts @@ -45,7 +45,7 @@ export = { 'bucket without encryption'(test: Test) { const stack = new cdk.Stack(); new s3.Bucket(stack, 'MyBucket', { - encryption: s3.BucketEncryption.Unencrypted + encryption: s3.BucketEncryption.UNENCRYPTED }); expect(stack).toMatch({ @@ -63,7 +63,7 @@ export = { 'bucket with managed encryption'(test: Test) { const stack = new cdk.Stack(); new s3.Bucket(stack, 'MyBucket', { - encryption: s3.BucketEncryption.KmsManaged + encryption: s3.BucketEncryption.KMS_MANAGED }); expect(stack).toMatch({ @@ -229,7 +229,7 @@ export = { const myKey = new kms.Key(stack, 'MyKey'); test.throws(() => new s3.Bucket(stack, 'MyBucket', { - encryption: s3.BucketEncryption.KmsManaged, + encryption: s3.BucketEncryption.KMS_MANAGED, encryptionKey: myKey }), /encryptionKey is specified, so 'encryption' must be set to KMS/); @@ -241,7 +241,7 @@ export = { const myKey = new kms.Key(stack, 'MyKey'); test.throws(() => new s3.Bucket(stack, 'MyBucket', { - encryption: s3.BucketEncryption.Unencrypted, + encryption: s3.BucketEncryption.UNENCRYPTED, encryptionKey: myKey }), /encryptionKey is specified, so 'encryption' must be set to KMS/); @@ -253,7 +253,7 @@ export = { const encryptionKey = new kms.Key(stack, 'MyKey', { description: 'hello, world' }); - new s3.Bucket(stack, 'MyBucket', { encryptionKey, encryption: s3.BucketEncryption.Kms }); + new s3.Bucket(stack, 'MyBucket', { encryptionKey, encryption: s3.BucketEncryption.KMS }); expect(stack).toMatch({ "Resources": { @@ -427,7 +427,7 @@ export = { 'addPermission creates a bucket policy'(test: Test) { const stack = new cdk.Stack(); - const bucket = new s3.Bucket(stack, 'MyBucket', { encryption: s3.BucketEncryption.Unencrypted }); + const bucket = new s3.Bucket(stack, 'MyBucket', { encryption: s3.BucketEncryption.UNENCRYPTED }); bucket.addToResourcePolicy(new iam.PolicyStatement({ resources: ['foo'], actions: [ 'bar' ]})); @@ -464,7 +464,7 @@ export = { 'forBucket returns a permission statement associated with the bucket\'s ARN'(test: Test) { const stack = new cdk.Stack(); - const bucket = new s3.Bucket(stack, 'MyBucket', { encryption: s3.BucketEncryption.Unencrypted }); + const bucket = new s3.Bucket(stack, 'MyBucket', { encryption: s3.BucketEncryption.UNENCRYPTED }); const x = new iam.PolicyStatement({ resources: [bucket.bucketArn], actions: ['s3:ListBucket'] }); @@ -480,7 +480,7 @@ export = { 'arnForObjects returns a permission statement associated with objects in the bucket'(test: Test) { const stack = new cdk.Stack(); - const bucket = new s3.Bucket(stack, 'MyBucket', { encryption: s3.BucketEncryption.Unencrypted }); + const bucket = new s3.Bucket(stack, 'MyBucket', { encryption: s3.BucketEncryption.UNENCRYPTED }); const p = new iam.PolicyStatement({ resources: [bucket.arnForObjects('hello/world')], actions: ['s3:GetObject'] }); @@ -502,7 +502,7 @@ export = { const stack = new cdk.Stack(); - const bucket = new s3.Bucket(stack, 'MyBucket', { encryption: s3.BucketEncryption.Unencrypted }); + const bucket = new s3.Bucket(stack, 'MyBucket', { encryption: s3.BucketEncryption.UNENCRYPTED }); const user = new iam.User(stack, 'MyUser'); const team = new iam.Group(stack, 'MyTeam'); @@ -536,7 +536,7 @@ export = { const stack = new cdk.Stack(); new s3.Bucket(stack, 'MyBucket', { removalPolicy: cdk.RemovalPolicy.Retain, - encryption: s3.BucketEncryption.Unencrypted + encryption: s3.BucketEncryption.UNENCRYPTED }); expect(stack).toMatch({ @@ -765,7 +765,7 @@ export = { 'grant permissions to non-identity principal'(test: Test) { // GIVEN const stack = new cdk.Stack(); - const bucket = new s3.Bucket(stack, 'MyBucket', { encryption: s3.BucketEncryption.Kms }); + const bucket = new s3.Bucket(stack, 'MyBucket', { encryption: s3.BucketEncryption.KMS }); // WHEN bucket.grantRead(new iam.OrganizationPrincipal('o-1234')); @@ -823,7 +823,7 @@ export = { 'if an encryption key is included, encrypt/decrypt permissions are also added both ways'(test: Test) { const stack = new cdk.Stack(); - const bucket = new s3.Bucket(stack, 'MyBucket', { encryption: s3.BucketEncryption.Kms }); + const bucket = new s3.Bucket(stack, 'MyBucket', { encryption: s3.BucketEncryption.KMS }); const user = new iam.User(stack, 'MyUser'); bucket.grantReadWrite(user); @@ -994,7 +994,7 @@ export = { 'more grants'(test: Test) { const stack = new cdk.Stack(); - const bucket = new s3.Bucket(stack, 'MyBucket', { encryption: s3.BucketEncryption.Kms }); + const bucket = new s3.Bucket(stack, 'MyBucket', { encryption: s3.BucketEncryption.KMS }); const putter = new iam.User(stack, 'Putter'); const writer = new iam.User(stack, 'Writer'); const deleter = new iam.User(stack, 'Deleter'); @@ -1192,7 +1192,7 @@ export = { const bucketFromStackA = new s3.Bucket(stackA, 'MyBucket', { bucketName: cdk.PhysicalName.of('my-bucket-physical-name'), encryptionKey: key, - encryption: s3.BucketEncryption.Kms, + encryption: s3.BucketEncryption.KMS, }); const stackB = new cdk.Stack(undefined, 'StackB', { env: { account: '234567890123' }}); diff --git a/packages/@aws-cdk/aws-s3/test/test.notification.ts b/packages/@aws-cdk/aws-s3/test/test.notification.ts index 5a34fbaec73ff..f11fac28ae752 100644 --- a/packages/@aws-cdk/aws-s3/test/test.notification.ts +++ b/packages/@aws-cdk/aws-s3/test/test.notification.ts @@ -9,10 +9,10 @@ export = { const bucket = new s3.Bucket(stack, 'MyBucket'); - bucket.addEventNotification(s3.EventType.ObjectCreated, { + bucket.addEventNotification(s3.EventType.OBJECT_CREATED, { bind: () => ({ arn: 'ARN', - type: s3.BucketNotificationDestinationType.Topic + type: s3.BucketNotificationDestinationType.TOPIC }) }); diff --git a/packages/@aws-cdk/aws-secretsmanager/lib/secret.ts b/packages/@aws-cdk/aws-secretsmanager/lib/secret.ts index 8167dc05855bc..435c49bf1a9d5 100644 --- a/packages/@aws-cdk/aws-secretsmanager/lib/secret.ts +++ b/packages/@aws-cdk/aws-secretsmanager/lib/secret.ts @@ -235,12 +235,12 @@ export enum AttachmentTargetType { /** * A database instance */ - Instance = 'AWS::RDS::DBInstance', + INSTANCE = 'AWS::RDS::DBInstance', /** * A database cluster */ - Cluster = 'AWS::RDS::DBCluster' + CLUSTER = 'AWS::RDS::DBCluster' } /** diff --git a/packages/@aws-cdk/aws-secretsmanager/test/test.secret.ts b/packages/@aws-cdk/aws-secretsmanager/test/test.secret.ts index 903f51e87a716..22ab66525a380 100644 --- a/packages/@aws-cdk/aws-secretsmanager/test/test.secret.ts +++ b/packages/@aws-cdk/aws-secretsmanager/test/test.secret.ts @@ -315,7 +315,7 @@ export = { const target: secretsmanager.ISecretAttachmentTarget = { asSecretAttachmentTarget: () => ({ targetId: 'instance', - targetType: secretsmanager.AttachmentTargetType.Instance + targetType: secretsmanager.AttachmentTargetType.INSTANCE }) }; @@ -341,7 +341,7 @@ export = { const target: secretsmanager.ISecretAttachmentTarget = { asSecretAttachmentTarget: () => ({ targetId: 'cluster', - targetType: secretsmanager.AttachmentTargetType.Cluster + targetType: secretsmanager.AttachmentTargetType.CLUSTER }) }; const attachedSecret = secret.addTargetAttachment('AttachedSecret', { target }); diff --git a/packages/@aws-cdk/aws-servicediscovery/lib/alias-target-instance.ts b/packages/@aws-cdk/aws-servicediscovery/lib/alias-target-instance.ts index 8c6135dceab3c..dbcbb65b1b56a 100644 --- a/packages/@aws-cdk/aws-servicediscovery/lib/alias-target-instance.ts +++ b/packages/@aws-cdk/aws-servicediscovery/lib/alias-target-instance.ts @@ -44,7 +44,7 @@ export class AliasTargetInstance extends InstanceBase { constructor(scope: cdk.Construct, id: string, props: AliasTargetInstanceProps) { super(scope, id); - if (props.service.namespace.type === NamespaceType.Http) { + if (props.service.namespace.type === NamespaceType.HTTP) { throw new Error('Namespace associated with Service must be a DNS Namespace.'); } @@ -56,7 +56,7 @@ export class AliasTargetInstance extends InstanceBase { throw new Error('Service must use `A` or `AAAA` records to register an AliasRecordTarget.'); } - if (props.service.routingPolicy !== RoutingPolicy.Weighted) { + if (props.service.routingPolicy !== RoutingPolicy.WEIGHTED) { throw new Error('Service must use `WEIGHTED` routing policy.'); } diff --git a/packages/@aws-cdk/aws-servicediscovery/lib/cname-instance.ts b/packages/@aws-cdk/aws-servicediscovery/lib/cname-instance.ts index f75d591c79a94..a1f559e6c1a02 100644 --- a/packages/@aws-cdk/aws-servicediscovery/lib/cname-instance.ts +++ b/packages/@aws-cdk/aws-servicediscovery/lib/cname-instance.ts @@ -49,7 +49,7 @@ export class CnameInstance extends InstanceBase { constructor(scope: cdk.Construct, id: string, props: CnameInstanceProps) { super(scope, id); - if (props.service.namespace.type === NamespaceType.Http) { + if (props.service.namespace.type === NamespaceType.HTTP) { throw new Error('Namespace associated with Service must be a DNS Namespace.'); } diff --git a/packages/@aws-cdk/aws-servicediscovery/lib/http-namespace.ts b/packages/@aws-cdk/aws-servicediscovery/lib/http-namespace.ts index 4dd3d4ba4a381..ac207e525a46c 100644 --- a/packages/@aws-cdk/aws-servicediscovery/lib/http-namespace.ts +++ b/packages/@aws-cdk/aws-servicediscovery/lib/http-namespace.ts @@ -32,7 +32,7 @@ export class HttpNamespace extends Resource implements IHttpNamespace { public namespaceName = attrs.namespaceName; public namespaceId = attrs.namespaceId; public namespaceArn = attrs.namespaceArn; - public type = NamespaceType.Http; + public type = NamespaceType.HTTP; } return new Import(scope, id); } @@ -68,7 +68,7 @@ export class HttpNamespace extends Resource implements IHttpNamespace { this.namespaceName = props.name; this.namespaceId = ns.attrId; this.namespaceArn = ns.attrArn; - this.type = NamespaceType.Http; + this.type = NamespaceType.HTTP; } /** @attribute */ diff --git a/packages/@aws-cdk/aws-servicediscovery/lib/namespace.ts b/packages/@aws-cdk/aws-servicediscovery/lib/namespace.ts index 36126d0cadda1..f690897f2fa33 100644 --- a/packages/@aws-cdk/aws-servicediscovery/lib/namespace.ts +++ b/packages/@aws-cdk/aws-servicediscovery/lib/namespace.ts @@ -65,17 +65,17 @@ export enum NamespaceType { /** * Choose this option if you want your application to use only API calls to discover registered instances. */ - Http = "HTTP", + HTTP = "HTTP", /** * Choose this option if you want your application to be able to discover instances using either API calls or using * DNS queries in a VPC. */ - DnsPrivate = "DNS_PRIVATE", + DNS_PRIVATE = "DNS_PRIVATE", /** * Choose this option if you want your application to be able to discover instances using either API calls or using * public DNS queries. You aren't required to use both methods. */ - DnsPublic = "DNS_PUBLIC", + DNS_PUBLIC = "DNS_PUBLIC", } diff --git a/packages/@aws-cdk/aws-servicediscovery/lib/non-ip-instance.ts b/packages/@aws-cdk/aws-servicediscovery/lib/non-ip-instance.ts index de9dc52c1ff21..69435c507e641 100644 --- a/packages/@aws-cdk/aws-servicediscovery/lib/non-ip-instance.ts +++ b/packages/@aws-cdk/aws-servicediscovery/lib/non-ip-instance.ts @@ -38,7 +38,7 @@ export class NonIpInstance extends InstanceBase { constructor(scope: cdk.Construct, id: string, props: NonIpInstanceProps) { super(scope, id); - if (props.service.namespace.type !== NamespaceType.Http) { + if (props.service.namespace.type !== NamespaceType.HTTP) { throw new Error('This type of instance can only be registered for HTTP namespaces.'); } diff --git a/packages/@aws-cdk/aws-servicediscovery/lib/private-dns-namespace.ts b/packages/@aws-cdk/aws-servicediscovery/lib/private-dns-namespace.ts index cfd851825d405..bdf1063f45e98 100644 --- a/packages/@aws-cdk/aws-servicediscovery/lib/private-dns-namespace.ts +++ b/packages/@aws-cdk/aws-servicediscovery/lib/private-dns-namespace.ts @@ -40,7 +40,7 @@ export class PrivateDnsNamespace extends Resource implements IPrivateDnsNamespac public namespaceName = attrs.namespaceName; public namespaceId = attrs.namespaceId; public namespaceArn = attrs.namespaceArn; - public type = NamespaceType.DnsPrivate; + public type = NamespaceType.DNS_PRIVATE; } return new Import(scope, id); } @@ -80,7 +80,7 @@ export class PrivateDnsNamespace extends Resource implements IPrivateDnsNamespac this.namespaceName = props.name; this.namespaceId = ns.attrId; this.namespaceArn = ns.attrArn; - this.type = NamespaceType.DnsPrivate; + this.type = NamespaceType.DNS_PRIVATE; } /** @attribute */ diff --git a/packages/@aws-cdk/aws-servicediscovery/lib/public-dns-namespace.ts b/packages/@aws-cdk/aws-servicediscovery/lib/public-dns-namespace.ts index 0e7a0b967ea55..ef31a6a23e04e 100644 --- a/packages/@aws-cdk/aws-servicediscovery/lib/public-dns-namespace.ts +++ b/packages/@aws-cdk/aws-servicediscovery/lib/public-dns-namespace.ts @@ -32,7 +32,7 @@ export class PublicDnsNamespace extends Resource implements IPublicDnsNamespace public namespaceName = attrs.namespaceName; public namespaceId = attrs.namespaceId; public namespaceArn = attrs.namespaceArn; - public type = NamespaceType.DnsPublic; + public type = NamespaceType.DNS_PUBLIC; } return new Import(scope, id); } @@ -68,7 +68,7 @@ export class PublicDnsNamespace extends Resource implements IPublicDnsNamespace this.namespaceName = props.name; this.namespaceId = ns.attrId; this.namespaceArn = ns.attrArn; - this.type = NamespaceType.DnsPublic; + this.type = NamespaceType.DNS_PUBLIC; } /** @attribute */ diff --git a/packages/@aws-cdk/aws-servicediscovery/lib/service.ts b/packages/@aws-cdk/aws-servicediscovery/lib/service.ts index c7e81afb090d2..02a1e76a7f991 100644 --- a/packages/@aws-cdk/aws-servicediscovery/lib/service.ts +++ b/packages/@aws-cdk/aws-servicediscovery/lib/service.ts @@ -199,7 +199,7 @@ export class Service extends ServiceBase { const namespaceType = props.namespace.type; // Validations - if (namespaceType === NamespaceType.Http && (props.routingPolicy || props.dnsRecordType)) { + if (namespaceType === NamespaceType.HTTP && (props.routingPolicy || props.dnsRecordType)) { throw new Error('Cannot specify `routingPolicy` or `dnsRecord` when using an HTTP namespace.'); } @@ -207,11 +207,11 @@ export class Service extends ServiceBase { throw new Error('Cannot specify both `healthCheckConfig` and `healthCheckCustomConfig`.'); } - if (namespaceType === NamespaceType.DnsPrivate && props.healthCheck) { + if (namespaceType === NamespaceType.DNS_PRIVATE && props.healthCheck) { throw new Error('Cannot specify `healthCheckConfig` for a Private DNS namespace.'); } - if (props.routingPolicy === RoutingPolicy.Multivalue + if (props.routingPolicy === RoutingPolicy.MULTIVALUE && props.dnsRecordType === DnsRecordType.CNAME) { throw new Error('Cannot use `CNAME` record when routing policy is `Multivalue`.'); } @@ -220,21 +220,21 @@ export class Service extends ServiceBase { // The same validation happens later on during the actual attachment // of LBs, but we need the property for the correct configuration of // routingPolicy anyway, so might as well do the validation as well. - if (props.routingPolicy === RoutingPolicy.Multivalue + if (props.routingPolicy === RoutingPolicy.MULTIVALUE && props.loadBalancer) { throw new Error('Cannot register loadbalancers when routing policy is `Multivalue`.'); } if (props.healthCheck - && props.healthCheck.type === HealthCheckType.Tcp + && props.healthCheck.type === HealthCheckType.TCP && props.healthCheck.resourcePath) { throw new Error('Cannot specify `resourcePath` when using a `TCP` health check.'); } // Set defaults where necessary const routingPolicy = (props.dnsRecordType === DnsRecordType.CNAME) || props.loadBalancer - ? RoutingPolicy.Weighted - : RoutingPolicy.Multivalue; + ? RoutingPolicy.WEIGHTED + : RoutingPolicy.MULTIVALUE; const dnsRecordType = props.dnsRecordType || DnsRecordType.A; @@ -245,7 +245,7 @@ export class Service extends ServiceBase { throw new Error('Must support `A` or `AAAA` records to register loadbalancers.'); } - const dnsConfig: CfnService.DnsConfigProperty | undefined = props.namespace.type === NamespaceType.Http + const dnsConfig: CfnService.DnsConfigProperty | undefined = props.namespace.type === NamespaceType.HTTP ? undefined : { dnsRecords: renderDnsRecords(dnsRecordType, props.dnsTtlSec), @@ -254,9 +254,9 @@ export class Service extends ServiceBase { }; const healthCheckConfigDefaults = { - type: HealthCheckType.Http, + type: HealthCheckType.HTTP, failureThreshold: 1, - resourcePath: props.healthCheck && props.healthCheck.type !== HealthCheckType.Tcp + resourcePath: props.healthCheck && props.healthCheck.type !== HealthCheckType.TCP ? '/' : undefined }; @@ -414,13 +414,13 @@ export enum RoutingPolicy { * Route 53 returns the applicable value from one randomly selected instance from among the instances that you * registered using the same service. */ - Weighted = "WEIGHTED", + WEIGHTED = "WEIGHTED", /** * If you define a health check for the service and the health check is healthy, Route 53 returns the applicable value * for up to eight instances. */ - Multivalue = "MULTIVALUE", + MULTIVALUE = "MULTIVALUE", } export enum HealthCheckType { @@ -428,18 +428,18 @@ export enum HealthCheckType { * Route 53 tries to establish a TCP connection. If successful, Route 53 submits an HTTP request and waits for an HTTP * status code of 200 or greater and less than 400. */ - Http = "HTTP", + HTTP = "HTTP", /** * Route 53 tries to establish a TCP connection. If successful, Route 53 submits an HTTPS request and waits for an * HTTP status code of 200 or greater and less than 400. If you specify HTTPS for the value of Type, the endpoint * must support TLS v1.0 or later. */ - Https = "HTTPS", + HTTPS = "HTTPS", /** * Route 53 tries to establish a TCP connection. * If you specify TCP for Type, don't specify a value for ResourcePath. */ - Tcp = "TCP", + TCP = "TCP", } diff --git a/packages/@aws-cdk/aws-servicediscovery/test/integ.service-with-http-namespace.lit.ts b/packages/@aws-cdk/aws-servicediscovery/test/integ.service-with-http-namespace.lit.ts index 372a4cc8b8560..3b54636ae29bc 100644 --- a/packages/@aws-cdk/aws-servicediscovery/test/integ.service-with-http-namespace.lit.ts +++ b/packages/@aws-cdk/aws-servicediscovery/test/integ.service-with-http-namespace.lit.ts @@ -19,7 +19,7 @@ service1.registerNonIpInstance('NonIpInstance', { const service2 = namespace.createService('IpService', { description: 'service registering ip instances', healthCheck: { - type: servicediscovery.HealthCheckType.Http, + type: servicediscovery.HealthCheckType.HTTP, resourcePath: '/check' } }); diff --git a/packages/@aws-cdk/aws-servicediscovery/test/integ.service-with-public-dns-namespace.lit.ts b/packages/@aws-cdk/aws-servicediscovery/test/integ.service-with-public-dns-namespace.lit.ts index 43a997827b6d4..87c2b09c2eec0 100644 --- a/packages/@aws-cdk/aws-servicediscovery/test/integ.service-with-public-dns-namespace.lit.ts +++ b/packages/@aws-cdk/aws-servicediscovery/test/integ.service-with-public-dns-namespace.lit.ts @@ -13,7 +13,7 @@ const service = namespace.createService('Service', { dnsRecordType: servicediscovery.DnsRecordType.A, dnsTtlSec: 30, healthCheck: { - type: servicediscovery.HealthCheckType.Https, + type: servicediscovery.HealthCheckType.HTTPS, resourcePath: '/healthcheck', failureThreshold: 2 } diff --git a/packages/@aws-cdk/aws-servicediscovery/test/test.instance.ts b/packages/@aws-cdk/aws-servicediscovery/test/test.instance.ts index fbaacf41587d4..7432cf7edab2b 100644 --- a/packages/@aws-cdk/aws-servicediscovery/test/test.instance.ts +++ b/packages/@aws-cdk/aws-servicediscovery/test/test.instance.ts @@ -312,7 +312,7 @@ export = { }); const service = namespace.createService('MyService', { - routingPolicy: servicediscovery.RoutingPolicy.Multivalue + routingPolicy: servicediscovery.RoutingPolicy.MULTIVALUE }); const vpc = new ec2.Vpc(stack, 'MyVPC'); diff --git a/packages/@aws-cdk/aws-servicediscovery/test/test.service.ts b/packages/@aws-cdk/aws-servicediscovery/test/test.service.ts index d371d2a3ec47f..8f1c5c717109d 100644 --- a/packages/@aws-cdk/aws-servicediscovery/test/test.service.ts +++ b/packages/@aws-cdk/aws-servicediscovery/test/test.service.ts @@ -64,7 +64,7 @@ export = { name: 'service', description: 'service description', healthCheck: { - type: servicediscovery.HealthCheckType.Http, + type: servicediscovery.HealthCheckType.HTTP, resourcePath: '/check' } }); @@ -335,7 +335,7 @@ export = { namespace.createService('MyService', { name: 'service', dnsRecordType: servicediscovery.DnsRecordType.CNAME, - routingPolicy: servicediscovery.RoutingPolicy.Multivalue, + routingPolicy: servicediscovery.RoutingPolicy.MULTIVALUE, }); }, /Cannot use `CNAME` record when routing policy is `Multivalue`./); @@ -355,7 +355,7 @@ export = { namespace.createService('MyService', { name: 'service', healthCheck: { - type: servicediscovery.HealthCheckType.Tcp, + type: servicediscovery.HealthCheckType.TCP, resourcePath: '/check' } }); @@ -395,7 +395,7 @@ export = { test.throws(() => { namespace.createService('MyService', { loadBalancer: true, - routingPolicy: servicediscovery.RoutingPolicy.Multivalue + routingPolicy: servicediscovery.RoutingPolicy.MULTIVALUE }); }, /Cannot register loadbalancers when routing policy is `Multivalue`./); diff --git a/packages/@aws-cdk/aws-ses/lib/receipt-filter.ts b/packages/@aws-cdk/aws-ses/lib/receipt-filter.ts index 83dc2e20c0aab..bd18c74cbd07c 100644 --- a/packages/@aws-cdk/aws-ses/lib/receipt-filter.ts +++ b/packages/@aws-cdk/aws-ses/lib/receipt-filter.ts @@ -8,12 +8,12 @@ export enum ReceiptFilterPolicy { /** * Allow the ip address or range. */ - Allow = 'Allow', + ALLOW = 'Allow', /** * Block the ip address or range. */ - Block = 'Block' + BLOCK = 'Block' } /** @@ -56,7 +56,7 @@ export class ReceiptFilter extends Resource { filter: { ipFilter: { cidr: props.ip || '0.0.0.0/0', - policy: props.policy || ReceiptFilterPolicy.Block, + policy: props.policy || ReceiptFilterPolicy.BLOCK, }, name: this.physicalName.value, } @@ -86,7 +86,7 @@ export class WhiteListReceiptFilter extends Construct { props.ips.forEach(ip => { new ReceiptFilter(this, `Allow${ip.replace(/[^\d]/g, '')}`, { ip, - policy: ReceiptFilterPolicy.Allow + policy: ReceiptFilterPolicy.ALLOW }); }); } 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 d004a729a51a4..62e6e7c39f611 100644 --- a/packages/@aws-cdk/aws-ses/lib/receipt-rule-action.ts +++ b/packages/@aws-cdk/aws-ses/lib/receipt-rule-action.ts @@ -230,14 +230,14 @@ export enum LambdaInvocationType { /** * The function will be invoked asynchronously. */ - Event = 'Event', + EVENT = 'Event', /** * The function will be invoked sychronously. Use RequestResponse only when * you want to make a mail flow decision, such as whether to stop the receipt * rule or the receipt rule set. */ - RequestResponse = 'RequestResponse', + REQUEST_RESPONSE = 'RequestResponse', } /** @@ -391,7 +391,7 @@ export enum EmailEncoding { /** * Base 64 */ - Base64 = 'Base64', + BASE64 = 'Base64', /** * UTF-8 diff --git a/packages/@aws-cdk/aws-ses/lib/receipt-rule.ts b/packages/@aws-cdk/aws-ses/lib/receipt-rule.ts index 4c679c3feeedb..700168fa79d2e 100644 --- a/packages/@aws-cdk/aws-ses/lib/receipt-rule.ts +++ b/packages/@aws-cdk/aws-ses/lib/receipt-rule.ts @@ -22,12 +22,12 @@ export enum TlsPolicy { /** * Do not check for TLS. */ - Optional = 'Optional', + OPTIONAL = 'Optional', /** * Bounce emails that are not received over TLS. */ - Require = 'Require' + REQUIRE = 'Require' } /** @@ -182,7 +182,7 @@ export class DropSpamReceiptRule extends Construct { actions: [ new ReceiptRuleLambdaAction({ function: fn, - invocationType: LambdaInvocationType.RequestResponse + invocationType: LambdaInvocationType.REQUEST_RESPONSE }) ], scanEnabled: true, diff --git a/packages/@aws-cdk/aws-ses/test/integ.receipt.ts b/packages/@aws-cdk/aws-ses/test/integ.receipt.ts index 42538689eb8b1..cc40aa0653b01 100644 --- a/packages/@aws-cdk/aws-ses/test/integ.receipt.ts +++ b/packages/@aws-cdk/aws-ses/test/integ.receipt.ts @@ -33,7 +33,7 @@ const firstRule = ruleSet.addRule('FirstRule', { }), new ses.ReceiptRuleLambdaAction({ function: fn, - invocationType: ses.LambdaInvocationType.RequestResponse, + invocationType: ses.LambdaInvocationType.REQUEST_RESPONSE, topic }), new ses.ReceiptRuleS3Action({ @@ -43,14 +43,14 @@ const firstRule = ruleSet.addRule('FirstRule', { topic }), new ses.ReceiptRuleSnsAction({ - encoding: ses.EmailEncoding.Base64, + encoding: ses.EmailEncoding.BASE64, topic }) ], receiptRuleName: cdk.PhysicalName.of('FirstRule'), recipients: ['cdk-ses-receipt-test@yopmail.com'], scanEnabled: true, - tlsPolicy: ses.TlsPolicy.Require, + tlsPolicy: ses.TlsPolicy.REQUIRE, }); firstRule.addAction( diff --git a/packages/@aws-cdk/aws-ses/test/test.receipt-filter.ts b/packages/@aws-cdk/aws-ses/test/test.receipt-filter.ts index a0ede1b4409f8..64809ec58ad78 100644 --- a/packages/@aws-cdk/aws-ses/test/test.receipt-filter.ts +++ b/packages/@aws-cdk/aws-ses/test/test.receipt-filter.ts @@ -14,7 +14,7 @@ export = { new ReceiptFilter(stack, 'Filter', { ip: '1.2.3.4/16', receiptFilterName: PhysicalName.of('MyFilter'), - policy: ReceiptFilterPolicy.Block + policy: ReceiptFilterPolicy.BLOCK }); // THEN 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 258a1872b77e9..ea60d6c59a187 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 @@ -145,7 +145,7 @@ export = { actions: [ new ReceiptRuleLambdaAction({ function: fn, - invocationType: LambdaInvocationType.RequestResponse, + invocationType: LambdaInvocationType.REQUEST_RESPONSE, topic }) ] @@ -385,7 +385,7 @@ export = { { actions: [ new ReceiptRuleSnsAction({ - encoding: EmailEncoding.Base64, + encoding: EmailEncoding.BASE64, topic }) ] diff --git a/packages/@aws-cdk/aws-ses/test/test.receipt-rule.ts b/packages/@aws-cdk/aws-ses/test/test.receipt-rule.ts index 77624bad27253..6ecae84d2b671 100644 --- a/packages/@aws-cdk/aws-ses/test/test.receipt-rule.ts +++ b/packages/@aws-cdk/aws-ses/test/test.receipt-rule.ts @@ -21,7 +21,7 @@ export = { receiptRuleName: PhysicalName.of('SecondRule'), recipients: ['hello@aws.com'], scanEnabled: true, - tlsPolicy: TlsPolicy.Require + tlsPolicy: TlsPolicy.REQUIRE } ] }); diff --git a/packages/@aws-cdk/aws-sns-subscriptions/lib/email.ts b/packages/@aws-cdk/aws-sns-subscriptions/lib/email.ts index b678b9e102cfd..2691ae6fa41e9 100644 --- a/packages/@aws-cdk/aws-sns-subscriptions/lib/email.ts +++ b/packages/@aws-cdk/aws-sns-subscriptions/lib/email.ts @@ -27,7 +27,7 @@ export class EmailSubscription implements sns.ITopicSubscription { new sns.Subscription(scope, this.emailAddress, { topic, endpoint: this.emailAddress, - protocol: this.props.json ? sns.SubscriptionProtocol.EmailJson : sns.SubscriptionProtocol.Email + protocol: this.props.json ? sns.SubscriptionProtocol.EMAIL_JSON : sns.SubscriptionProtocol.EMAIL }); } } diff --git a/packages/@aws-cdk/aws-sns-subscriptions/lib/lambda.ts b/packages/@aws-cdk/aws-sns-subscriptions/lib/lambda.ts index 114439087a581..55c78bfa6aa2e 100644 --- a/packages/@aws-cdk/aws-sns-subscriptions/lib/lambda.ts +++ b/packages/@aws-cdk/aws-sns-subscriptions/lib/lambda.ts @@ -27,7 +27,7 @@ export class LambdaSubscription implements sns.ITopicSubscription { new sns.Subscription(this.fn, subscriptionName, { topic, endpoint: this.fn.functionArn, - protocol: sns.SubscriptionProtocol.Lambda, + protocol: sns.SubscriptionProtocol.LAMBDA, }); this.fn.addPermission(topic.node.id, { diff --git a/packages/@aws-cdk/aws-sns-subscriptions/lib/sqs.ts b/packages/@aws-cdk/aws-sns-subscriptions/lib/sqs.ts index 5a3e92569a171..5bd76ffbda013 100644 --- a/packages/@aws-cdk/aws-sns-subscriptions/lib/sqs.ts +++ b/packages/@aws-cdk/aws-sns-subscriptions/lib/sqs.ts @@ -41,7 +41,7 @@ export class SqsSubscription implements sns.ITopicSubscription { new sns.Subscription(this.queue, subscriptionName, { topic, endpoint: this.queue.queueArn, - protocol: sns.SubscriptionProtocol.Sqs, + protocol: sns.SubscriptionProtocol.SQS, rawMessageDelivery: this.props.rawMessageDelivery, }); diff --git a/packages/@aws-cdk/aws-sns-subscriptions/lib/url.ts b/packages/@aws-cdk/aws-sns-subscriptions/lib/url.ts index 91046dc4e2407..633ff0d04f63d 100644 --- a/packages/@aws-cdk/aws-sns-subscriptions/lib/url.ts +++ b/packages/@aws-cdk/aws-sns-subscriptions/lib/url.ts @@ -33,7 +33,7 @@ export class UrlSubscription implements sns.ITopicSubscription { new sns.Subscription(scope, this.url, { topic, endpoint: this.url, - protocol: this.url.startsWith('https:') ? sns.SubscriptionProtocol.Https : sns.SubscriptionProtocol.Http, + protocol: this.url.startsWith('https:') ? sns.SubscriptionProtocol.HTTPS : sns.SubscriptionProtocol.HTTP, rawMessageDelivery: this.props.rawMessageDelivery, }); } diff --git a/packages/@aws-cdk/aws-sns/lib/subscription.ts b/packages/@aws-cdk/aws-sns/lib/subscription.ts index 184227aac4b90..16accc8b6424c 100644 --- a/packages/@aws-cdk/aws-sns/lib/subscription.ts +++ b/packages/@aws-cdk/aws-sns/lib/subscription.ts @@ -64,40 +64,40 @@ export enum SubscriptionProtocol { /** * JSON-encoded message is POSTED to an HTTP url. */ - Http = 'http', + HTTP = 'http', /** * JSON-encoded message is POSTed to an HTTPS url. */ - Https = 'https', + HTTPS = 'https', /** * Notifications are sent via email. */ - Email = 'email', + EMAIL = 'email', /** * Notifications are JSON-encoded and sent via mail. */ - EmailJson = 'email-json', + EMAIL_JSON = 'email-json', /** * Notification is delivered by SMS */ - Sms = 'sms', + SMS = 'sms', /** * Notifications are enqueued into an SQS queue. */ - Sqs = 'sqs', + SQS = 'sqs', /** * JSON-encoded notifications are sent to a mobile app endpoint. */ - Application = 'application', + APPLICATION = 'application', /** * Notifications trigger a Lambda function. */ - Lambda = 'lambda' + LAMBDA = 'lambda' } diff --git a/packages/@aws-cdk/aws-sqs/lib/queue.ts b/packages/@aws-cdk/aws-sqs/lib/queue.ts index 9d9fa28f38e17..a92a0f95c045f 100644 --- a/packages/@aws-cdk/aws-sqs/lib/queue.ts +++ b/packages/@aws-cdk/aws-sqs/lib/queue.ts @@ -161,19 +161,19 @@ export enum QueueEncryption { /** * Messages in the queue are not encrypted */ - Unencrypted = 'NONE', + UNENCRYPTED = 'NONE', /** * Server-side KMS encryption with a master key managed by SQS. */ - KmsManaged = 'MANAGED', + KMS_MANAGED = 'MANAGED', /** * Server-side encryption with a KMS key managed by the user. * * If `encryptionKey` is specified, this key will be used, otherwise, one will be defined. */ - Kms = 'KMS', + KMS = 'KMS', } /** @@ -271,17 +271,17 @@ export class Queue extends QueueBase { this.queueUrl = queue.refAsString; function _determineEncryptionProps(this: Queue): { encryptionProps: EncryptionProps, encryptionMasterKey?: kms.IKey } { - let encryption = props.encryption || QueueEncryption.Unencrypted; + let encryption = props.encryption || QueueEncryption.UNENCRYPTED; - if (encryption !== QueueEncryption.Kms && props.encryptionMasterKey) { - encryption = QueueEncryption.Kms; // KMS is implied by specifying an encryption key + if (encryption !== QueueEncryption.KMS && props.encryptionMasterKey) { + encryption = QueueEncryption.KMS; // KMS is implied by specifying an encryption key } - if (encryption === QueueEncryption.Unencrypted) { + if (encryption === QueueEncryption.UNENCRYPTED) { return { encryptionProps: {} }; } - if (encryption === QueueEncryption.KmsManaged) { + if (encryption === QueueEncryption.KMS_MANAGED) { const masterKey = kms.Key.fromKeyArn(this, 'Key', 'alias/aws/sqs'); return { @@ -293,7 +293,7 @@ export class Queue extends QueueBase { }; } - if (encryption === QueueEncryption.Kms) { + if (encryption === QueueEncryption.KMS) { const masterKey = props.encryptionMasterKey || new kms.Key(this, 'Key', { description: `Created by ${this.node.path}` }); diff --git a/packages/@aws-cdk/aws-sqs/test/test.sqs.ts b/packages/@aws-cdk/aws-sqs/test/test.sqs.ts index 35d22487a40f8..711eacc105fd2 100644 --- a/packages/@aws-cdk/aws-sqs/test/test.sqs.ts +++ b/packages/@aws-cdk/aws-sqs/test/test.sqs.ts @@ -200,7 +200,7 @@ export = { 'a kms key will be allocated if encryption = kms but a master key is not specified'(test: Test) { const stack = new Stack(); - new sqs.Queue(stack, 'Queue', { encryption: sqs.QueueEncryption.Kms }); + new sqs.Queue(stack, 'Queue', { encryption: sqs.QueueEncryption.KMS }); expect(stack).to(haveResource('AWS::KMS::Key')); expect(stack).to(haveResource('AWS::SQS::Queue', { @@ -218,7 +218,7 @@ export = { 'it is possible to use a managed kms key'(test: Test) { const stack = new Stack(); - new sqs.Queue(stack, 'Queue', { encryption: sqs.QueueEncryption.KmsManaged }); + new sqs.Queue(stack, 'Queue', { encryption: sqs.QueueEncryption.KMS_MANAGED }); expect(stack).toMatch({ "Resources": { "Queue4A7E3555": { @@ -236,7 +236,7 @@ export = { // GIVEN const stack = new Stack(); const queue = new sqs.Queue(stack, 'Queue', { - encryption: sqs.QueueEncryption.Kms + encryption: sqs.QueueEncryption.KMS }); const role = new iam.Role(stack, 'Role', { assumedBy: new iam.ServicePrincipal('someone') diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/run-ecs-task-base.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/run-ecs-task-base.ts index b51a08e08ff31..d78e41c3c70ad 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/run-ecs-task-base.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/run-ecs-task-base.ts @@ -102,7 +102,7 @@ export class EcsRunTaskBase implements ec2.IConnectable, sfn.IStepFunctionsTask securityGroup?: ec2.ISecurityGroup) { if (subnetSelection === undefined) { - subnetSelection = { subnetType: assignPublicIp ? ec2.SubnetType.Public : ec2.SubnetType.Private }; + subnetSelection = { subnetType: assignPublicIp ? ec2.SubnetType.PUBLIC : ec2.SubnetType.PRIVATE }; } // If none is given here, one will be created later on during bind() diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/sagemaker-task-base-types.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/sagemaker-task-base-types.ts index 0a8e6bf365795..b202072e98502 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/sagemaker-task-base-types.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/sagemaker-task-base-types.ts @@ -224,17 +224,17 @@ export enum S3DataType { /** * Manifest File Data Type */ - ManifestFile = 'ManifestFile', + MANIFEST_FILE = 'ManifestFile', /** * S3 Prefix Data Type */ - S3Prefix = 'S3Prefix', + S3_PREFIX = 'S3Prefix', /** * Augmented Manifest File Data Type */ - AugmentedManifestFile = 'AugmentedManifestFile' + AUGMENTED_MANIFEST_FILE = 'AugmentedManifestFile' } /** @@ -244,12 +244,12 @@ export enum S3DataDistributionType { /** * Fully replicated S3 Data Distribution Type */ - FullyReplicated = 'FullyReplicated', + FULLY_REPLICATED = 'FullyReplicated', /** * Sharded By S3 Key Data Distribution Type */ - ShardedByS3Key = 'ShardedByS3Key' + SHARDED_BY_S3_KEY = 'ShardedByS3Key' } /** @@ -259,12 +259,12 @@ export enum RecordWrapperType { /** * None record wrapper type */ - None = 'None', + NONE = 'None', /** * RecordIO record wrapper type */ - RecordIO = 'RecordIO' + RECORD_IO = 'RecordIO' } /** @@ -274,12 +274,12 @@ export enum InputMode { /** * Pipe mode */ - Pipe = 'Pipe', + PIPE = 'Pipe', /** * File mode. */ - File = 'File' + FILE = 'File' } /** @@ -289,12 +289,12 @@ export enum CompressionType { /** * None compression type */ - None = 'None', + NONE = 'None', /** * Gzip compression type */ - Gzip = 'Gzip' + GZIP = 'Gzip' } // @@ -421,12 +421,12 @@ export enum BatchStrategy { /** * Fits multiple records in a mini-batch. */ - MultiRecord = 'MultiRecord', + MULTI_RECORD = 'MultiRecord', /** * Use a single record when making an invocation request. */ - SingleRecord = 'SingleRecord' + SINGLE_RECORD = 'SingleRecord' } /** @@ -437,22 +437,22 @@ export enum SplitType { /** * Input data files are not split, */ - None = 'None', + NONE = 'None', /** * Split records on a newline character boundary. */ - Line = 'Line', + LINE = 'Line', /** * Split using MXNet RecordIO format. */ - RecordIO = 'RecordIO', + RECORD_IO = 'RecordIO', /** * Split using TensorFlow TFRecord format. */ - TFRecord = 'TFRecord' + TF_RECORD = 'TFRecord' } /** @@ -463,11 +463,11 @@ export enum AssembleWith { /** * Concatenate the results in binary format. */ - None = 'None', + NONE = 'None', /** * Add a newline character at the end of every transformed record. */ - Line = 'Line' + LINE = 'Line' } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/sagemaker-train-task.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/sagemaker-train-task.ts index 6059174c5eb75..62258906ed390 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/sagemaker-train-task.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/sagemaker-train-task.ts @@ -110,7 +110,7 @@ export class SagemakerTrainTask implements ec2.IConnectable, sfn.IStepFunctionsT // set the default resource config if not defined. this.resourceConfig = props.resourceConfig || { instanceCount: 1, - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.XLarge), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.XLARGE), volumeSizeInGB: 10 }; @@ -130,13 +130,13 @@ export class SagemakerTrainTask implements ec2.IConnectable, sfn.IStepFunctionsT // set the input mode to 'File' if not defined this.algorithmSpecification = ( props.algorithmSpecification.trainingInputMode ) ? ( props.algorithmSpecification ) : - ( { ...props.algorithmSpecification, trainingInputMode: InputMode.File } ); + ( { ...props.algorithmSpecification, trainingInputMode: InputMode.FILE } ); // set the S3 Data type of the input data config objects to be 'S3Prefix' if not defined this.inputDataConfig = props.inputDataConfig.map(config => { if (!config.dataSource.s3DataSource.s3DataType) { return Object.assign({}, config, { dataSource: { s3DataSource: - { ...config.dataSource.s3DataSource, s3DataType: S3DataType.S3Prefix } } }); + { ...config.dataSource.s3DataSource, s3DataType: S3DataType.S3_PREFIX } } }); } else { return config; } diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/sagemaker-transform-task.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/sagemaker-transform-task.ts index 9d485f5bfadcb..6f78b67b80024 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/sagemaker-transform-task.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/sagemaker-transform-task.ts @@ -110,7 +110,7 @@ export class SagemakerTransformTask implements sfn.IStepFunctionsTask { { transformDataSource: { s3DataSource: { ...props.transformInput.transformDataSource.s3DataSource, - s3DataType: S3DataType.S3Prefix + s3DataType: S3DataType.S3_PREFIX } } }); @@ -118,7 +118,7 @@ export class SagemakerTransformTask implements sfn.IStepFunctionsTask { // set the default value for the transform resources this.transformResources = props.transformResources || { instanceCount: 1, - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.XLarge), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.M4, ec2.InstanceSize.XLARGE), }; } diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/test/integ.ec2-task.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/test/integ.ec2-task.ts index d7d26f48c0743..37e3594c30a22 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/test/integ.ec2-task.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/test/integ.ec2-task.ts @@ -20,7 +20,7 @@ const vpc = ec2.Vpc.fromLookup(stack, 'Vpc', { const cluster = new ecs.Cluster(stack, 'FargateCluster', { vpc }); cluster.addCapacity('DefaultAutoScalingGroup', { instanceType: new ec2.InstanceType('t2.micro'), - vpcSubnets: { subnetType: ec2.SubnetType.Public }, + vpcSubnets: { subnetType: ec2.SubnetType.PUBLIC }, }); // Build task definition diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/test/sagemaker-training-job.test.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/test/sagemaker-training-job.test.ts index 057799772878e..345b369f6e0ff 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/test/sagemaker-training-job.test.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/test/sagemaker-training-job.test.ts @@ -93,7 +93,7 @@ test('create complex training job', () => { role, algorithmSpecification: { algorithmName: "BlazingText", - trainingInputMode: tasks.InputMode.File, + trainingInputMode: tasks.InputMode.FILE, metricDefinitions: [ { name: 'mymetric', regex: 'regex_pattern' @@ -107,11 +107,11 @@ test('create complex training job', () => { { channelName: "train", contentType: "image/jpeg", - compressionType: tasks.CompressionType.None, - recordWrapperType: tasks.RecordWrapperType.RecordIO, + compressionType: tasks.CompressionType.NONE, + recordWrapperType: tasks.RecordWrapperType.RECORD_IO, dataSource: { s3DataSource: { - s3DataType: tasks.S3DataType.S3Prefix, + s3DataType: tasks.S3DataType.S3_PREFIX, s3Uri: "s3://mybucket/mytrainpath", } } @@ -119,11 +119,11 @@ test('create complex training job', () => { { channelName: "test", contentType: "image/jpeg", - compressionType: tasks.CompressionType.Gzip, - recordWrapperType: tasks.RecordWrapperType.RecordIO, + compressionType: tasks.CompressionType.GZIP, + recordWrapperType: tasks.RecordWrapperType.RECORD_IO, dataSource: { s3DataSource: { - s3DataType: tasks.S3DataType.S3Prefix, + s3DataType: tasks.S3DataType.S3_PREFIX, s3Uri: "s3://mybucket/mytestpath", } } @@ -135,7 +135,7 @@ test('create complex training job', () => { }, resourceConfig: { instanceCount: 1, - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.P3, ec2.InstanceSize.XLarge2), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.P3, ec2.InstanceSize.XLARGE2), volumeSizeInGB: 50, volumeKmsKeyId: kmsKey, }, @@ -237,14 +237,14 @@ test('pass param to training job', () => { role, algorithmSpecification: { algorithmName: "BlazingText", - trainingInputMode: tasks.InputMode.File + trainingInputMode: tasks.InputMode.FILE }, inputDataConfig: [ { channelName: 'train', dataSource: { s3DataSource: { - s3DataType: tasks.S3DataType.S3Prefix, + s3DataType: tasks.S3DataType.S3_PREFIX, s3Uri: sfn.Data.stringAt('$.S3Bucket') } } @@ -255,7 +255,7 @@ test('pass param to training job', () => { }, resourceConfig: { instanceCount: 1, - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.P3, ec2.InstanceSize.XLarge2), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.P3, ec2.InstanceSize.XLARGE2), volumeSizeInGB: 50 }, stoppingCondition: { diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/test/sagemaker-transform-job.test.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/test/sagemaker-transform-job.test.ts index f2e3aef6b55c5..3b6fff57d20e7 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/test/sagemaker-transform-job.test.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/test/sagemaker-transform-job.test.ts @@ -77,7 +77,7 @@ test('create complex transform job', () => { transformDataSource: { s3DataSource: { s3Uri: 's3://inputbucket/prefix', - s3DataType: S3DataType.S3Prefix, + s3DataType: S3DataType.S3_PREFIX, } } }, @@ -87,13 +87,13 @@ test('create complex transform job', () => { }, transformResources: { instanceCount: 1, - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.P3, ec2.InstanceSize.XLarge2), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.P3, ec2.InstanceSize.XLARGE2), volumeKmsKeyId: kmsKey, }, tags: { Project: 'MyProject', }, - batchStrategy: BatchStrategy.MultiRecord, + batchStrategy: BatchStrategy.MULTI_RECORD, environment: { SOMEVAR: 'myvalue' }, @@ -149,7 +149,7 @@ test('pass param to transform job', () => { transformDataSource: { s3DataSource: { s3Uri: 's3://inputbucket/prefix', - s3DataType: S3DataType.S3Prefix, + s3DataType: S3DataType.S3_PREFIX, } } }, @@ -158,7 +158,7 @@ test('pass param to transform job', () => { }, transformResources: { instanceCount: 1, - instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.P3, ec2.InstanceSize.XLarge2), + instanceType: new ec2.InstanceTypePair(ec2.InstanceClass.P3, ec2.InstanceSize.XLARGE2), } }) }); diff --git a/packages/@aws-cdk/aws-stepfunctions/lib/input.ts b/packages/@aws-cdk/aws-stepfunctions/lib/input.ts index dedb89ad9af87..73273f13de457 100644 --- a/packages/@aws-cdk/aws-stepfunctions/lib/input.ts +++ b/packages/@aws-cdk/aws-stepfunctions/lib/input.ts @@ -10,7 +10,7 @@ export class TaskInput { * This might be a JSON-encoded object, or just a text. */ public static fromText(text: string) { - return new TaskInput(InputType.Text, text); + return new TaskInput(InputType.TEXT, text); } /** @@ -20,7 +20,7 @@ export class TaskInput { * as object values, if desired. */ public static fromObject(obj: {[key: string]: any}) { - return new TaskInput(InputType.Object, obj); + return new TaskInput(InputType.OBJECT, obj); } /** @@ -31,7 +31,7 @@ export class TaskInput { * to a task. */ public static fromDataAt(path: string) { - return new TaskInput(InputType.Text, Data.stringAt(path)); + return new TaskInput(InputType.TEXT, Data.stringAt(path)); } /** @@ -42,7 +42,7 @@ export class TaskInput { * to a task. */ public static fromContextAt(path: string) { - return new TaskInput(InputType.Text, Context.stringAt(path)); + return new TaskInput(InputType.TEXT, Context.stringAt(path)); } private constructor(public readonly type: InputType, public readonly value: any) { @@ -53,6 +53,6 @@ export class TaskInput { * The type of task input */ export enum InputType { - Text, - Object + TEXT, + OBJECT } \ No newline at end of file diff --git a/packages/decdk/examples/lambda-events.json b/packages/decdk/examples/lambda-events.json index 80d367b1e02c6..b65fd390e5f6b 100644 --- a/packages/decdk/examples/lambda-events.json +++ b/packages/decdk/examples/lambda-events.json @@ -9,9 +9,9 @@ "Properties": { "partitionKey": { "name": "ID", - "type": "String" + "type": "STRING" }, - "stream": "NewAndOldImages" + "stream": "NEW_AND_OLD_IMAGES" } }, "HelloWorldFunction": { @@ -26,7 +26,7 @@ "Param": "f" }, "events": [ - { "@aws-cdk/aws-lambda-event-sources.DynamoEventSource": { "table": { "Ref": "Table" }, "startingPosition": "TrimHorizon" } }, + { "@aws-cdk/aws-lambda-event-sources.DynamoEventSource": { "table": { "Ref": "Table" }, "startingPosition": "TRIM_HORIZON" } }, { "@aws-cdk/aws-lambda-event-sources.ApiEventSource": { "method": "GET", "path": "/hello" } }, { "@aws-cdk/aws-lambda-event-sources.ApiEventSource": { "method": "POST", "path": "/hello" } }, { "@aws-cdk/aws-lambda-event-sources.SnsEventSource": { "topic": { "Ref": "MyTopic" } } } diff --git a/packages/decdk/examples/queue-kms.json b/packages/decdk/examples/queue-kms.json index 4d46ee19b1ec4..50f7da4af5379 100644 --- a/packages/decdk/examples/queue-kms.json +++ b/packages/decdk/examples/queue-kms.json @@ -4,7 +4,7 @@ "MyQueue": { "Type": "@aws-cdk/aws-sqs.Queue", "Properties": { - "encryption": "Kms" + "encryption": "KMS" } } }