diff --git a/packages/@aws-cdk/app-delivery/lib/pipeline-deploy-stack-action.ts b/packages/@aws-cdk/app-delivery/lib/pipeline-deploy-stack-action.ts index bc8cbf9dbafa7..c2cbadccf7281 100644 --- a/packages/@aws-cdk/app-delivery/lib/pipeline-deploy-stack-action.ts +++ b/packages/@aws-cdk/app-delivery/lib/pipeline-deploy-stack-action.ts @@ -169,10 +169,10 @@ export class PipelineDeployStackAction extends cdk.Construct { function cfnCapabilities(adminPermissions: boolean, capabilities?: cfn.CloudFormationCapabilities[]): cfn.CloudFormationCapabilities[] { if (adminPermissions && capabilities === undefined) { // admin true default capability to NamedIAM and AutoExpand - return [cfn.CloudFormationCapabilities.NamedIAM, cfn.CloudFormationCapabilities.AutoExpand]; + return [cfn.CloudFormationCapabilities.NAMED_IAM, cfn.CloudFormationCapabilities.AUTO_EXPAND]; } else if (capabilities === undefined) { // else capabilities are undefined set AnonymousIAM and AutoExpand - return [cfn.CloudFormationCapabilities.AnonymousIAM, cfn.CloudFormationCapabilities.AutoExpand]; + return [cfn.CloudFormationCapabilities.ANONYMOUS_IAM, cfn.CloudFormationCapabilities.AUTO_EXPAND]; } else { // else capabilities are defined use them return capabilities; diff --git a/packages/@aws-cdk/app-delivery/test/integ.cicd.ts b/packages/@aws-cdk/app-delivery/test/integ.cicd.ts index ed56805675c1f..8012af531a9f2 100644 --- a/packages/@aws-cdk/app-delivery/test/integ.cicd.ts +++ b/packages/@aws-cdk/app-delivery/test/integ.cicd.ts @@ -10,7 +10,7 @@ const app = new cdk.App(); const stack = new cdk.Stack(app, 'CICD'); const pipeline = new codepipeline.Pipeline(stack, 'CodePipeline', { artifactBucket: new s3.Bucket(stack, 'ArtifactBucket', { - removalPolicy: cdk.RemovalPolicy.Destroy + removalPolicy: cdk.RemovalPolicy.DESTROY }) }); const sourceOutput = new codepipeline.Artifact('Artifact_CICDGitHubF8BA7ADD'); @@ -19,7 +19,7 @@ const source = new cpactions.GitHubSourceAction({ owner: 'awslabs', repo: 'aws-cdk', oauthToken: cdk.SecretValue.plainText('DummyToken'), - trigger: cpactions.GitHubTrigger.Poll, + trigger: cpactions.GitHubTrigger.POLL, output: sourceOutput, }); pipeline.addStage({ @@ -35,7 +35,7 @@ new cicd.PipelineDeployStackAction(stack, 'DeployStack', { executeChangeSetRunOrder: 999, input: sourceOutput, adminPermissions: false, - capabilities: [cfn.CloudFormationCapabilities.None], + capabilities: [cfn.CloudFormationCapabilities.NONE], }); app.synth(); 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 e97deed370e38..50103b04a020c 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 @@ -106,35 +106,35 @@ export = nodeunit.testCase({ stage: selfUpdateStage1, stack: pipelineStack, input: selfUpdatingStack.synthesizedApp, - capabilities: [cfn.CloudFormationCapabilities.NamedIAM], + capabilities: [cfn.CloudFormationCapabilities.NAMED_IAM], adminPermissions: false, }); new PipelineDeployStackAction(pipelineStack, 'DeployStack', { stage: selfUpdateStage2, stack: stackWithNoCapability, input: selfUpdatingStack.synthesizedApp, - capabilities: [cfn.CloudFormationCapabilities.None], + capabilities: [cfn.CloudFormationCapabilities.NONE], adminPermissions: false, }); new PipelineDeployStackAction(pipelineStack, 'DeployStack2', { stage: selfUpdateStage3, stack: stackWithAnonymousCapability, input: selfUpdatingStack.synthesizedApp, - capabilities: [cfn.CloudFormationCapabilities.AnonymousIAM], + capabilities: [cfn.CloudFormationCapabilities.ANONYMOUS_IAM], adminPermissions: false, }); new PipelineDeployStackAction(pipelineStack, 'DeployStack3', { stage: selfUpdateStage4, stack: stackWithAutoExpandCapability, input: selfUpdatingStack.synthesizedApp, - capabilities: [cfn.CloudFormationCapabilities.AutoExpand], + capabilities: [cfn.CloudFormationCapabilities.AUTO_EXPAND], adminPermissions: false, }); new PipelineDeployStackAction(pipelineStack, 'DeployStack4', { stage: selfUpdateStage5, stack: stackWithAnonymousAndAutoExpandCapability, input: selfUpdatingStack.synthesizedApp, - capabilities: [cfn.CloudFormationCapabilities.AnonymousIAM, cfn.CloudFormationCapabilities.AutoExpand], + capabilities: [cfn.CloudFormationCapabilities.ANONYMOUS_IAM, cfn.CloudFormationCapabilities.AUTO_EXPAND], adminPermissions: false, }); expect(pipelineStack).to(haveResource('AWS::CodePipeline::Pipeline', hasPipelineAction({ diff --git a/packages/@aws-cdk/assert/test/test.have-resource.ts b/packages/@aws-cdk/assert/test/test.have-resource.ts index 75153eb780ed0..adf85aa27528c 100644 --- a/packages/@aws-cdk/assert/test/test.have-resource.ts +++ b/packages/@aws-cdk/assert/test/test.have-resource.ts @@ -95,7 +95,7 @@ export = { function mkStack(template: any): cxapi.CloudFormationStackArtifact { const assembly = new cxapi.CloudAssemblyBuilder(); assembly.addArtifact('test', { - type: cxapi.ArtifactType.AwsCloudFormationStack, + type: cxapi.ArtifactType.AWS_CLOUDFORMATION_STACK, environment: cxapi.EnvironmentUtils.format('123456789', 'us-west-2'), properties: { templateFile: 'template.json' diff --git a/packages/@aws-cdk/assets/lib/fs/copy.ts b/packages/@aws-cdk/assets/lib/fs/copy.ts index ea011bb3a22a6..543b64a4e5f22 100644 --- a/packages/@aws-cdk/assets/lib/fs/copy.ts +++ b/packages/@aws-cdk/assets/lib/fs/copy.ts @@ -5,7 +5,7 @@ import { FollowMode } from './follow-mode'; import { shouldExclude, shouldFollow } from './utils'; export function copyDirectory(srcDir: string, destDir: string, options: CopyOptions = { }, rootDir?: string) { - const follow = options.follow !== undefined ? options.follow : FollowMode.External; + const follow = options.follow !== undefined ? options.follow : FollowMode.EXTERNAL; const exclude = options.exclude || []; rootDir = rootDir || srcDir; @@ -24,7 +24,7 @@ export function copyDirectory(srcDir: string, destDir: string, options: CopyOpti const destFilePath = path.join(destDir, file); - let stat: fs.Stats | undefined = follow === FollowMode.Always + let stat: fs.Stats | undefined = follow === FollowMode.ALWAYS ? fs.statSync(sourceFilePath) : fs.lstatSync(sourceFilePath); diff --git a/packages/@aws-cdk/assets/lib/fs/fingerprint.ts b/packages/@aws-cdk/assets/lib/fs/fingerprint.ts index 7ff15fe38383c..750e541b94eaf 100644 --- a/packages/@aws-cdk/assets/lib/fs/fingerprint.ts +++ b/packages/@aws-cdk/assets/lib/fs/fingerprint.ts @@ -32,7 +32,7 @@ export interface FingerprintOptions extends CopyOptions { export function fingerprint(fileOrDirectory: string, options: FingerprintOptions = { }) { const hash = crypto.createHash('sha256'); _hashField(hash, 'options.extra', options.extra || ''); - const follow = options.follow || FollowMode.External; + const follow = options.follow || FollowMode.EXTERNAL; _hashField(hash, 'options.follow', follow); const rootDirectory = fs.statSync(fileOrDirectory).isDirectory() diff --git a/packages/@aws-cdk/assets/lib/fs/follow-mode.ts b/packages/@aws-cdk/assets/lib/fs/follow-mode.ts index 9334328982236..81f81a36eac24 100644 --- a/packages/@aws-cdk/assets/lib/fs/follow-mode.ts +++ b/packages/@aws-cdk/assets/lib/fs/follow-mode.ts @@ -2,17 +2,17 @@ export enum FollowMode { /** * Never follow symlinks. */ - Never = 'never', + NEVER = 'never', /** * Materialize all symlinks, whether they are internal or external to the source directory. */ - Always = 'always', + ALWAYS = 'always', /** * Only follows symlinks that are external to the source directory. */ - External = 'external', + EXTERNAL = 'external', // ----------------- TODO:::::::::::::::::::::::::::::::::::::::::::: /** @@ -25,5 +25,5 @@ export enum FollowMode { * * If the copy operation runs into an external symlink, it will fail. */ - BlockExternal = 'internal-only', + BLOCK_EXTERNAL = 'internal-only', } diff --git a/packages/@aws-cdk/assets/lib/fs/utils.ts b/packages/@aws-cdk/assets/lib/fs/utils.ts index 7f5ec315538c7..a63717f46e49a 100644 --- a/packages/@aws-cdk/assets/lib/fs/utils.ts +++ b/packages/@aws-cdk/assets/lib/fs/utils.ts @@ -42,13 +42,13 @@ export function shouldExclude(exclude: string[], filePath: string): boolean { */ export function shouldFollow(mode: FollowMode, sourceRoot: string, realPath: string): boolean { switch (mode) { - case FollowMode.Always: + case FollowMode.ALWAYS: return fs.existsSync(realPath); - case FollowMode.External: + case FollowMode.EXTERNAL: return !_isInternal() && fs.existsSync(realPath); - case FollowMode.BlockExternal: + case FollowMode.BLOCK_EXTERNAL: return _isInternal() && fs.existsSync(realPath); - case FollowMode.Never: + case FollowMode.NEVER: return false; default: throw new Error(`Unsupported FollowMode: ${mode}`); diff --git a/packages/@aws-cdk/assets/test/fs/test.fs-copy.ts b/packages/@aws-cdk/assets/test/fs/test.fs-copy.ts index ac0693d70d361..f4874911f948a 100644 --- a/packages/@aws-cdk/assets/test/fs/test.fs-copy.ts +++ b/packages/@aws-cdk/assets/test/fs/test.fs-copy.ts @@ -35,7 +35,7 @@ export = { // WHEN copyDirectory(path.join(__dirname, 'fixtures', 'symlinks'), outdir, { - follow: FollowMode.Always + follow: FollowMode.ALWAYS }); // THEN @@ -60,7 +60,7 @@ export = { // WHEN copyDirectory(path.join(__dirname, 'fixtures', 'symlinks'), outdir, { - follow: FollowMode.Never + follow: FollowMode.NEVER }); // THEN @@ -83,7 +83,7 @@ export = { // WHEN copyDirectory(path.join(__dirname, 'fixtures', 'symlinks'), outdir, { - follow: FollowMode.External + follow: FollowMode.EXTERNAL }); // THEN diff --git a/packages/@aws-cdk/assets/test/fs/test.fs-fingerprint.ts b/packages/@aws-cdk/assets/test/fs/test.fs-fingerprint.ts index 8d4f76ce617d4..0868909051b6e 100644 --- a/packages/@aws-cdk/assets/test/fs/test.fs-fingerprint.ts +++ b/packages/@aws-cdk/assets/test/fs/test.fs-fingerprint.ts @@ -139,15 +139,15 @@ export = { // now dir2 contains a symlink to a file in dir1 // WHEN - const original = libfs.fingerprint(dir2, { follow: libfs.FollowMode.Never }); + const original = libfs.fingerprint(dir2, { follow: libfs.FollowMode.NEVER }); // now change the contents of the target fs.writeFileSync(target, 'changning you!'); - const afterChange = libfs.fingerprint(dir2, { follow: libfs.FollowMode.Never }); + const afterChange = libfs.fingerprint(dir2, { follow: libfs.FollowMode.NEVER }); // revert the content to original and expect hash to be reverted fs.writeFileSync(target, content); - const afterRevert = libfs.fingerprint(dir2, { follow: libfs.FollowMode.Never }); + const afterRevert = libfs.fingerprint(dir2, { follow: libfs.FollowMode.NEVER }); // THEN test.deepEqual(original, afterChange); diff --git a/packages/@aws-cdk/assets/test/fs/test.utils.ts b/packages/@aws-cdk/assets/test/fs/test.utils.ts index c0c4107be43e3..d0d4cde73dcea 100644 --- a/packages/@aws-cdk/assets/test/fs/test.utils.ts +++ b/packages/@aws-cdk/assets/test/fs/test.utils.ts @@ -34,7 +34,7 @@ export = { const mockFsExists = ImportMock.mockFunction(fs, 'existsSync', true); try { - test.ok(util.shouldFollow(FollowMode.Always, sourceRoot, linkTarget)); + test.ok(util.shouldFollow(FollowMode.ALWAYS, sourceRoot, linkTarget)); test.ok(mockFsExists.calledOnceWith(linkTarget)); test.done(); } finally { @@ -47,7 +47,7 @@ export = { const linkTarget = path.join('alternate', 'referent'); const mockFsExists = ImportMock.mockFunction(fs, 'existsSync', true); try { - test.ok(util.shouldFollow(FollowMode.Always, sourceRoot, linkTarget)); + test.ok(util.shouldFollow(FollowMode.ALWAYS, sourceRoot, linkTarget)); test.ok(mockFsExists.calledOnceWith(linkTarget)); test.done(); } finally { @@ -60,7 +60,7 @@ export = { const linkTarget = path.join(sourceRoot, 'referent'); const mockFsExists = ImportMock.mockFunction(fs, 'existsSync', false); try { - test.ok(!util.shouldFollow(FollowMode.Always, sourceRoot, linkTarget)); + test.ok(!util.shouldFollow(FollowMode.ALWAYS, sourceRoot, linkTarget)); test.ok(mockFsExists.calledOnceWith(linkTarget)); test.done(); } finally { @@ -73,7 +73,7 @@ export = { const linkTarget = path.join('alternate', 'referent'); const mockFsExists = ImportMock.mockFunction(fs, 'existsSync', false); try { - test.ok(!util.shouldFollow(FollowMode.Always, sourceRoot, linkTarget)); + test.ok(!util.shouldFollow(FollowMode.ALWAYS, sourceRoot, linkTarget)); test.ok(mockFsExists.calledOnceWith(linkTarget)); test.done(); } finally { @@ -88,7 +88,7 @@ export = { const linkTarget = path.join(sourceRoot, 'referent'); const mockFsExists = ImportMock.mockFunction(fs, 'existsSync'); try { - test.ok(!util.shouldFollow(FollowMode.External, sourceRoot, linkTarget)); + test.ok(!util.shouldFollow(FollowMode.EXTERNAL, sourceRoot, linkTarget)); test.ok(mockFsExists.notCalled); test.done(); } finally { @@ -101,7 +101,7 @@ export = { const linkTarget = path.join('alternate', 'referent'); const mockFsExists = ImportMock.mockFunction(fs, 'existsSync', true); try { - test.ok(util.shouldFollow(FollowMode.External, sourceRoot, linkTarget)); + test.ok(util.shouldFollow(FollowMode.EXTERNAL, sourceRoot, linkTarget)); test.ok(mockFsExists.calledOnceWith(linkTarget)); test.done(); } finally { @@ -114,7 +114,7 @@ export = { const linkTarget = path.join('alternate', 'referent'); const mockFsExists = ImportMock.mockFunction(fs, 'existsSync', false); try { - test.ok(!util.shouldFollow(FollowMode.External, sourceRoot, linkTarget)); + test.ok(!util.shouldFollow(FollowMode.EXTERNAL, sourceRoot, linkTarget)); test.ok(mockFsExists.calledOnceWith(linkTarget)); test.done(); } finally { @@ -129,7 +129,7 @@ export = { const linkTarget = path.join(sourceRoot, 'referent'); const mockFsExists = ImportMock.mockFunction(fs, 'existsSync', true); try { - test.ok(util.shouldFollow(FollowMode.BlockExternal, sourceRoot, linkTarget)); + test.ok(util.shouldFollow(FollowMode.BLOCK_EXTERNAL, sourceRoot, linkTarget)); test.ok(mockFsExists.calledOnceWith(linkTarget)); test.done(); } finally { @@ -142,7 +142,7 @@ export = { const linkTarget = path.join(sourceRoot, 'referent'); const mockFsExists = ImportMock.mockFunction(fs, 'existsSync', false); try { - test.ok(!util.shouldFollow(FollowMode.BlockExternal, sourceRoot, linkTarget)); + test.ok(!util.shouldFollow(FollowMode.BLOCK_EXTERNAL, sourceRoot, linkTarget)); test.ok(mockFsExists.calledOnceWith(linkTarget)); test.done(); } finally { @@ -155,7 +155,7 @@ export = { const linkTarget = path.join('alternate', 'referent'); const mockFsExists = ImportMock.mockFunction(fs, 'existsSync'); try { - test.ok(!util.shouldFollow(FollowMode.BlockExternal, sourceRoot, linkTarget)); + test.ok(!util.shouldFollow(FollowMode.BLOCK_EXTERNAL, sourceRoot, linkTarget)); test.ok(mockFsExists.notCalled); test.done(); } finally { @@ -170,7 +170,7 @@ export = { const linkTarget = path.join(sourceRoot, 'referent'); const mockFsExists = ImportMock.mockFunction(fs, 'existsSync'); try { - test.ok(!util.shouldFollow(FollowMode.Never, sourceRoot, linkTarget)); + test.ok(!util.shouldFollow(FollowMode.NEVER, sourceRoot, linkTarget)); test.ok(mockFsExists.notCalled); test.done(); } finally { @@ -183,7 +183,7 @@ export = { const linkTarget = path.join('alternate', 'referent'); const mockFsExists = ImportMock.mockFunction(fs, 'existsSync'); try { - test.ok(!util.shouldFollow(FollowMode.Never, sourceRoot, linkTarget)); + test.ok(!util.shouldFollow(FollowMode.NEVER, sourceRoot, linkTarget)); test.ok(mockFsExists.notCalled); test.done(); } finally { diff --git a/packages/@aws-cdk/aws-apigateway/lib/deployment.ts b/packages/@aws-cdk/aws-apigateway/lib/deployment.ts index df826231200f1..cdaf4b49b2d18 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/deployment.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/deployment.ts @@ -72,7 +72,7 @@ export class Deployment extends Resource { }); if (props.retainDeployments) { - this.resource.options.deletionPolicy = CfnDeletionPolicy.Retain; + this.resource.options.deletionPolicy = CfnDeletionPolicy.RETAIN; } this.api = props.api; diff --git a/packages/@aws-cdk/aws-apigateway/lib/usage-plan.ts b/packages/@aws-cdk/aws-apigateway/lib/usage-plan.ts index 9ecf72f2a0b1e..e6428b2a912f1 100644 --- a/packages/@aws-cdk/aws-apigateway/lib/usage-plan.ts +++ b/packages/@aws-cdk/aws-apigateway/lib/usage-plan.ts @@ -79,7 +79,7 @@ export interface ThrottlingPerMethod { * Type of Usage Plan Key. Currently the only supported type is 'ApiKey' */ export enum UsagePlanKeyType { - ApiKey = 'API_KEY' + API_KEY = 'API_KEY' } /** @@ -181,7 +181,7 @@ export class UsagePlan extends Resource { public addApiKey(apiKey: IApiKey): void { new CfnUsagePlanKey(this, 'UsagePlanKeyResource', { keyId: apiKey.keyId, - keyType: UsagePlanKeyType.ApiKey, + keyType: UsagePlanKeyType.API_KEY, usagePlanId: this.usagePlanId }); } diff --git a/packages/@aws-cdk/aws-apigateway/package-lock.json b/packages/@aws-cdk/aws-apigateway/package-lock.json index 065923a2596cb..03cde648777f0 100644 --- a/packages/@aws-cdk/aws-apigateway/package-lock.json +++ b/packages/@aws-cdk/aws-apigateway/package-lock.json @@ -1,5 +1,120 @@ { "name": "@aws-cdk/aws-apigateway", - "version": "0.33.0", - "lockfileVersion": 1 + "version": "0.35.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@aws-cdk/assert": { + "version": "0.35.0", + "dev": true, + "requires": { + "@aws-cdk/cdk": "^0.35.0", + "@aws-cdk/cloudformation-diff": "^0.35.0", + "@aws-cdk/cx-api": "^0.35.0", + "jest": "^24.8.0", + "source-map-support": "^0.5.12" + } + }, + "@aws-cdk/aws-ec2": { + "version": "0.35.0", + "dev": true, + "requires": { + "@aws-cdk/aws-cloudwatch": "^0.35.0", + "@aws-cdk/aws-iam": "^0.35.0", + "@aws-cdk/aws-ssm": "^0.35.0", + "@aws-cdk/cdk": "^0.35.0", + "@aws-cdk/cx-api": "^0.35.0" + } + }, + "@aws-cdk/aws-elasticloadbalancingv2": { + "version": "0.35.0", + "requires": { + "@aws-cdk/aws-certificatemanager": "^0.35.0", + "@aws-cdk/aws-cloudwatch": "^0.35.0", + "@aws-cdk/aws-ec2": "^0.35.0", + "@aws-cdk/aws-iam": "^0.35.0", + "@aws-cdk/aws-s3": "^0.35.0", + "@aws-cdk/cdk": "^0.35.0" + } + }, + "@aws-cdk/aws-iam": { + "version": "0.35.0", + "requires": { + "@aws-cdk/cdk": "^0.35.0", + "@aws-cdk/region-info": "^0.35.0" + } + }, + "@aws-cdk/aws-lambda": { + "version": "0.35.0", + "requires": { + "@aws-cdk/aws-cloudwatch": "^0.35.0", + "@aws-cdk/aws-ec2": "^0.35.0", + "@aws-cdk/aws-events": "^0.35.0", + "@aws-cdk/aws-iam": "^0.35.0", + "@aws-cdk/aws-logs": "^0.35.0", + "@aws-cdk/aws-s3": "^0.35.0", + "@aws-cdk/aws-s3-assets": "^0.35.0", + "@aws-cdk/aws-sqs": "^0.35.0", + "@aws-cdk/cdk": "^0.35.0", + "@aws-cdk/cx-api": "^0.35.0" + } + }, + "@aws-cdk/cdk": { + "version": "0.35.0", + "requires": { + "@aws-cdk/cx-api": "^0.35.0" + } + }, + "cdk-build-tools": { + "version": "0.35.0", + "dev": true, + "requires": { + "awslint": "^0.35.0", + "colors": "^1.3.3", + "fs-extra": "^8.0.1", + "jest": "^24.8.0", + "jsii": "^0.11.3", + "jsii-pacmak": "^0.11.3", + "nodeunit": "^0.11.3", + "nyc": "^14.1.1", + "ts-jest": "^24.0.2", + "tslint": "^5.17.0", + "typescript": "^3.5.2", + "yargs": "^13.2.4" + } + }, + "cdk-integ-tools": { + "version": "0.35.0", + "dev": true, + "requires": { + "@aws-cdk/cloudformation-diff": "^0.35.0", + "@aws-cdk/cx-api": "^0.35.0", + "aws-cdk": "^0.35.0", + "fs-extra": "^8.0.1", + "yargs": "^13.2.4" + } + }, + "cfn2ts": { + "version": "0.35.0", + "dev": true, + "requires": { + "@aws-cdk/cfnspec": "^0.35.0", + "codemaker": "^0.11.3", + "fast-json-patch": "^2.1.0", + "fs-extra": "^8.0.1", + "yargs": "^13.2.4" + } + }, + "pkglint": { + "version": "0.35.0", + "dev": true, + "requires": { + "case": "^1.6.1", + "colors": "^1.3.3", + "fs-extra": "^8.0.1", + "semver": "^6.1.1", + "yargs": "^13.2.4" + } + } + } } 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 2ae6e6e0c4bb3..652eab00e4cc3 100644 --- a/packages/@aws-cdk/aws-autoscaling/lib/auto-scaling-group.ts +++ b/packages/@aws-cdk/aws-autoscaling/lib/auto-scaling-group.ts @@ -487,7 +487,7 @@ export class AutoScalingGroup extends AutoScalingGroupBase implements this.targetGroupArns.push(targetGroup.targetGroupArn); this.albTargetGroup = targetGroup; targetGroup.registerConnectable(this); - return { targetType: elbv2.TargetType.Instance }; + return { targetType: elbv2.TargetType.INSTANCE }; } /** @@ -495,7 +495,7 @@ export class AutoScalingGroup extends AutoScalingGroupBase implements */ public attachToNetworkTargetGroup(targetGroup: elbv2.NetworkTargetGroup): elbv2.LoadBalancerTargetProps { this.targetGroupArns.push(targetGroup.targetGroupArn); - return { targetType: elbv2.TargetType.Instance }; + return { targetType: elbv2.TargetType.INSTANCE }; } /** diff --git a/packages/@aws-cdk/aws-cloudformation/lib/cloud-formation-capabilities.ts b/packages/@aws-cdk/aws-cloudformation/lib/cloud-formation-capabilities.ts index e1437d1c13704..0c2e054bf9d73 100644 --- a/packages/@aws-cdk/aws-cloudformation/lib/cloud-formation-capabilities.ts +++ b/packages/@aws-cdk/aws-cloudformation/lib/cloud-formation-capabilities.ts @@ -8,7 +8,7 @@ export enum CloudFormationCapabilities { * Pass this capability if you wish to block the creation IAM resources. * @link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#using-iam-capabilities */ - None = '', + NONE = '', /** * Capability to create anonymous IAM resources @@ -16,7 +16,7 @@ export enum CloudFormationCapabilities { * Pass this capability if you're only creating anonymous resources. * @link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#using-iam-capabilities */ - AnonymousIAM = 'CAPABILITY_IAM', + ANONYMOUS_IAM = 'CAPABILITY_IAM', /** * Capability to create named IAM resources. @@ -27,7 +27,7 @@ export enum CloudFormationCapabilities { * `CloudFormationCapabilities.NamedIAM` implies `CloudFormationCapabilities.IAM`; you don't have to pass both. * @link https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html#using-iam-capabilities */ - NamedIAM = 'CAPABILITY_NAMED_IAM', + NAMED_IAM = 'CAPABILITY_NAMED_IAM', /** * Capability to run CloudFormation macros @@ -36,5 +36,5 @@ export enum CloudFormationCapabilities { * * @link https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateStack.html */ - AutoExpand = 'CAPABILITY_AUTO_EXPAND' + AUTO_EXPAND = 'CAPABILITY_AUTO_EXPAND' } diff --git a/packages/@aws-cdk/aws-cloudformation/lib/custom-resource.ts b/packages/@aws-cdk/aws-cloudformation/lib/custom-resource.ts index dbcc01316c8b6..a213b16c9887a 100644 --- a/packages/@aws-cdk/aws-cloudformation/lib/custom-resource.ts +++ b/packages/@aws-cdk/aws-cloudformation/lib/custom-resource.ts @@ -97,7 +97,7 @@ export class CustomResource extends Resource { } }); - this.resource.applyRemovalPolicy(props.removalPolicy, { default: RemovalPolicy.Destroy }); + this.resource.applyRemovalPolicy(props.removalPolicy, { default: RemovalPolicy.DESTROY }); } public getAtt(attributeName: string) { diff --git a/packages/@aws-cdk/aws-cloudformation/test/test.resource.ts b/packages/@aws-cdk/aws-cloudformation/test/test.resource.ts index be3f7af39aa57..e2e583f0b4829 100644 --- a/packages/@aws-cdk/aws-cloudformation/test/test.resource.ts +++ b/packages/@aws-cdk/aws-cloudformation/test/test.resource.ts @@ -30,7 +30,7 @@ export = testCase({ const stack = new cdk.Stack(app, 'Test'); // WHEN - new TestCustomResource(stack, 'Custom', { removalPolicy: cdk.RemovalPolicy.Destroy }); + new TestCustomResource(stack, 'Custom', { removalPolicy: cdk.RemovalPolicy.DESTROY }); // THEN expect(stack).to(haveResource('AWS::CloudFormation::CustomResource', {}, ResourcePart.CompleteDefinition)); @@ -45,7 +45,7 @@ export = testCase({ const stack = new cdk.Stack(app, 'Test'); // WHEN - new TestCustomResource(stack, 'Custom', { removalPolicy: cdk.RemovalPolicy.Retain }); + new TestCustomResource(stack, 'Custom', { removalPolicy: cdk.RemovalPolicy.RETAIN }); // THEN expect(stack).to(haveResource('AWS::CloudFormation::CustomResource', { diff --git a/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-bucket-logging.ts b/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-bucket-logging.ts index 02404fe3cf435..24f1c26d0f0ec 100644 --- a/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-bucket-logging.ts +++ b/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-bucket-logging.ts @@ -7,7 +7,7 @@ const app = new cdk.App(); const stack = new cdk.Stack(app, 'aws-cdk-cloudfront-custom'); const loggingBucket = new s3.Bucket(stack, 'Bucket', { - removalPolicy: cdk.RemovalPolicy.Destroy + removalPolicy: cdk.RemovalPolicy.DESTROY }); new cloudfront.CloudFrontWebDistribution(stack, 'AnAmazingWebsiteProbably', { diff --git a/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-ipv6-disabled.ts b/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-ipv6-disabled.ts index 6f488abca5ea7..e967fece81253 100644 --- a/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-ipv6-disabled.ts +++ b/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-ipv6-disabled.ts @@ -8,7 +8,7 @@ const app = new cdk.App(); const stack = new cdk.Stack(app, 'aws-cdk-cloudfront'); const sourceBucket = new s3.Bucket(stack, 'Bucket', { - removalPolicy: cdk.RemovalPolicy.Destroy + removalPolicy: cdk.RemovalPolicy.DESTROY }); new cloudfront.CloudFrontWebDistribution(stack, 'MyDistribution', { 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 70f7fcd46f811..81154a8800cc9 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 @@ -8,7 +8,7 @@ const app = new cdk.App(); const stack = new cdk.Stack(app, 'aws-cdk-cloudfront'); const sourceBucket = new s3.Bucket(stack, 'Bucket', { - removalPolicy: cdk.RemovalPolicy.Destroy + removalPolicy: cdk.RemovalPolicy.DESTROY }); const lambdaFunction = new lambda.Function(stack, 'Lambda', { diff --git a/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-s3.ts b/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-s3.ts index 19612e6d83a6e..2659f51263336 100644 --- a/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-s3.ts +++ b/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront-s3.ts @@ -6,7 +6,7 @@ import cloudfront = require('../lib'); const app = new cdk.App(); const stack = new cdk.Stack(app, 'integ-cloudfront-s3'); -const bucket = new s3.Bucket(stack, 'Bucket', { removalPolicy: cdk.RemovalPolicy.Destroy }); +const bucket = new s3.Bucket(stack, 'Bucket', { removalPolicy: cdk.RemovalPolicy.DESTROY }); const oai = new cloudfront.CfnCloudFrontOriginAccessIdentity(stack, 'OAI', { cloudFrontOriginAccessIdentityConfig: { comment: 'Allows CloudFront to reach to the bucket!', diff --git a/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront.ts b/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront.ts index 655600e34fb07..9fb179e55e6bf 100644 --- a/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront.ts +++ b/packages/@aws-cdk/aws-cloudfront/test/integ.cloudfront.ts @@ -8,7 +8,7 @@ const app = new cdk.App(); const stack = new cdk.Stack(app, 'aws-cdk-cloudfront'); const sourceBucket = new s3.Bucket(stack, 'Bucket', { - removalPolicy: cdk.RemovalPolicy.Destroy + removalPolicy: cdk.RemovalPolicy.DESTROY }); new cloudfront.CloudFrontWebDistribution(stack, 'MyDistribution', { diff --git a/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail.lit.ts b/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail.lit.ts index 0f87444828aba..36d047ec1660b 100644 --- a/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail.lit.ts +++ b/packages/@aws-cdk/aws-cloudtrail/test/integ.cloudtrail.lit.ts @@ -5,7 +5,7 @@ import cloudtrail = require('../lib'); const app = new cdk.App(); const stack = new cdk.Stack(app, 'integ-cloudtrail'); -const bucket = new s3.Bucket(stack, 'Bucket', { removalPolicy: cdk.RemovalPolicy.Destroy }); +const bucket = new s3.Bucket(stack, 'Bucket', { removalPolicy: cdk.RemovalPolicy.DESTROY }); const trail = new cloudtrail.Trail(stack, 'Trail'); trail.addS3EventSelector([bucket.arnForObjects('')]); diff --git a/packages/@aws-cdk/aws-codebuild/test/integ.caching.ts b/packages/@aws-cdk/aws-codebuild/test/integ.caching.ts index 0646a552933ab..1b0d23ef83a54 100644 --- a/packages/@aws-cdk/aws-codebuild/test/integ.caching.ts +++ b/packages/@aws-cdk/aws-codebuild/test/integ.caching.ts @@ -9,7 +9,7 @@ const app = new cdk.App(); const stack = new cdk.Stack(app, 'aws-cdk-codebuild'); const bucket = new s3.Bucket(stack, 'CacheBucket', { - removalPolicy: cdk.RemovalPolicy.Destroy + removalPolicy: cdk.RemovalPolicy.DESTROY }); new codebuild.Project(stack, 'MyProject', { 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 6698aee216a1d..837c5f0dd1b9d 100644 --- a/packages/@aws-cdk/aws-codebuild/test/integ.project-bucket.ts +++ b/packages/@aws-cdk/aws-codebuild/test/integ.project-bucket.ts @@ -8,7 +8,7 @@ const app = new cdk.App(); const stack = new cdk.Stack(app, 'aws-cdk-codebuild'); const bucket = new s3.Bucket(stack, 'MyBucket', { - removalPolicy: cdk.RemovalPolicy.Destroy + removalPolicy: cdk.RemovalPolicy.DESTROY }); new codebuild.Project(stack, 'MyProject', { diff --git a/packages/@aws-cdk/aws-codebuild/test/integ.project-secondary-sources-artifacts.ts b/packages/@aws-cdk/aws-codebuild/test/integ.project-secondary-sources-artifacts.ts index c407760563df1..322672300fe5b 100644 --- a/packages/@aws-cdk/aws-codebuild/test/integ.project-secondary-sources-artifacts.ts +++ b/packages/@aws-cdk/aws-codebuild/test/integ.project-secondary-sources-artifacts.ts @@ -7,7 +7,7 @@ const app = new cdk.App(); const stack = new cdk.Stack(app, 'aws-cdk-codebuild-secondary-sources-artifacts'); const bucket = new s3.Bucket(stack, 'MyBucket', { - removalPolicy: cdk.RemovalPolicy.Destroy + removalPolicy: cdk.RemovalPolicy.DESTROY }); new codebuild.Project(stack, 'MyProject', { 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 ecfd55aa4a6cc..d4f454d8d0b7d 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 @@ -95,8 +95,8 @@ export = { const alb = new lbv2.ApplicationLoadBalancer(stack, 'ALB', { vpc: new ec2.Vpc(stack, 'VPC'), }); - const listener = alb.addListener('Listener', { protocol: lbv2.ApplicationProtocol.Http }); - const targetGroup = listener.addTargets('Fleet', { protocol: lbv2.ApplicationProtocol.Http }); + const listener = alb.addListener('Listener', { protocol: lbv2.ApplicationProtocol.HTTP }); + const targetGroup = listener.addTargets('Fleet', { protocol: lbv2.ApplicationProtocol.HTTP }); new codedeploy.ServerDeploymentGroup(stack, 'DeploymentGroup', { loadBalancer: codedeploy.LoadBalancer.application(targetGroup), 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 5721604717374..c26d8d1b77244 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 @@ -222,7 +222,7 @@ export abstract class CloudFormationDeployAction extends CloudFormationAction { constructor(props: CloudFormationDeployActionProps, configuration: any) { const capabilities = props.adminPermissions && props.capabilities === undefined - ? [cloudformation.CloudFormationCapabilities.NamedIAM] + ? [cloudformation.CloudFormationCapabilities.NAMED_IAM] : props.capabilities; super(props, { ...configuration, 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 02216174ba02d..4c80a4f93c03e 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 @@ -6,9 +6,9 @@ import { sourceArtifactBounds } from '../common'; * If and how the GitHub source action should be triggered */ export enum GitHubTrigger { - None = 'None', - Poll = 'Poll', - WebHook = 'WebHook', + NONE = 'None', + POLL = 'Poll', + WEBHOOK = 'WebHook', } /** @@ -78,7 +78,7 @@ export class GitHubSourceAction extends codepipeline.Action { Repo: props.repo, Branch: props.branch || "master", OAuthToken: props.oauthToken.toString(), - PollForSourceChanges: props.trigger === GitHubTrigger.Poll, + PollForSourceChanges: props.trigger === GitHubTrigger.POLL, }, }); @@ -86,7 +86,7 @@ export class GitHubSourceAction extends codepipeline.Action { } protected bind(info: codepipeline.ActionBind): void { - if (!this.props.trigger || this.props.trigger === GitHubTrigger.WebHook) { + if (!this.props.trigger || this.props.trigger === GitHubTrigger.WEBHOOK) { new codepipeline.CfnWebhook(info.scope, 'WebhookResource', { authentication: 'GITHUB_HMAC', authenticationConfiguration: { diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/cloudformation/test.cloudformation-pipeline-actions.ts b/packages/@aws-cdk/aws-codepipeline-actions/test/cloudformation/test.cloudformation-pipeline-actions.ts index fa9f684faab68..3ae23fa3c5be6 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/cloudformation/test.cloudformation-pipeline-actions.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/cloudformation/test.cloudformation-pipeline-actions.ts @@ -427,7 +427,7 @@ export = { templatePath: stack.sourceOutput.atPath('template.yaml'), adminPermissions: false, capabilities: [ - CloudFormationCapabilities.NamedIAM + CloudFormationCapabilities.NAMED_IAM ] })); @@ -470,8 +470,8 @@ export = { templatePath: stack.sourceOutput.atPath('template.yaml'), adminPermissions: false, capabilities: [ - CloudFormationCapabilities.NamedIAM, - CloudFormationCapabilities.AutoExpand + CloudFormationCapabilities.NAMED_IAM, + CloudFormationCapabilities.AUTO_EXPAND ] })); @@ -514,7 +514,7 @@ export = { templatePath: stack.sourceOutput.atPath('template.yaml'), adminPermissions: false, capabilities: [ - CloudFormationCapabilities.None + CloudFormationCapabilities.NONE ] })); 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 5219adc82afce..bfd13628586f0 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 @@ -14,7 +14,7 @@ const pipeline = new codepipeline.Pipeline(stack, 'Pipeline'); const sourceStage = pipeline.addStage({ stageName: 'Source' }); const bucket = new s3.Bucket(stack, 'PipelineBucket', { versioned: true, - removalPolicy: cdk.RemovalPolicy.Destroy, + removalPolicy: cdk.RemovalPolicy.DESTROY, }); const key = 'key'; const trail = new cloudtrail.Trail(stack, 'CloudTrail'); diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-alexa-deploy.ts b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-alexa-deploy.ts index fc9c1c6cdb3f9..c8c54d0191cbc 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-alexa-deploy.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-alexa-deploy.ts @@ -9,7 +9,7 @@ const stack = new Stack(app, 'aws-cdk-codepipeline-alexa-deploy'); const bucket = new s3.Bucket(stack, 'PipelineBucket', { versioned: true, - removalPolicy: RemovalPolicy.Destroy, + removalPolicy: RemovalPolicy.DESTROY, }); const sourceOutput = new codepipeline.Artifact('SourceArtifact'); const sourceAction = new cpactions.S3SourceAction({ diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-cfn-cross-region.ts b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-cfn-cross-region.ts index 891774d4eb951..ef81b1faeaa6b 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-cfn-cross-region.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-cfn-cross-region.ts @@ -14,7 +14,7 @@ const stack = new cdk.Stack(app, 'aws-cdk-codepipeline-cloudformation-cross-regi const bucket = new s3.Bucket(stack, 'MyBucket', { versioned: true, - removalPolicy: cdk.RemovalPolicy.Destroy, + removalPolicy: cdk.RemovalPolicy.DESTROY, }); const sourceOutput = new codepipeline.Artifact(); diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-cfn-wtih-action-role.ts b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-cfn-wtih-action-role.ts index d095e8b5dda99..a1036a3c5895d 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-cfn-wtih-action-role.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-cfn-wtih-action-role.ts @@ -10,7 +10,7 @@ const stack = new cdk.Stack(app, 'aws-cdk-codepipeline-cloudformation-cross-regi const bucket = new s3.Bucket(stack, 'MyBucket', { versioned: true, - removalPolicy: cdk.RemovalPolicy.Destroy, + removalPolicy: cdk.RemovalPolicy.DESTROY, }); const sourceOutput = new codepipeline.Artifact(); diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-cfn.ts b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-cfn.ts index a1bfe36a4ccb7..3f1c2fe5ad070 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-cfn.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-cfn.ts @@ -13,7 +13,7 @@ const pipeline = new codepipeline.Pipeline(stack, 'Pipeline'); const bucket = new s3.Bucket(stack, 'PipelineBucket', { versioned: true, - removalPolicy: cdk.RemovalPolicy.Destroy, + removalPolicy: cdk.RemovalPolicy.DESTROY, }); const sourceOutput = new codepipeline.Artifact('SourceArtifact'); diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-build-multiple-inputs-outputs.ts b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-build-multiple-inputs-outputs.ts index c14abced15c11..3c6e6441ecd86 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-build-multiple-inputs-outputs.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-build-multiple-inputs-outputs.ts @@ -14,7 +14,7 @@ const repository = new codecommit.Repository(stack, 'MyRepo', { }); const bucket = new s3.Bucket(stack, 'MyBucket', { versioned: true, - removalPolicy: cdk.RemovalPolicy.Destroy, + removalPolicy: cdk.RemovalPolicy.DESTROY, }); const pipeline = new codepipeline.Pipeline(stack, 'Pipeline', { diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-deploy.ts b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-deploy.ts index 162bf49f700a5..7bb9d4bcf59e8 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-deploy.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-code-deploy.ts @@ -24,7 +24,7 @@ const deploymentGroup = new codedeploy.ServerDeploymentGroup(stack, 'CodeDeployG const bucket = new s3.Bucket(stack, 'CodeDeployPipelineIntegTest', { versioned: true, - removalPolicy: cdk.RemovalPolicy.Destroy, + removalPolicy: cdk.RemovalPolicy.DESTROY, }); const pipeline = new codepipeline.Pipeline(stack, 'Pipeline', { diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-ecr-source.ts b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-ecr-source.ts index 2b34b1b27996f..a0cbf55476214 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-ecr-source.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-ecr-source.ts @@ -9,7 +9,7 @@ const app = new cdk.App(); const stack = new cdk.Stack(app, 'aws-cdk-codepipeline-ecr-source'); const bucket = new s3.Bucket(stack, 'MyBucket', { - removalPolicy: cdk.RemovalPolicy.Destroy, + removalPolicy: cdk.RemovalPolicy.DESTROY, }); const pipeline = new codepipeline.Pipeline(stack, 'MyPipeline', { artifactBucket: bucket, diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-ecs-deploy.ts b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-ecs-deploy.ts index c7836b0f371b6..6c4d76223861d 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-ecs-deploy.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-ecs-deploy.ts @@ -32,7 +32,7 @@ const service = new ecs.FargateService(stack, 'FargateService', { const bucket = new s3.Bucket(stack, 'MyBucket', { versioned: true, - removalPolicy: cdk.RemovalPolicy.Destroy, + removalPolicy: cdk.RemovalPolicy.DESTROY, }); const sourceOutput = new codepipeline.Artifact('SourceArtifact'); const sourceAction = new cpactions.S3SourceAction({ diff --git a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-s3-deploy.ts b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-s3-deploy.ts index 723d9c6456825..9f01ee3374d98 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-s3-deploy.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/integ.pipeline-s3-deploy.ts @@ -9,7 +9,7 @@ const stack = new cdk.Stack(app, 'aws-cdk-codepipeline-s3-deploy'); const bucket = new s3.Bucket(stack, 'PipelineBucket', { versioned: true, - removalPolicy: cdk.RemovalPolicy.Destroy, + removalPolicy: cdk.RemovalPolicy.DESTROY, }); const sourceOutput = new codepipeline.Artifact('SourceArtifact'); const sourceAction = new cpactions.S3SourceAction({ 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 f34ef11dc7c58..f3f62f33bcec1 100644 --- a/packages/@aws-cdk/aws-codepipeline-actions/test/test.pipeline.ts +++ b/packages/@aws-cdk/aws-codepipeline-actions/test/test.pipeline.ts @@ -84,7 +84,7 @@ export = { oauthToken: SecretValue.plainText(secret.valueAsString), owner: 'foo', repo: 'bar', - trigger: cpactions.GitHubTrigger.Poll + trigger: cpactions.GitHubTrigger.POLL }), ], }); @@ -143,7 +143,7 @@ export = { oauthToken: SecretValue.plainText(secret.valueAsString), owner: 'foo', repo: 'bar', - trigger: cpactions.GitHubTrigger.None + trigger: cpactions.GitHubTrigger.NONE }), ], }); diff --git a/packages/@aws-cdk/aws-codepipeline/lib/pipeline.ts b/packages/@aws-cdk/aws-codepipeline/lib/pipeline.ts index 35bbad18dab7d..48a5dd232c61b 100644 --- a/packages/@aws-cdk/aws-codepipeline/lib/pipeline.ts +++ b/packages/@aws-cdk/aws-codepipeline/lib/pipeline.ts @@ -233,7 +233,7 @@ export class Pipeline extends PipelineBase { bucketName: PhysicalName.auto({ crossEnvironment: true }), encryptionKey, encryption: s3.BucketEncryption.KMS, - removalPolicy: RemovalPolicy.Retain + removalPolicy: RemovalPolicy.RETAIN }); } this.artifactBucket = propsBucket; diff --git a/packages/@aws-cdk/aws-ecr/test/test.repository.ts b/packages/@aws-cdk/aws-ecr/test/test.repository.ts index b0bf0e7a39365..6b9f33f12d54e 100644 --- a/packages/@aws-cdk/aws-ecr/test/test.repository.ts +++ b/packages/@aws-cdk/aws-ecr/test/test.repository.ts @@ -343,7 +343,7 @@ export = { // WHEN new ecr.Repository(stack, 'Repo', { - removalPolicy: RemovalPolicy.Destroy + removalPolicy: RemovalPolicy.DESTROY }); // THEN diff --git a/packages/@aws-cdk/aws-ecs-patterns/lib/base/load-balanced-service-base.ts b/packages/@aws-cdk/aws-ecs-patterns/lib/base/load-balanced-service-base.ts index f1239317977c7..58419cdbc1b86 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/lib/base/load-balanced-service-base.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/lib/base/load-balanced-service-base.ts @@ -6,8 +6,8 @@ import route53targets = require('@aws-cdk/aws-route53-targets'); import cdk = require('@aws-cdk/cdk'); export enum LoadBalancerType { - Application, - Network + APPLICATION, + NETWORK } /** @@ -118,9 +118,9 @@ export abstract class LoadBalancedServiceBase extends cdk.Construct { this.logDriver = enableLogging ? this.createAWSLogDriver(this.node.id) : undefined; // Load balancer - this.loadBalancerType = props.loadBalancerType !== undefined ? props.loadBalancerType : LoadBalancerType.Application; + this.loadBalancerType = props.loadBalancerType !== undefined ? props.loadBalancerType : LoadBalancerType.APPLICATION; - if (this.loadBalancerType !== LoadBalancerType.Application && this.loadBalancerType !== LoadBalancerType.Network) { + if (this.loadBalancerType !== LoadBalancerType.APPLICATION && this.loadBalancerType !== LoadBalancerType.NETWORK) { throw new Error(`invalid loadBalancerType`); } @@ -131,7 +131,7 @@ export abstract class LoadBalancedServiceBase extends cdk.Construct { internetFacing }; - if (this.loadBalancerType === LoadBalancerType.Application) { + if (this.loadBalancerType === LoadBalancerType.APPLICATION) { this.loadBalancer = new elbv2.ApplicationLoadBalancer(this, 'LB', lbProps); } else { this.loadBalancer = new elbv2.NetworkLoadBalancer(this, 'LB', lbProps); @@ -142,11 +142,11 @@ export abstract class LoadBalancedServiceBase extends cdk.Construct { }; const hasCertificate = props.certificate !== undefined; - if (hasCertificate && this.loadBalancerType !== LoadBalancerType.Application) { + if (hasCertificate && this.loadBalancerType !== LoadBalancerType.APPLICATION) { throw new Error("Cannot add certificate to an NLB"); } - if (this.loadBalancerType === LoadBalancerType.Application) { + if (this.loadBalancerType === LoadBalancerType.APPLICATION) { this.listener = (this.loadBalancer as elbv2.ApplicationLoadBalancer).addListener('PublicListener', { port: hasCertificate ? 443 : 80, open: true @@ -177,7 +177,7 @@ export abstract class LoadBalancedServiceBase extends cdk.Construct { } protected addServiceAsTarget(service: ecs.BaseService) { - if (this.loadBalancerType === LoadBalancerType.Application) { + if (this.loadBalancerType === LoadBalancerType.APPLICATION) { (this.targetGroup as elbv2.ApplicationTargetGroup).addTarget(service); } else { (this.targetGroup as elbv2.NetworkTargetGroup).addTarget(service); diff --git a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/test.load-balanced-fargate-service.ts b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/test.load-balanced-fargate-service.ts index 3224d06c61fab..3b68abae324b0 100644 --- a/packages/@aws-cdk/aws-ecs-patterns/test/fargate/test.load-balanced-fargate-service.ts +++ b/packages/@aws-cdk/aws-ecs-patterns/test/fargate/test.load-balanced-fargate-service.ts @@ -20,7 +20,7 @@ export = { new ecsPatterns.LoadBalancedFargateService(stack, 'Service', { cluster, certificate: cert, - loadBalancerType: ecsPatterns.LoadBalancerType.Network, + loadBalancerType: ecsPatterns.LoadBalancerType.NETWORK, image: ecs.ContainerImage.fromRegistry("/aws/aws-example-app") }); }; @@ -39,7 +39,7 @@ export = { // WHEN new ecsPatterns.LoadBalancedFargateService(stack, 'Service', { cluster, - loadBalancerType: ecsPatterns.LoadBalancerType.Network, + loadBalancerType: ecsPatterns.LoadBalancerType.NETWORK, image: ecs.ContainerImage.fromRegistry("/aws/aws-example-app") }); @@ -67,7 +67,7 @@ export = { // WHEN new ecsPatterns.LoadBalancedFargateService(stack, 'Service', { cluster, - loadBalancerType: ecsPatterns.LoadBalancerType.Network, + loadBalancerType: ecsPatterns.LoadBalancerType.NETWORK, image: ecs.ContainerImage.fromRegistry("/aws/aws-example-app"), executionRole }); @@ -94,7 +94,7 @@ export = { // WHEN new ecsPatterns.LoadBalancedFargateService(stack, 'Service', { cluster, - loadBalancerType: ecsPatterns.LoadBalancerType.Network, + loadBalancerType: ecsPatterns.LoadBalancerType.NETWORK, image: ecs.ContainerImage.fromRegistry("/aws/aws-example-app"), taskRole }); @@ -114,7 +114,7 @@ export = { // WHEN new ecsPatterns.LoadBalancedFargateService(stack, 'Service', { cluster, - loadBalancerType: ecsPatterns.LoadBalancerType.Network, + loadBalancerType: ecsPatterns.LoadBalancerType.NETWORK, image: ecs.ContainerImage.fromRegistry("/aws/aws-example-app"), containerName: 'bob' }); @@ -134,7 +134,7 @@ export = { // WHEN new ecsPatterns.LoadBalancedFargateService(stack, 'Service', { cluster, - loadBalancerType: ecsPatterns.LoadBalancerType.Network, + loadBalancerType: ecsPatterns.LoadBalancerType.NETWORK, image: ecs.ContainerImage.fromRegistry("/aws/aws-example-app"), }); @@ -153,7 +153,7 @@ export = { // WHEN new ecsPatterns.LoadBalancedFargateService(stack, 'Service', { cluster, - loadBalancerType: ecsPatterns.LoadBalancerType.Network, + loadBalancerType: ecsPatterns.LoadBalancerType.NETWORK, image: ecs.ContainerImage.fromRegistry("/aws/aws-example-app"), serviceName: cdk.PhysicalName.of('bob'), }); @@ -172,7 +172,7 @@ export = { // WHEN new ecsPatterns.LoadBalancedFargateService(stack, 'Service', { cluster, - loadBalancerType: ecsPatterns.LoadBalancerType.Network, + loadBalancerType: ecsPatterns.LoadBalancerType.NETWORK, image: ecs.ContainerImage.fromRegistry("/aws/aws-example-app"), }); 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 2c0a084597f34..1eb064565016d 100644 --- a/packages/@aws-cdk/aws-ecs/lib/base/base-service.ts +++ b/packages/@aws-cdk/aws-ecs/lib/base/base-service.ts @@ -292,7 +292,7 @@ export abstract class BaseService extends Resource * Shared logic for attaching to an ELBv2 */ private attachToELBv2(targetGroup: elbv2.ITargetGroup): elbv2.LoadBalancerTargetProps { - if (this.taskDefinition.networkMode === NetworkMode.None) { + if (this.taskDefinition.networkMode === NetworkMode.NONE) { throw new Error("Cannot use a load balancer if NetworkMode is None. Use Bridge, Host or AwsVpc instead."); } @@ -306,7 +306,7 @@ export abstract class BaseService extends Resource // been associated with our target group(s), so add ordering dependency. this.resource.node.addDependency(targetGroup.loadBalancerAttached); - const targetType = this.taskDefinition.networkMode === NetworkMode.AwsVpc ? elbv2.TargetType.Ip : elbv2.TargetType.Instance; + const targetType = this.taskDefinition.networkMode === NetworkMode.AWS_VPC ? elbv2.TargetType.IP : elbv2.TargetType.INSTANCE; return { targetType }; } @@ -341,14 +341,14 @@ export abstract class BaseService extends Resource // Determine DNS type based on network mode const networkMode = this.taskDefinition.networkMode; - if (networkMode === NetworkMode.None) { + if (networkMode === NetworkMode.NONE) { throw new Error("Cannot use a service discovery if NetworkMode is None. Use Bridge, Host or AwsVpc instead."); } // Bridge or host network mode requires SRV records let dnsRecordType = options.dnsRecordType; - if (networkMode === NetworkMode.Bridge || networkMode === NetworkMode.Host) { + if (networkMode === NetworkMode.BRIDGE || networkMode === NetworkMode.HOST) { if (dnsRecordType === undefined) { dnsRecordType = cloudmap.DnsRecordType.SRV; } @@ -358,7 +358,7 @@ export abstract class BaseService extends Resource } // Default DNS record type for AwsVpc network mode is A Records - if (networkMode === NetworkMode.AwsVpc) { + if (networkMode === NetworkMode.AWS_VPC) { if (dnsRecordType === undefined) { dnsRecordType = cloudmap.DnsRecordType.A; } diff --git a/packages/@aws-cdk/aws-ecs/lib/base/task-definition.ts b/packages/@aws-cdk/aws-ecs/lib/base/task-definition.ts index d04b25c72fb3f..89fb6e85f87c0 100644 --- a/packages/@aws-cdk/aws-ecs/lib/base/task-definition.ts +++ b/packages/@aws-cdk/aws-ecs/lib/base/task-definition.ts @@ -172,7 +172,7 @@ export class TaskDefinition extends TaskDefinitionBase { public static fromTaskDefinitionArn(scope: Construct, id: string, taskDefinitionArn: string): ITaskDefinition { class Import extends TaskDefinitionBase { public readonly taskDefinitionArn = taskDefinitionArn; - public readonly compatibility = Compatibility.Ec2AndFargate; + public readonly compatibility = Compatibility.EC2_AND_FARGATE; public readonly executionRole?: iam.IRole = undefined; } @@ -242,8 +242,8 @@ export class TaskDefinition extends TaskDefinitionBase { } this.networkMode = props.networkMode !== undefined ? props.networkMode : - this.isFargateCompatible ? NetworkMode.AwsVpc : NetworkMode.Bridge; - if (this.isFargateCompatible && this.networkMode !== NetworkMode.AwsVpc) { + this.isFargateCompatible ? NetworkMode.AWS_VPC : NetworkMode.BRIDGE; + if (this.isFargateCompatible && this.networkMode !== NetworkMode.AWS_VPC) { throw new Error(`Fargate tasks can only have AwsVpc network mode, got: ${this.networkMode}`); } @@ -388,17 +388,17 @@ export enum NetworkMode { /** * The task's containers do not have external connectivity and port mappings can't be specified in the container definition. */ - None = 'none', + NONE = 'none', /** * The task utilizes Docker's built-in virtual network which runs inside each container instance. */ - Bridge = 'bridge', + BRIDGE = 'bridge', /** * The task is allocated an elastic network interface. */ - AwsVpc = 'awsvpc', + AWS_VPC = 'awsvpc', /** * The task bypasses Docker's built-in virtual network and maps container ports directly to the EC2 instance's network interface directly. @@ -406,7 +406,7 @@ export enum NetworkMode { * In this mode, you can't run multiple instantiations of the same task on a * single container instance when port mappings are used. */ - Host = 'host', + HOST = 'host', } /** @@ -475,12 +475,12 @@ export enum Scope { /** * Docker volumes are automatically provisioned when the task starts and destroyed when the task stops */ - Task = "task", + TASK = "task", /** * Docker volumes are persist after the task stops */ - Shared = "shared" + SHARED = "shared" } /** @@ -490,17 +490,17 @@ export enum Compatibility { /** * Task should be launchable on EC2 clusters */ - Ec2, + EC2, /** * Task should be launchable on Fargate clusters */ - Fargate, + FARGATE, /** * Task should be launchable on both types of clusters */ - Ec2AndFargate + EC2_AND_FARGATE } /** @@ -525,12 +525,12 @@ export interface ITaskDefinitionExtension { * Return true if the given task definition can be run on an EC2 cluster */ function isEc2Compatible(compatibility: Compatibility): boolean { - return [Compatibility.Ec2, Compatibility.Ec2AndFargate].includes(compatibility); + return [Compatibility.EC2, Compatibility.EC2_AND_FARGATE].includes(compatibility); } /** * Return true if the given task definition can be run on a Fargate cluster */ function isFargateCompatible(compatibility: Compatibility): boolean { - return [Compatibility.Fargate, Compatibility.Ec2AndFargate].includes(compatibility); + return [Compatibility.FARGATE, Compatibility.EC2_AND_FARGATE].includes(compatibility); } diff --git a/packages/@aws-cdk/aws-ecs/lib/container-definition.ts b/packages/@aws-cdk/aws-ecs/lib/container-definition.ts index 2001670bbedb3..b00e1a93b5154 100644 --- a/packages/@aws-cdk/aws-ecs/lib/container-definition.ts +++ b/packages/@aws-cdk/aws-ecs/lib/container-definition.ts @@ -272,7 +272,7 @@ export class ContainerDefinition extends cdk.Construct { * Warning: The --link flag is a legacy feature of Docker. It may eventually be removed. */ public addLink(container: ContainerDefinition, alias?: string) { - if (this.taskDefinition.networkMode !== NetworkMode.Bridge) { + if (this.taskDefinition.networkMode !== NetworkMode.BRIDGE) { throw new Error(`You must use network mode Bridge to add container links.`); } if (alias !== undefined) { @@ -316,13 +316,13 @@ export class ContainerDefinition extends cdk.Construct { */ public addPortMappings(...portMappings: PortMapping[]) { this.portMappings.push(...portMappings.map(pm => { - if (this.taskDefinition.networkMode === NetworkMode.AwsVpc || this.taskDefinition.networkMode === NetworkMode.Host) { + if (this.taskDefinition.networkMode === NetworkMode.AWS_VPC || this.taskDefinition.networkMode === NetworkMode.HOST) { if (pm.containerPort !== pm.hostPort && pm.hostPort !== undefined) { throw new Error(`Host port ${pm.hostPort} does not match container port ${pm.containerPort}.`); } } - if (this.taskDefinition.networkMode === NetworkMode.Bridge) { + if (this.taskDefinition.networkMode === NetworkMode.BRIDGE) { if (pm.hostPort === undefined) { pm = { ...pm, @@ -369,7 +369,7 @@ export class ContainerDefinition extends cdk.Construct { return defaultPortMapping.hostPort; } - if (this.taskDefinition.networkMode === NetworkMode.Bridge) { + if (this.taskDefinition.networkMode === NetworkMode.BRIDGE) { return 0; } return defaultPortMapping.containerPort; diff --git a/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-service.ts b/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-service.ts index 98e5da7eb320f..6e78c6fcea8d0 100644 --- a/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-service.ts +++ b/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-service.ts @@ -126,7 +126,7 @@ export class Ec2Service extends BaseService implements IEc2Service, elb.ILoadBal this.strategies = []; this.daemon = props.daemon || false; - if (props.taskDefinition.networkMode === NetworkMode.AwsVpc) { + if (props.taskDefinition.networkMode === NetworkMode.AWS_VPC) { this.configureAwsVpcNetworking(props.cluster.vpc, props.assignPublicIp, props.vpcSubnets, props.securityGroup); } else { // Either None, Bridge or Host networking. Copy SecurityGroup from ASG. @@ -170,10 +170,10 @@ export class Ec2Service extends BaseService implements IEc2Service, elb.ILoadBal * Don't call this. Call `loadBalancer.addTarget()` instead. */ public attachToClassicLB(loadBalancer: elb.LoadBalancer): void { - if (this.taskDefinition.networkMode === NetworkMode.Bridge) { + if (this.taskDefinition.networkMode === NetworkMode.BRIDGE) { throw new Error("Cannot use a Classic Load Balancer if NetworkMode is Bridge. Use Host or AwsVpc instead."); } - if (this.taskDefinition.networkMode === NetworkMode.None) { + if (this.taskDefinition.networkMode === NetworkMode.NONE) { throw new Error("Cannot use a load balancer if NetworkMode is None. Use Host or AwsVpc instead."); } diff --git a/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-task-definition.ts b/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-task-definition.ts index 7d2c572155e9a..088241b8aeeff 100644 --- a/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-task-definition.ts +++ b/packages/@aws-cdk/aws-ecs/lib/ec2/ec2-task-definition.ts @@ -41,7 +41,7 @@ export class Ec2TaskDefinition extends TaskDefinition implements IEc2TaskDefinit public static fromEc2TaskDefinitionArn(scope: Construct, id: string, ec2TaskDefinitionArn: string): IEc2TaskDefinition { class Import extends Resource implements IEc2TaskDefinition { public readonly taskDefinitionArn = ec2TaskDefinitionArn; - public readonly compatibility = Compatibility.Ec2; + public readonly compatibility = Compatibility.EC2; public readonly isEc2Compatible = true; public readonly isFargateCompatible = false; } @@ -51,7 +51,7 @@ export class Ec2TaskDefinition extends TaskDefinition implements IEc2TaskDefinit constructor(scope: Construct, id: string, props: Ec2TaskDefinitionProps = {}) { super(scope, id, { ...props, - compatibility: Compatibility.Ec2, + compatibility: Compatibility.EC2, placementConstraints: props.placementConstraints, }); } diff --git a/packages/@aws-cdk/aws-ecs/lib/fargate/fargate-service.ts b/packages/@aws-cdk/aws-ecs/lib/fargate/fargate-service.ts index bd92b644e0f0b..933d882bf67fd 100644 --- a/packages/@aws-cdk/aws-ecs/lib/fargate/fargate-service.ts +++ b/packages/@aws-cdk/aws-ecs/lib/fargate/fargate-service.ts @@ -97,33 +97,33 @@ export enum FargatePlatformVersion { /** * The latest, recommended platform version */ - Latest = 'LATEST', + LATEST = 'LATEST', /** * Version 1.3.0 * * Supports secrets, task recycling. */ - Version1_3 = '1.3.0', + VERSION1_3 = '1.3.0', /** * Version 1.2.0 * * Supports private registries. */ - Version1_2 = '1.2.0', + VERSION1_2 = '1.2.0', /** * Version 1.1.0 * * Supports task metadata, health checks, service discovery. */ - Version1_1 = '1.1.0', + VERSION1_1 = '1.1.0', /** * Initial release * * Based on Amazon Linux 2017.09. */ - Version1_0 = '1.0.0', + VERSION1_0 = '1.0.0', } diff --git a/packages/@aws-cdk/aws-ecs/lib/fargate/fargate-task-definition.ts b/packages/@aws-cdk/aws-ecs/lib/fargate/fargate-task-definition.ts index 3d372663feca6..f46cc50af073f 100644 --- a/packages/@aws-cdk/aws-ecs/lib/fargate/fargate-task-definition.ts +++ b/packages/@aws-cdk/aws-ecs/lib/fargate/fargate-task-definition.ts @@ -52,7 +52,7 @@ export class FargateTaskDefinition extends TaskDefinition implements IFargateTas public static fromFargateTaskDefinitionArn(scope: Construct, id: string, fargateTaskDefinitionArn: string): IFargateTaskDefinition { class Import extends Resource implements IFargateTaskDefinition { public readonly taskDefinitionArn = fargateTaskDefinitionArn; - public readonly compatibility = Compatibility.Fargate; + public readonly compatibility = Compatibility.FARGATE; public readonly isEc2Compatible = false; public readonly isFargateCompatible = true; } @@ -63,7 +63,7 @@ export class FargateTaskDefinition extends TaskDefinition implements IFargateTas /** * The configured network mode */ - public readonly networkMode: NetworkMode = NetworkMode.AwsVpc; + public readonly networkMode: NetworkMode = NetworkMode.AWS_VPC; // NOTE: Until the fix to https://github.com/Microsoft/TypeScript/issues/26969 gets released, // we need to explicitly write the type here, as type deduction for enums won't lead to // the import being generated in the .d.ts file. @@ -73,8 +73,8 @@ export class FargateTaskDefinition extends TaskDefinition implements IFargateTas ...props, cpu: props.cpu !== undefined ? String(props.cpu) : '256', memoryMiB: props.memoryLimitMiB !== undefined ? String(props.memoryLimitMiB) : '512', - compatibility: Compatibility.Fargate, - networkMode: NetworkMode.AwsVpc, + compatibility: Compatibility.FARGATE, + networkMode: NetworkMode.AWS_VPC, }); } } 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 993db77c86c9d..00c28dfd238be 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 @@ -15,7 +15,7 @@ cluster.addCapacity('DefaultAutoScalingGroup', { }); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef', { - networkMode: NetworkMode.AwsVpc + networkMode: NetworkMode.AWS_VPC }); const container = taskDefinition.addContainer('web', { 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 49628588dd28d..c050241359589 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 @@ -22,7 +22,7 @@ cluster.addDefaultCloudMapNamespace({ // Create frontend service const frontendTD = new ecs.Ec2TaskDefinition(stack, 'TaskDef', { - networkMode: NetworkMode.AwsVpc + networkMode: NetworkMode.AWS_VPC }); const frontend = frontendTD.addContainer('frontend', { 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 a01775e6c06ec..9c2ce29672652 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 @@ -208,7 +208,7 @@ export = { const cluster = new ecs.Cluster(stack, 'EcsCluster', { vpc }); cluster.addCapacity('DefaultAutoScalingGroup', { instanceType: new ec2.InstanceType('t2.micro') }); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'Ec2TaskDef', { - networkMode: NetworkMode.Bridge + networkMode: NetworkMode.BRIDGE }); taskDefinition.addContainer("web", { @@ -238,7 +238,7 @@ export = { const cluster = new ecs.Cluster(stack, 'EcsCluster', { vpc }); cluster.addCapacity('DefaultAutoScalingGroup', { instanceType: new ec2.InstanceType('t2.micro') }); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'Ec2TaskDef', { - networkMode: NetworkMode.Bridge + networkMode: NetworkMode.BRIDGE }); taskDefinition.addContainer("web", { @@ -268,7 +268,7 @@ export = { const cluster = new ecs.Cluster(stack, 'EcsCluster', { vpc }); cluster.addCapacity('DefaultAutoScalingGroup', { instanceType: new ec2.InstanceType('t2.micro') }); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'Ec2TaskDef', { - networkMode: NetworkMode.AwsVpc + networkMode: NetworkMode.AWS_VPC }); taskDefinition.addContainer("web", { @@ -316,7 +316,7 @@ export = { const cluster = new ecs.Cluster(stack, 'EcsCluster', { vpc }); cluster.addCapacity('DefaultAutoScalingGroup', { instanceType: new ec2.InstanceType('t2.micro') }); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'Ec2TaskDef', { - networkMode: NetworkMode.AwsVpc + networkMode: NetworkMode.AWS_VPC }); taskDefinition.addContainer("web", { @@ -578,7 +578,7 @@ export = { const vpc = new ec2.Vpc(stack, 'VPC'); const cluster = new ecs.Cluster(stack, 'Cluster', { vpc }); cluster.addCapacity('DefaultAutoScalingGroup', { instanceType: new ec2.InstanceType('t2.micro') }); - const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TD', { networkMode: ecs.NetworkMode.Host }); + const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TD', { networkMode: ecs.NetworkMode.HOST }); const container = taskDefinition.addContainer('web', { image: ecs.ContainerImage.fromRegistry('test'), memoryLimitMiB: 1024, @@ -648,7 +648,7 @@ export = { const cluster = new ecs.Cluster(stack, 'EcsCluster', { vpc }); cluster.addCapacity('DefaultAutoScalingGroup', { instanceType: new ec2.InstanceType('t2.micro') }); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'Ec2TaskDef', { - networkMode: NetworkMode.None + networkMode: NetworkMode.NONE }); const container = taskDefinition.addContainer('MainContainer', { image: ContainerImage.fromRegistry('hello'), @@ -756,7 +756,7 @@ export = { cluster.addCapacity('DefaultAutoScalingGroup', { instanceType: new ec2.InstanceType('t2.micro') }); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'Ec2TaskDef', { - networkMode: NetworkMode.Host + networkMode: NetworkMode.HOST }); const container = taskDefinition.addContainer('MainContainer', { image: ContainerImage.fromRegistry('hello'), @@ -867,7 +867,7 @@ export = { cluster.addCapacity('DefaultAutoScalingGroup', { instanceType: new ec2.InstanceType('t2.micro') }); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'Ec2TaskDef', { - networkMode: NetworkMode.AwsVpc + networkMode: NetworkMode.AWS_VPC }); const container = taskDefinition.addContainer('MainContainer', { image: ContainerImage.fromRegistry('hello'), @@ -942,7 +942,7 @@ export = { cluster.addCapacity('DefaultAutoScalingGroup', { instanceType: new ec2.InstanceType('t2.micro') }); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'Ec2TaskDef', { - networkMode: NetworkMode.AwsVpc + networkMode: NetworkMode.AWS_VPC }); const container = taskDefinition.addContainer('MainContainer', { image: ContainerImage.fromRegistry('hello'), 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 aa56762d8a96d..b4e948a755a68 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 @@ -17,7 +17,7 @@ export = { Family: "Ec2TaskDef", ContainerDefinitions: [], Volumes: [], - NetworkMode: ecs.NetworkMode.Bridge, + NetworkMode: ecs.NetworkMode.BRIDGE, RequiresCompatibilities: ["EC2"] })); @@ -29,12 +29,12 @@ export = { // GIVEN const stack = new cdk.Stack(); new ecs.Ec2TaskDefinition(stack, 'Ec2TaskDef', { - networkMode: ecs.NetworkMode.AwsVpc + networkMode: ecs.NetworkMode.AWS_VPC }); // THEN expect(stack).to(haveResource("AWS::ECS::TaskDefinition", { - NetworkMode: ecs.NetworkMode.AwsVpc, + NetworkMode: ecs.NetworkMode.AWS_VPC, })); test.done(); @@ -235,7 +235,7 @@ export = { name: "scratch", dockerVolumeConfiguration: { driver: "local", - scope: ecs.Scope.Task + scope: ecs.Scope.TASK } }; diff --git a/packages/@aws-cdk/aws-ecs/test/fargate/test.fargate-task-definition.ts b/packages/@aws-cdk/aws-ecs/test/fargate/test.fargate-task-definition.ts index fc5bbdd3bbc22..e84fdbd5a48ee 100644 --- a/packages/@aws-cdk/aws-ecs/test/fargate/test.fargate-task-definition.ts +++ b/packages/@aws-cdk/aws-ecs/test/fargate/test.fargate-task-definition.ts @@ -15,7 +15,7 @@ export = { Family: "FargateTaskDef", ContainerDefinitions: [], Volumes: [], - NetworkMode: ecs.NetworkMode.AwsVpc, + NetworkMode: ecs.NetworkMode.AWS_VPC, RequiresCompatibilities: ["FARGATE"], Cpu: "256", Memory: "512", 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 9e0e96a67ff8e..0084c255aba41 100644 --- a/packages/@aws-cdk/aws-ecs/test/test.container-definition.ts +++ b/packages/@aws-cdk/aws-ecs/test/test.container-definition.ts @@ -12,7 +12,7 @@ export = { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef', { - networkMode: ecs.NetworkMode.AwsVpc, + networkMode: ecs.NetworkMode.AWS_VPC, }); const container = taskDefinition.addContainer("Container", { @@ -35,7 +35,7 @@ export = { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef', { - networkMode: ecs.NetworkMode.AwsVpc, + networkMode: ecs.NetworkMode.AWS_VPC, }); const container = taskDefinition.addContainer("Container", { @@ -58,7 +58,7 @@ export = { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef', { - networkMode: ecs.NetworkMode.Host, + networkMode: ecs.NetworkMode.HOST, }); const container = taskDefinition.addContainer("Container", { @@ -81,7 +81,7 @@ export = { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef', { - networkMode: ecs.NetworkMode.Host, + networkMode: ecs.NetworkMode.HOST, }); const container = taskDefinition.addContainer("Container", { @@ -102,7 +102,7 @@ export = { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef', { - networkMode: ecs.NetworkMode.Host, + networkMode: ecs.NetworkMode.HOST, }); const container = taskDefinition.addContainer("Container", { @@ -129,7 +129,7 @@ export = { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef', { - networkMode: ecs.NetworkMode.Bridge, + networkMode: ecs.NetworkMode.BRIDGE, }); const container = taskDefinition.addContainer("Container", { @@ -156,7 +156,7 @@ export = { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef', { - networkMode: ecs.NetworkMode.AwsVpc, + networkMode: ecs.NetworkMode.AWS_VPC, }); const container = taskDefinition.addContainer("Container", { @@ -182,7 +182,7 @@ export = { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef', { - networkMode: ecs.NetworkMode.Host, + networkMode: ecs.NetworkMode.HOST, }); const container = taskDefinition.addContainer("Container", { @@ -208,7 +208,7 @@ export = { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef', { - networkMode: ecs.NetworkMode.Bridge, + networkMode: ecs.NetworkMode.BRIDGE, }); const container = taskDefinition.addContainer("Container", { @@ -233,7 +233,7 @@ export = { // GIVEN const stack = new cdk.Stack(); const taskDefinition = new ecs.Ec2TaskDefinition(stack, 'TaskDef', { - networkMode: ecs.NetworkMode.Bridge, + networkMode: ecs.NetworkMode.BRIDGE, }); const container = taskDefinition.addContainer("Container", { diff --git a/packages/@aws-cdk/aws-ecs/test/test.task-definition.ts b/packages/@aws-cdk/aws-ecs/test/test.task-definition.ts index 8bf044dd09ae4..a6a9409a559a2 100644 --- a/packages/@aws-cdk/aws-ecs/test/test.task-definition.ts +++ b/packages/@aws-cdk/aws-ecs/test/test.task-definition.ts @@ -12,7 +12,7 @@ export = { new ecs.TaskDefinition(stack, 'TD', { cpu: '512', memoryMiB: '512', - compatibility: ecs.Compatibility.Ec2AndFargate, + compatibility: ecs.Compatibility.EC2_AND_FARGATE, }); // THEN diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-listener.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-listener.ts index 0e8071e7366a8..41cf8198cf129 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-listener.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-listener.ts @@ -254,7 +254,7 @@ export class ApplicationListener extends BaseListener implements IApplicationLis */ protected validate(): string[] { const errors = super.validate(); - if (this.protocol === ApplicationProtocol.Https && this.certificateArns.length === 0) { + if (this.protocol === ApplicationProtocol.HTTPS && this.certificateArns.length === 0) { errors.push('HTTPS Listener needs at least one certificate (call addCertificateArns)'); } return errors; diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-load-balancer.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-load-balancer.ts index 3c67a0a33fba8..7897335468a2c 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-load-balancer.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/alb/application-load-balancer.ts @@ -427,7 +427,7 @@ export enum HttpCodeElb { /** * The number of HTTP 3XX redirection codes that originate from the load balancer. */ - Elb3xxCount = 'HTTPCode_ELB_3XX_Count', + ELB_3XX_COUNT = 'HTTPCode_ELB_3XX_Count', /** * The number of HTTP 4XX client error codes that originate from the load balancer. @@ -436,12 +436,12 @@ export enum HttpCodeElb { * These requests have not been received by the target. This count does not * include any response codes generated by the targets. */ - Elb4xxCount = 'HTTPCode_ELB_4XX_Count', + ELB_4XX_COUNT = 'HTTPCode_ELB_4XX_Count', /** * The number of HTTP 5XX server error codes that originate from the load balancer. */ - Elb5xxCount = 'HTTPCode_ELB_5XX_Count', + ELB_5XX_COUNT = 'HTTPCode_ELB_5XX_Count', } /** @@ -451,22 +451,22 @@ export enum HttpCodeTarget { /** * The number of 2xx response codes from targets */ - Target2xxCount = 'HTTPCode_Target_2XX_Count', + TARGET_2XX_COUNT = 'HTTPCode_Target_2XX_Count', /** * The number of 3xx response codes from targets */ - Target3xxCount = 'HTTPCode_Target_3XX_Count', + TARGET_3XX_COUNT = 'HTTPCode_Target_3XX_Count', /** * The number of 4xx response codes from targets */ - Target4xxCount = 'HTTPCode_Target_4XX_Count', + TARGET_4XX_COUNT = 'HTTPCode_Target_4XX_Count', /** * The number of 5xx response codes from targets */ - Target5xxCount = 'HTTPCode_Target_5XX_Count' + TARGET_5XX_COUNT = 'HTTPCode_Target_5XX_Count' } /** diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/nlb/network-listener.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/nlb/network-listener.ts index 112616f85a8d3..a74b31cf8a48a 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/nlb/network-listener.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/nlb/network-listener.ts @@ -87,17 +87,17 @@ export class NetworkListener extends BaseListener implements INetworkListener { constructor(scope: Construct, id: string, props: NetworkListenerProps) { const certs = props.certificates || []; - const proto = props.protocol || (certs.length > 0 ? Protocol.Tls : Protocol.Tcp); + const proto = props.protocol || (certs.length > 0 ? Protocol.TLS : Protocol.TCP); - if ([Protocol.Tcp, Protocol.Tls].indexOf(proto) === -1) { - throw new Error(`The protocol must be either ${Protocol.Tcp} or ${Protocol.Tls}. Found ${props.protocol}`); + if ([Protocol.TCP, Protocol.TLS].indexOf(proto) === -1) { + throw new Error(`The protocol must be either ${Protocol.TCP} or ${Protocol.TLS}. Found ${props.protocol}`); } - if (proto === Protocol.Tls && certs.filter(v => v != null).length === 0) { + if (proto === Protocol.TLS && certs.filter(v => v != null).length === 0) { throw new Error(`When the protocol is set to TLS, you must specify certificates`); } - if (proto !== Protocol.Tls && certs.length > 0) { + if (proto !== Protocol.TLS && certs.length > 0) { throw new Error(`Protocol must be TLS when certificates have been specified`); } diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/nlb/network-target-group.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/nlb/network-target-group.ts index c57385b0c104d..d9c9bb78066f7 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/nlb/network-target-group.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/nlb/network-target-group.ts @@ -48,7 +48,7 @@ export class NetworkTargetGroup extends TargetGroupBase implements INetworkTarge constructor(scope: cdk.Construct, id: string, props: NetworkTargetGroupProps) { super(scope, id, props, { - protocol: Protocol.Tcp, + protocol: Protocol.TCP, port: props.port, }); diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/enums.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/enums.ts index 66851cd621750..b5695ddc1566b 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/enums.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/enums.ts @@ -5,12 +5,12 @@ export enum IpAddressType { /** * Allocate IPv4 addresses */ - Ipv4 = 'ipv4', + IPV4 = 'ipv4', /** * Allocate both IPv4 and IPv6 addresses */ - DualStack = 'dualstack', + DUAL_STACK = 'dualstack', } /** @@ -20,22 +20,22 @@ export enum Protocol { /** * HTTP */ - Http = 'HTTP', + HTTP = 'HTTP', /** * HTTPS */ - Https = 'HTTPS', + HTTPS = 'HTTPS', /** * TCP */ - Tcp = 'TCP', + TCP = 'TCP', /** * TLS */ - Tls = 'TLS' + TLS = 'TLS' } /** @@ -45,12 +45,12 @@ export enum ApplicationProtocol { /** * HTTP */ - Http = 'HTTP', + HTTP = 'HTTP', /** * HTTPS */ - Https = 'HTTPS' + HTTPS = 'HTTPS' } /** @@ -70,12 +70,12 @@ export enum SslPolicy { /** * The recommended security policy */ - Recommended = 'ELBSecurityPolicy-2016-08', + RECOMMENDED = 'ELBSecurityPolicy-2016-08', /** * Forward secrecy ciphers only */ - ForwardSecrecy = 'ELBSecurityPolicy-FS-2018-06', + FORWARD_SECRECY = 'ELBSecurityPolicy-FS-2018-06', /** * TLS1.2 only and no SHA ciphers @@ -85,7 +85,7 @@ export enum SslPolicy { /** * TLS1.2 only with all ciphers */ - TLS12Ext = 'ELBSecurityPolicy-TLS-1-2-Ext-2018-06', + TLS12_EXT = 'ELBSecurityPolicy-TLS-1-2-Ext-2018-06', /** * TLS1.1 and higher with all ciphers @@ -98,7 +98,7 @@ export enum SslPolicy { * Do not use this security policy unless you must support a legacy client * that requires the DES-CBC3-SHA cipher, which is a weak cipher. */ - Legacy = 'ELBSecurityPolicy-TLS-1-0-2015-04', + LEGACY = 'ELBSecurityPolicy-TLS-1-0-2015-04', } /** @@ -108,10 +108,10 @@ export enum TargetType { /** * Targets identified by instance ID */ - Instance = 'instance', + INSTANCE = 'instance', /** * Targets identified by IP address */ - Ip = 'ip', + IP = 'ip', } diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/load-balancer-targets.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/load-balancer-targets.ts index 2a4dbb554bd9a..2a7c1d02bc09d 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/load-balancer-targets.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/load-balancer-targets.ts @@ -41,7 +41,7 @@ export class InstanceTarget implements IApplicationLoadBalancerTarget, INetworkL private attach(_targetGroup: ITargetGroup): LoadBalancerTargetProps { return { - targetType: TargetType.Instance, + targetType: TargetType.INSTANCE, targetJson: { id: this.instanceId, port: this.port } }; } @@ -106,7 +106,7 @@ export class IpTarget implements IApplicationLoadBalancerTarget, INetworkLoadBal private attach(_targetGroup: ITargetGroup): LoadBalancerTargetProps { return { - targetType: TargetType.Ip, + targetType: TargetType.IP, targetJson: { id: this.ipAddress, port: this.port, availabilityZone: this.availabilityZone } }; } diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/util.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/util.ts index d992d156a3b2f..525124304bab0 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/util.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/lib/shared/util.ts @@ -20,8 +20,8 @@ export function renderAttributes(attributes: Attributes) { */ export function defaultPortForProtocol(proto: ApplicationProtocol): number { switch (proto) { - case ApplicationProtocol.Http: return 80; - case ApplicationProtocol.Https: return 443; + case ApplicationProtocol.HTTP: return 80; + case ApplicationProtocol.HTTPS: return 443; default: throw new Error(`Unrecognized protocol: ${proto}`); } @@ -36,11 +36,11 @@ export function defaultProtocolForPort(port: number): ApplicationProtocol { case 8000: case 8008: case 8080: - return ApplicationProtocol.Http; + return ApplicationProtocol.HTTP; case 443: case 8443: - return ApplicationProtocol.Https; + return ApplicationProtocol.HTTPS; default: throw new Error(`Don't know default protocol for port: ${port}; please supply a protocol`); diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/test.listener.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/test.listener.ts index 86a5bda1fe5c3..1a4509b7c09d5 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/test.listener.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/test.listener.ts @@ -36,7 +36,7 @@ export = { // WHEN lb.addListener('Listener', { - protocol: elbv2.ApplicationProtocol.Http, + protocol: elbv2.ApplicationProtocol.HTTP, defaultTargetGroups: [new elbv2.ApplicationTargetGroup(stack, 'Group', { vpc, port: 80 })] }); @@ -104,7 +104,7 @@ export = { new elbv2.ApplicationTargetGroup(stack, 'TargetGroup', { vpc, port: 80, - targetType: elbv2.TargetType.Ip + targetType: elbv2.TargetType.IP }); // THEN @@ -418,7 +418,7 @@ export = { // WHEN const metrics = []; - metrics.push(group.metricHttpCodeTarget(elbv2.HttpCodeTarget.Target3xxCount)); + metrics.push(group.metricHttpCodeTarget(elbv2.HttpCodeTarget.TARGET_3XX_COUNT)); metrics.push(group.metricIPv6RequestCount()); metrics.push(group.metricUnhealthyHostCount()); metrics.push(group.metricUnhealthyHostCount()); diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/test.load-balancer.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/test.load-balancer.ts index 7f661f4d86345..ce6374803f36d 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/test.load-balancer.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/alb/test.load-balancer.ts @@ -225,8 +225,8 @@ export = { metrics.push(lb.metricElbAuthFailure()); metrics.push(lb.metricElbAuthLatency()); metrics.push(lb.metricElbAuthSuccess()); - metrics.push(lb.metricHttpCodeElb(elbv2.HttpCodeElb.Elb3xxCount)); - metrics.push(lb.metricHttpCodeTarget(elbv2.HttpCodeTarget.Target3xxCount)); + metrics.push(lb.metricHttpCodeElb(elbv2.HttpCodeElb.ELB_3XX_COUNT)); + metrics.push(lb.metricHttpCodeTarget(elbv2.HttpCodeTarget.TARGET_3XX_COUNT)); metrics.push(lb.metricHttpFixedResponseCount()); metrics.push(lb.metricHttpRedirectCount()); metrics.push(lb.metricHttpRedirectUrlLimitExceededCount()); diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/helpers.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/helpers.ts index 6e1d2a56d6f8a..addd947d5796f 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/helpers.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/helpers.ts @@ -17,10 +17,10 @@ export class FakeSelfRegisteringTarget extends cdk.Construct implements elbv2.IA public attachToApplicationTargetGroup(targetGroup: elbv2.ApplicationTargetGroup): elbv2.LoadBalancerTargetProps { targetGroup.registerConnectable(this); - return { targetType: elbv2.TargetType.Instance }; + return { targetType: elbv2.TargetType.INSTANCE }; } public attachToNetworkTargetGroup(_targetGroup: elbv2.NetworkTargetGroup): elbv2.LoadBalancerTargetProps { - return { targetType: elbv2.TargetType.Instance }; + return { targetType: elbv2.TargetType.INSTANCE }; } } diff --git a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/nlb/test.listener.ts b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/nlb/test.listener.ts index 744ccbd62c910..efae2f6eef41a 100644 --- a/packages/@aws-cdk/aws-elasticloadbalancingv2/test/nlb/test.listener.ts +++ b/packages/@aws-cdk/aws-elasticloadbalancingv2/test/nlb/test.listener.ts @@ -158,7 +158,7 @@ export = { // WHEN lb.addListener('Listener', { port: 443, - protocol: elbv2.Protocol.Tls, + protocol: elbv2.Protocol.TLS, certificates: [ { certificateArn: cert.certificateArn } ], sslPolicy: elbv2.SslPolicy.TLS12, defaultTargetGroups: [new elbv2.NetworkTargetGroup(stack, 'Group', { vpc, port: 80 })] @@ -184,7 +184,7 @@ export = { test.throws(() => lb.addListener('Listener', { port: 443, - protocol: elbv2.Protocol.Http, + protocol: elbv2.Protocol.HTTP, defaultTargetGroups: [new elbv2.NetworkTargetGroup(stack, 'Group', { vpc, port: 80 })] }), Error, '/The protocol must be either TCP or TLS. Found HTTP/'); @@ -198,7 +198,7 @@ export = { test.throws(() => lb.addListener('Listener', { port: 443, - protocol: elbv2.Protocol.Tls, + protocol: elbv2.Protocol.TLS, defaultTargetGroups: [new elbv2.NetworkTargetGroup(stack, 'Group', { vpc, port: 80 })] }), Error, '/When the protocol is set to TLS, you must specify certificates/'); @@ -215,7 +215,7 @@ export = { test.throws(() => lb.addListener('Listener', { port: 443, - protocol: elbv2.Protocol.Tcp, + protocol: elbv2.Protocol.TCP, certificates: [ { certificateArn: cert.certificateArn } ], defaultTargetGroups: [new elbv2.NetworkTargetGroup(stack, 'Group', { vpc, port: 80 })] }), Error, '/Protocol must be TLS when certificates have been specified/'); 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 6b6d706b676a0..1503fead7a628 100644 --- a/packages/@aws-cdk/aws-events-targets/lib/ecs-task.ts +++ b/packages/@aws-cdk/aws-events-targets/lib/ecs-task.ts @@ -69,7 +69,7 @@ export class EcsTask implements events.IRuleTarget { this.taskDefinition = props.taskDefinition; this.taskCount = props.taskCount !== undefined ? props.taskCount : 1; - if (this.taskDefinition.networkMode === ecs.NetworkMode.AwsVpc) { + if (this.taskDefinition.networkMode === ecs.NetworkMode.AWS_VPC) { this.securityGroup = props.securityGroup || new ec2.SecurityGroup(this.taskDefinition, 'SecurityGroup', { vpc: this.props.cluster.vpc }); } } @@ -114,7 +114,7 @@ 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) { + if (this.taskDefinition.networkMode === ecs.NetworkMode.AWS_VPC) { const subnetSelection = this.props.subnetSelection || { subnetType: ec2.SubnetType.PRIVATE }; const assignPublicIp = subnetSelection.subnetType === ec2.SubnetType.PRIVATE ? 'DISABLED' : 'ENABLED'; diff --git a/packages/@aws-cdk/aws-events/lib/schedule.ts b/packages/@aws-cdk/aws-events/lib/schedule.ts index dc55d776f1989..0b2fcce0d142c 100644 --- a/packages/@aws-cdk/aws-events/lib/schedule.ts +++ b/packages/@aws-cdk/aws-events/lib/schedule.ts @@ -63,17 +63,17 @@ export enum TimeUnit { /** * The rate is in minutes */ - Minute = 'minute', + MINUTE = 'minute', /** * The rate is in hours */ - Hour = 'hour', + HOUR = 'hour', /** * The rate is in days */ - Day = 'day' + DAY = 'day' } /** diff --git a/packages/@aws-cdk/aws-kms/test/integ.key-sharing.lit.ts b/packages/@aws-cdk/aws-kms/test/integ.key-sharing.lit.ts index 29ab674461b32..d3a80ccdc0b83 100644 --- a/packages/@aws-cdk/aws-kms/test/integ.key-sharing.lit.ts +++ b/packages/@aws-cdk/aws-kms/test/integ.key-sharing.lit.ts @@ -15,7 +15,7 @@ class KeyStack extends cdk.Stack { constructor(scope: cdk.App, id: string, props?: cdk.StackProps) { super(scope, id, props); - this.key = new kms.Key(this, 'MyKey', { removalPolicy: RemovalPolicy.Destroy }); + this.key = new kms.Key(this, 'MyKey', { removalPolicy: RemovalPolicy.DESTROY }); } } diff --git a/packages/@aws-cdk/aws-kms/test/integ.key.ts b/packages/@aws-cdk/aws-kms/test/integ.key.ts index 275566a8f90f2..377a57a3458dc 100644 --- a/packages/@aws-cdk/aws-kms/test/integ.key.ts +++ b/packages/@aws-cdk/aws-kms/test/integ.key.ts @@ -7,7 +7,7 @@ const app = new App(); const stack = new Stack(app, `aws-cdk-kms-1`); -const key = new Key(stack, 'MyKey', { removalPolicy: RemovalPolicy.Destroy }); +const key = new Key(stack, 'MyKey', { removalPolicy: RemovalPolicy.DESTROY }); key.addToResourcePolicy(new PolicyStatement({ resources: ['*'], diff --git a/packages/@aws-cdk/aws-kms/test/test.key.ts b/packages/@aws-cdk/aws-kms/test/test.key.ts index 897305a919248..5a013cf3e18a7 100644 --- a/packages/@aws-cdk/aws-kms/test/test.key.ts +++ b/packages/@aws-cdk/aws-kms/test/test.key.ts @@ -68,7 +68,7 @@ export = { const app = new App(); const stack = new Stack(app, 'TestStack'); - new Key(stack, 'MyKey', { removalPolicy: RemovalPolicy.Destroy }); + new Key(stack, 'MyKey', { removalPolicy: RemovalPolicy.DESTROY }); expect(stack).to(haveResource('AWS::KMS::Key', { DeletionPolicy: "Delete" }, ResourcePart.CompleteDefinition)); test.done(); 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 013d6a959b419..18b118c1ed0a1 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 @@ -9,7 +9,7 @@ class S3EventSourceTest extends cdk.Stack { const fn = new TestFunction(this, 'F'); const bucket = new s3.Bucket(this, 'B', { - removalPolicy: cdk.RemovalPolicy.Destroy + removalPolicy: cdk.RemovalPolicy.DESTROY }); fn.addEventSource(new S3EventSource(bucket, { diff --git a/packages/@aws-cdk/aws-lambda/lib/runtime.ts b/packages/@aws-cdk/aws-lambda/lib/runtime.ts index 2c613c9f665bc..0b5ad65b21e75 100644 --- a/packages/@aws-cdk/aws-lambda/lib/runtime.ts +++ b/packages/@aws-cdk/aws-lambda/lib/runtime.ts @@ -7,7 +7,7 @@ export interface LambdaRuntimeProps { } export enum RuntimeFamily { - NodeJS, + NODEJS, JAVA, PYTHON, DOTNET_CORE, @@ -27,13 +27,13 @@ export class Runtime { public static readonly All = new Array(); /** @deprecated Use `Nodejs810` or `Nodejs10x` */ - public static readonly Nodejs = new Runtime('nodejs', RuntimeFamily.NodeJS, { supportsInlineCode: true }); + public static readonly Nodejs = new Runtime('nodejs', RuntimeFamily.NODEJS, { supportsInlineCode: true }); /** @deprecated Use `Nodejs810` or `Nodejs10x` */ - public static readonly Nodejs43 = new Runtime('nodejs4.3', RuntimeFamily.NodeJS, { supportsInlineCode: true }); + public static readonly Nodejs43 = new Runtime('nodejs4.3', RuntimeFamily.NODEJS, { supportsInlineCode: true }); /** @deprecated Use `Nodejs810` or `Nodejs10x` */ - public static readonly Nodejs610 = new Runtime('nodejs6.10', RuntimeFamily.NodeJS, { supportsInlineCode: true }); - public static readonly Nodejs810 = new Runtime('nodejs8.10', RuntimeFamily.NodeJS, { supportsInlineCode: true }); - public static readonly Nodejs10x = new Runtime('nodejs10.x', RuntimeFamily.NodeJS, { supportsInlineCode: false }); + public static readonly 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 }); diff --git a/packages/@aws-cdk/aws-logs/test/integ.metricfilter.lit.ts b/packages/@aws-cdk/aws-logs/test/integ.metricfilter.lit.ts index 130b340a22550..336171b5a4452 100644 --- a/packages/@aws-cdk/aws-logs/test/integ.metricfilter.lit.ts +++ b/packages/@aws-cdk/aws-logs/test/integ.metricfilter.lit.ts @@ -6,7 +6,7 @@ class MetricFilterIntegStack extends Stack { super(scope, id, props); const logGroup = new LogGroup(this, 'LogGroup', { - removalPolicy: RemovalPolicy.Destroy + removalPolicy: RemovalPolicy.DESTROY }); /// !show diff --git a/packages/@aws-cdk/aws-logs/test/test.loggroup.ts b/packages/@aws-cdk/aws-logs/test/test.loggroup.ts index 8fa9c604c12f1..bf76be856c59a 100644 --- a/packages/@aws-cdk/aws-logs/test/test.loggroup.ts +++ b/packages/@aws-cdk/aws-logs/test/test.loggroup.ts @@ -66,7 +66,7 @@ export = { // WHEN new LogGroup(stack, 'LogGroup', { retention: Infinity, - removalPolicy: RemovalPolicy.Destroy + removalPolicy: RemovalPolicy.DESTROY }); // THEN diff --git a/packages/@aws-cdk/aws-route53-targets/test/integ.cloudfront-alias-target.ts b/packages/@aws-cdk/aws-route53-targets/test/integ.cloudfront-alias-target.ts index dcbe7c404b394..3b54de8a118ab 100644 --- a/packages/@aws-cdk/aws-route53-targets/test/integ.cloudfront-alias-target.ts +++ b/packages/@aws-cdk/aws-route53-targets/test/integ.cloudfront-alias-target.ts @@ -11,7 +11,7 @@ const stack = new cdk.Stack(app, 'aws-cdk-cloudfront'); const zone = new route53.PublicHostedZone(stack, 'HostedZone', { zoneName: 'test.public' }); const sourceBucket = new s3.Bucket(stack, 'Bucket', { - removalPolicy: cdk.RemovalPolicy.Destroy + removalPolicy: cdk.RemovalPolicy.DESTROY }); const distribution = new cloudfront.CloudFrontWebDistribution(stack, 'MyDistribution', { diff --git a/packages/@aws-cdk/aws-s3-assets/lib/asset.ts b/packages/@aws-cdk/aws-s3-assets/lib/asset.ts index d2f6d45ff5e5f..b3a9528946003 100644 --- a/packages/@aws-cdk/aws-s3-assets/lib/asset.ts +++ b/packages/@aws-cdk/aws-s3-assets/lib/asset.ts @@ -16,12 +16,12 @@ export enum AssetPackaging { * Path refers to a directory on disk, the contents of the directory is * archived into a .zip. */ - ZipDirectory = 'zip', + ZIP_DIRECTORY = 'zip', /** * Path refers to a single file on disk. The file is uploaded as-is. */ - File = 'file', + FILE = 'file', } export interface AssetProps extends assets.CopyOptions { @@ -106,7 +106,7 @@ export class Asset extends cdk.Construct implements assets.IAsset { const packaging = determinePackaging(staging.sourcePath); // sets isZipArchive based on the type of packaging and file extension - this.isZipArchive = packaging === AssetPackaging.ZipDirectory + this.isZipArchive = packaging === AssetPackaging.ZIP_DIRECTORY ? true : ARCHIVE_EXTENSIONS.some(ext => staging.sourcePath.toLowerCase().endsWith(ext)); @@ -208,11 +208,11 @@ function determinePackaging(assetPath: string): AssetPackaging { } if (fs.statSync(assetPath).isDirectory()) { - return AssetPackaging.ZipDirectory; + return AssetPackaging.ZIP_DIRECTORY; } if (fs.statSync(assetPath).isFile()) { - return AssetPackaging.File; + return AssetPackaging.FILE; } throw new Error(`Asset ${assetPath} is expected to be either a directory or a regular file`); diff --git a/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.ts b/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.ts index 7af6ff11e2ca6..418920cbb79cb 100644 --- a/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.ts +++ b/packages/@aws-cdk/aws-s3-deployment/test/integ.bucket-deployment.ts @@ -10,7 +10,7 @@ class TestBucketDeployment extends cdk.Stack { const destinationBucket = new s3.Bucket(this, 'Destination', { websiteIndexDocument: 'index.html', publicReadAccess: true, - removalPolicy: cdk.RemovalPolicy.Destroy + removalPolicy: cdk.RemovalPolicy.DESTROY }); new s3deploy.BucketDeployment(this, 'DeployMe', { 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 c22c94adb1461..81a78de818f6b 100644 --- a/packages/@aws-cdk/aws-s3-notifications/test/integ.notifications.ts +++ b/packages/@aws-cdk/aws-s3-notifications/test/integ.notifications.ts @@ -9,7 +9,7 @@ const app = new cdk.App(); const stack = new Stack(app, 'test-3'); const bucket = new s3.Bucket(stack, 'Bucket', { - removalPolicy: cdk.RemovalPolicy.Destroy + removalPolicy: cdk.RemovalPolicy.DESTROY }); const topic = new sns.Topic(stack, 'Topic'); const topic3 = new sns.Topic(stack, 'Topic3'); @@ -18,7 +18,7 @@ bucket.addEventNotification(s3.EventType.OBJECT_CREATED_PUT, new s3n.SnsDestinat bucket.addEventNotification(s3.EventType.OBJECT_REMOVED, new s3n.SnsDestination(topic3), { prefix: 'home/myusername/' }); const bucket2 = new s3.Bucket(stack, 'Bucket2', { - removalPolicy: cdk.RemovalPolicy.Destroy + removalPolicy: cdk.RemovalPolicy.DESTROY }); bucket2.addObjectRemovedNotification(new s3n.SnsDestination(topic3), { prefix: 'foo' }, { suffix: 'foo/bar' }); 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 6579cd7c9822d..8dbd03340ef4e 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 @@ -8,7 +8,7 @@ const app = new cdk.App(); const stack = new cdk.Stack(app, 'lambda-bucket-notifications'); const bucketA = new s3.Bucket(stack, 'MyBucket', { - removalPolicy: cdk.RemovalPolicy.Destroy + removalPolicy: cdk.RemovalPolicy.DESTROY }); const fn = new lambda.Function(stack, 'MyFunction', { @@ -18,7 +18,7 @@ const fn = new lambda.Function(stack, 'MyFunction', { }); const bucketB = new s3.Bucket(stack, 'YourBucket', { - removalPolicy: cdk.RemovalPolicy.Destroy + removalPolicy: cdk.RemovalPolicy.DESTROY }); bucketA.addObjectCreatedNotification(new s3n.LambdaDestination(fn), { suffix: '.png' }); diff --git a/packages/@aws-cdk/aws-s3-notifications/test/sns/integ.sns-bucket-notifications.ts b/packages/@aws-cdk/aws-s3-notifications/test/sns/integ.sns-bucket-notifications.ts index 725a67e816379..88dee27465fff 100644 --- a/packages/@aws-cdk/aws-s3-notifications/test/sns/integ.sns-bucket-notifications.ts +++ b/packages/@aws-cdk/aws-s3-notifications/test/sns/integ.sns-bucket-notifications.ts @@ -10,7 +10,7 @@ class MyStack extends cdk.Stack { const objectCreateTopic = new sns.Topic(this, 'ObjectCreatedTopic'); const objectRemovedTopic = new sns.Topic(this, 'ObjectDeletedTopic'); const bucket = new s3.Bucket(this, 'MyBucket', { - removalPolicy: cdk.RemovalPolicy.Destroy + removalPolicy: cdk.RemovalPolicy.DESTROY }); bucket.addObjectCreatedNotification(new s3n.SnsDestination(objectCreateTopic)); 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 257d84c99bd65..6783883b642a4 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 @@ -8,14 +8,14 @@ const app = new cdk.App(); const stack = new cdk.Stack(app, 'sqs-bucket-notifications'); const bucket1 = new s3.Bucket(stack, 'Bucket1', { - removalPolicy: cdk.RemovalPolicy.Destroy + removalPolicy: cdk.RemovalPolicy.DESTROY }); const queue = new sqs.Queue(stack, 'MyQueue'); bucket1.addObjectCreatedNotification(new s3n.SqsDestination(queue)); const bucket2 = new s3.Bucket(stack, 'Bucket2', { - removalPolicy: cdk.RemovalPolicy.Destroy + removalPolicy: cdk.RemovalPolicy.DESTROY }); bucket2.addObjectCreatedNotification(new s3n.SqsDestination(queue), { suffix: '.png' }); diff --git a/packages/@aws-cdk/aws-s3/lib/notifications-resource/notifications-resource-handler.ts b/packages/@aws-cdk/aws-s3/lib/notifications-resource/notifications-resource-handler.ts index ac543e91dcdb4..86a684f16fd75 100644 --- a/packages/@aws-cdk/aws-s3/lib/notifications-resource/notifications-resource-handler.ts +++ b/packages/@aws-cdk/aws-s3/lib/notifications-resource/notifications-resource-handler.ts @@ -63,7 +63,7 @@ export class NotificationsResourceHandler extends cdk.Construct { const resourceType = 'AWS::Lambda::Function'; class InLineLambda extends cdk.CfnResource { - public readonly tags: cdk.TagManager = new cdk.TagManager(cdk.TagType.Standard, resourceType); + public readonly tags: cdk.TagManager = new cdk.TagManager(cdk.TagType.STANDARD, resourceType); protected renderProperties(properties: any): { [key: string]: any } { properties.Tags = cdk.listMapper( diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.lit.ts b/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.lit.ts index c68f0039f36c0..752bc499c19c1 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.lit.ts +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket-sharing.lit.ts @@ -17,7 +17,7 @@ class Producer extends cdk.Stack { super(scope, id, props); const bucket = new s3.Bucket(this, 'MyBucket', { - removalPolicy: cdk.RemovalPolicy.Destroy + removalPolicy: cdk.RemovalPolicy.DESTROY }); this.myBucket = bucket; } diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.ts b/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.ts index 7303819c8ed9a..24b3f47e36059 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.ts +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.domain-name.ts @@ -7,7 +7,7 @@ class TestStack extends cdk.Stack { /// !show const bucket = new s3.Bucket(this, 'MyBucket', { - removalPolicy: cdk.RemovalPolicy.Destroy + removalPolicy: cdk.RemovalPolicy.DESTROY }); const bucket2 = s3.Bucket.fromBucketAttributes(this, "MyBucket2", { bucketArn: "arn:aws:s3:::my-bucket-test" diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.ts b/packages/@aws-cdk/aws-s3/test/integ.bucket.ts index 48e239e4bdc0d..d8e7c27ea2d86 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket.ts +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.ts @@ -9,12 +9,12 @@ const stack = new cdk.Stack(app, 'aws-cdk-s3'); const bucket = new s3.Bucket(stack, 'MyBucket', { encryption: s3.BucketEncryption.KMS, - removalPolicy: cdk.RemovalPolicy.Destroy + removalPolicy: cdk.RemovalPolicy.DESTROY }); const otherwiseEncryptedBucket = new s3.Bucket(stack, 'MyOtherBucket', { encryption: s3.BucketEncryption.S3_MANAGED, - removalPolicy: cdk.RemovalPolicy.Destroy + removalPolicy: cdk.RemovalPolicy.DESTROY }); const user = new iam.User(stack, 'MyUser'); diff --git a/packages/@aws-cdk/aws-s3/test/integ.bucket.url.lit.ts b/packages/@aws-cdk/aws-s3/test/integ.bucket.url.lit.ts index 2ee89c31a1d1b..79b13c25df51c 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.bucket.url.lit.ts +++ b/packages/@aws-cdk/aws-s3/test/integ.bucket.url.lit.ts @@ -7,7 +7,7 @@ class TestStack extends cdk.Stack { /// !show const bucket = new s3.Bucket(this, 'MyBucket', { - removalPolicy: cdk.RemovalPolicy.Destroy + removalPolicy: cdk.RemovalPolicy.DESTROY }); new cdk.CfnOutput(this, 'BucketURL', { value: bucket.bucketWebsiteUrl }); diff --git a/packages/@aws-cdk/aws-s3/test/integ.lifecycle.ts b/packages/@aws-cdk/aws-s3/test/integ.lifecycle.ts index e0658c3d99662..5a0ec399da681 100644 --- a/packages/@aws-cdk/aws-s3/test/integ.lifecycle.ts +++ b/packages/@aws-cdk/aws-s3/test/integ.lifecycle.ts @@ -10,7 +10,7 @@ new Bucket(stack, 'MyBucket', { lifecycleRules: [{ expirationDate: new Date('2019-10-01') }], - removalPolicy: RemovalPolicy.Destroy + removalPolicy: RemovalPolicy.DESTROY }); app.synth(); diff --git a/packages/@aws-cdk/aws-s3/test/test.bucket.ts b/packages/@aws-cdk/aws-s3/test/test.bucket.ts index dd78c0650e9f3..75c915dc336e5 100644 --- a/packages/@aws-cdk/aws-s3/test/test.bucket.ts +++ b/packages/@aws-cdk/aws-s3/test/test.bucket.ts @@ -535,7 +535,7 @@ export = { 'removal policy can be used to specify behavior upon delete'(test: Test) { const stack = new cdk.Stack(); new s3.Bucket(stack, 'MyBucket', { - removalPolicy: cdk.RemovalPolicy.Retain, + removalPolicy: cdk.RemovalPolicy.RETAIN, encryption: s3.BucketEncryption.UNENCRYPTED }); diff --git a/packages/@aws-cdk/aws-ssm/lib/parameter.ts b/packages/@aws-cdk/aws-ssm/lib/parameter.ts index 1fa48bddc69b5..e2d8a813f9f06 100644 --- a/packages/@aws-cdk/aws-ssm/lib/parameter.ts +++ b/packages/@aws-cdk/aws-ssm/lib/parameter.ts @@ -192,7 +192,7 @@ export class StringParameter extends ParameterBase implements IStringParameter { } const stringValue = attrs.version - ? new CfnDynamicReference(CfnDynamicReferenceService.Ssm, `${attrs.parameterName}:${attrs.version}`).toString() + ? new CfnDynamicReference(CfnDynamicReferenceService.SSM, `${attrs.parameterName}:${attrs.version}`).toString() : new CfnParameter(scope, `${id}.Parameter`, { type: 'AWS::SSM::Parameter::Value', default: attrs.parameterName }).valueAsString; class Import extends ParameterBase { @@ -209,7 +209,7 @@ export class StringParameter extends ParameterBase implements IStringParameter { * Imports a secure string parameter from the SSM parameter store. */ public static fromSecureStringParameterAttributes(scope: Construct, id: string, attrs: SecureStringParameterAttributes): IStringParameter { - const stringValue = new CfnDynamicReference(CfnDynamicReferenceService.SsmSecure, `${attrs.parameterName}:${attrs.version}`).toString(); + const stringValue = new CfnDynamicReference(CfnDynamicReferenceService.SSM_SECURE, `${attrs.parameterName}:${attrs.version}`).toString(); class Import extends ParameterBase { public readonly parameterName = attrs.parameterName; @@ -322,7 +322,7 @@ export class StringListParameter extends ParameterBase implements IStringListPar public readonly parameterName = stringListParameterName; public readonly parameterArn = arnForParameterName(this, this.parameterName); public readonly parameterType = STRINGLIST_PARAM_TYPE; - public readonly stringListValue = Fn.split(',', new CfnDynamicReference(CfnDynamicReferenceService.Ssm, stringListParameterName).toString()); + public readonly stringListValue = Fn.split(',', new CfnDynamicReference(CfnDynamicReferenceService.SSM, stringListParameterName).toString()); } return new Import(scope, id); diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/run-ecs-ec2-task.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/run-ecs-ec2-task.ts index ce32e3f94d4f2..609d036c7bf65 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/run-ecs-ec2-task.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/run-ecs-ec2-task.ts @@ -65,7 +65,7 @@ export class RunEcsEc2Task extends EcsRunTaskBase { } }); - if (props.taskDefinition.networkMode === ecs.NetworkMode.AwsVpc) { + if (props.taskDefinition.networkMode === ecs.NetworkMode.AWS_VPC) { this.configureAwsVpcNetworking(props.cluster.vpc, undefined, props.subnets, props.securityGroup); } else { // Either None, Bridge or Host networking. Copy SecurityGroup from ASG. diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/run-lambda-task.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/run-lambda-task.ts index b55405537c3d6..e6330e634230c 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/lib/run-lambda-task.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/lib/run-lambda-task.ts @@ -97,7 +97,7 @@ export enum InvocationType { * * The API response includes the function response and additional data. */ - RequestResponse = 'RequestResponse', + REQUEST_RESPONSE = 'RequestResponse', /** * Invoke asynchronously @@ -105,5 +105,5 @@ export enum InvocationType { * Send events that fail multiple times to the function's dead-letter queue (if it's configured). * The API response only includes a status code. */ - Event = 'Event', + EVENT = 'Event', } \ No newline at end of file diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/test/ecs-tasks.test.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/test/ecs-tasks.test.ts index 91eb19e440882..565fcc0b4b112 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/test/ecs-tasks.test.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/test/ecs-tasks.test.ts @@ -23,7 +23,7 @@ test('Cannot create a Fargate task with a fargate-incompatible task definition', const taskDefinition = new ecs.TaskDefinition(stack, 'TD', { memoryMiB: '512', cpu: '256', - compatibility: ecs.Compatibility.Ec2, + compatibility: ecs.Compatibility.EC2, }); taskDefinition.addContainer('TheContainer', { image: ecs.ContainerImage.fromRegistry('foo/bar'), @@ -38,7 +38,7 @@ test('Cannot create a Fargate task without a default container', () => { const taskDefinition = new ecs.TaskDefinition(stack, 'TD', { memoryMiB: '512', cpu: '256', - compatibility: ecs.Compatibility.Fargate, + compatibility: ecs.Compatibility.FARGATE, }); expect(() => new tasks.RunEcsFargateTask({ cluster, taskDefinition })) .toThrowError(/must have at least one essential container/); @@ -48,7 +48,7 @@ test('Running a Fargate Task', () => { const taskDefinition = new ecs.TaskDefinition(stack, 'TD', { memoryMiB: '512', cpu: '256', - compatibility: ecs.Compatibility.Fargate + compatibility: ecs.Compatibility.FARGATE }); taskDefinition.addContainer('TheContainer', { image: ecs.ContainerImage.fromRegistry('foo/bar'), @@ -145,7 +145,7 @@ test('Running a Fargate Task', () => { test('Running an EC2 Task with bridge network', () => { const taskDefinition = new ecs.TaskDefinition(stack, 'TD', { - compatibility: ecs.Compatibility.Ec2 + compatibility: ecs.Compatibility.EC2 }); taskDefinition.addContainer('TheContainer', { image: ecs.ContainerImage.fromRegistry('foo/bar'), @@ -233,7 +233,7 @@ test('Running an EC2 Task with bridge network', () => { test('Running an EC2 Task with placement strategies', () => { const taskDefinition = new ecs.TaskDefinition(stack, 'TD', { - compatibility: ecs.Compatibility.Ec2 + compatibility: ecs.Compatibility.EC2 }); taskDefinition.addContainer('TheContainer', { image: ecs.ContainerImage.fromRegistry('foo/bar'), @@ -281,7 +281,7 @@ test('Running an EC2 Task with placement strategies', () => { test('Running an EC2 Task with overridden number values', () => { const taskDefinition = new ecs.TaskDefinition(stack, 'TD', { - compatibility: ecs.Compatibility.Ec2 + compatibility: ecs.Compatibility.EC2 }); taskDefinition.addContainer('TheContainer', { image: ecs.ContainerImage.fromRegistry('foo/bar'), diff --git a/packages/@aws-cdk/aws-stepfunctions-tasks/test/run-lambda-task.test.ts b/packages/@aws-cdk/aws-stepfunctions-tasks/test/run-lambda-task.test.ts index 1884e76c0b8b5..090c335160b6d 100644 --- a/packages/@aws-cdk/aws-stepfunctions-tasks/test/run-lambda-task.test.ts +++ b/packages/@aws-cdk/aws-stepfunctions-tasks/test/run-lambda-task.test.ts @@ -21,7 +21,7 @@ test('Invoke lambda with default magic ARN', () => { payload: { foo: 'bar' }, - invocationType: tasks.InvocationType.RequestResponse, + invocationType: tasks.InvocationType.REQUEST_RESPONSE, clientContext: "eyJoZWxsbyI6IndvcmxkIn0=", qualifier: "1", }) diff --git a/packages/@aws-cdk/aws-stepfunctions/lib/states/choice.ts b/packages/@aws-cdk/aws-stepfunctions/lib/states/choice.ts index d62e29ca74277..51766af2ecb6c 100644 --- a/packages/@aws-cdk/aws-stepfunctions/lib/states/choice.ts +++ b/packages/@aws-cdk/aws-stepfunctions/lib/states/choice.ts @@ -89,7 +89,7 @@ export class Choice extends State { */ public toStateJson(): object { return { - Type: StateType.Choice, + Type: StateType.CHOICE, Comment: this.comment, ...this.renderInputOutput(), ...this.renderChoices(), diff --git a/packages/@aws-cdk/aws-stepfunctions/lib/states/fail.ts b/packages/@aws-cdk/aws-stepfunctions/lib/states/fail.ts index 5a7ce49557e46..254a03e69d9cc 100644 --- a/packages/@aws-cdk/aws-stepfunctions/lib/states/fail.ts +++ b/packages/@aws-cdk/aws-stepfunctions/lib/states/fail.ts @@ -51,7 +51,7 @@ export class Fail extends State { */ public toStateJson(): object { return { - Type: StateType.Fail, + Type: StateType.FAIL, Comment: this.comment, Error: this.error, Cause: this.cause, diff --git a/packages/@aws-cdk/aws-stepfunctions/lib/states/parallel.ts b/packages/@aws-cdk/aws-stepfunctions/lib/states/parallel.ts index dbf54f6f6048f..a9a25237b0195 100644 --- a/packages/@aws-cdk/aws-stepfunctions/lib/states/parallel.ts +++ b/packages/@aws-cdk/aws-stepfunctions/lib/states/parallel.ts @@ -109,7 +109,7 @@ export class Parallel extends State implements INextable { */ public toStateJson(): object { return { - Type: StateType.Parallel, + Type: StateType.PARALLEL, Comment: this.comment, ResultPath: renderJsonPath(this.resultPath), ...this.renderNextEnd(), diff --git a/packages/@aws-cdk/aws-stepfunctions/lib/states/pass.ts b/packages/@aws-cdk/aws-stepfunctions/lib/states/pass.ts index 4bb97d4374f39..c31b5e1f4053e 100644 --- a/packages/@aws-cdk/aws-stepfunctions/lib/states/pass.ts +++ b/packages/@aws-cdk/aws-stepfunctions/lib/states/pass.ts @@ -84,7 +84,7 @@ export class Pass extends State implements INextable { */ public toStateJson(): object { return { - Type: StateType.Pass, + Type: StateType.PASS, Comment: this.comment, Result: this.result, ResultPath: renderJsonPath(this.resultPath), diff --git a/packages/@aws-cdk/aws-stepfunctions/lib/states/state.ts b/packages/@aws-cdk/aws-stepfunctions/lib/states/state.ts index edbabaddb9712..ed87f1002fab7 100644 --- a/packages/@aws-cdk/aws-stepfunctions/lib/states/state.ts +++ b/packages/@aws-cdk/aws-stepfunctions/lib/states/state.ts @@ -500,11 +500,11 @@ function isNextable(x: any): x is INextable { * State types */ export enum StateType { - Pass = 'Pass', - Task = 'Task', - Choice = 'Choice', - Wait = 'Wait', - Succeed = 'Succeed', - Fail = 'Fail', - Parallel = 'Parallel' + PASS = 'Pass', + TASK = 'Task', + CHOICE = 'Choice', + WAIT = 'Wait', + SUCCEED = 'Succeed', + FAIL = 'Fail', + PARALLEL = 'Parallel' } diff --git a/packages/@aws-cdk/aws-stepfunctions/lib/states/succeed.ts b/packages/@aws-cdk/aws-stepfunctions/lib/states/succeed.ts index 4278e281f911c..995b5e628f4d0 100644 --- a/packages/@aws-cdk/aws-stepfunctions/lib/states/succeed.ts +++ b/packages/@aws-cdk/aws-stepfunctions/lib/states/succeed.ts @@ -52,7 +52,7 @@ export class Succeed extends State { */ public toStateJson(): object { return { - Type: StateType.Succeed, + Type: StateType.SUCCEED, Comment: this.comment, ...this.renderInputOutput(), }; diff --git a/packages/@aws-cdk/aws-stepfunctions/lib/states/task.ts b/packages/@aws-cdk/aws-stepfunctions/lib/states/task.ts index 51f2833753a28..e01439251be78 100644 --- a/packages/@aws-cdk/aws-stepfunctions/lib/states/task.ts +++ b/packages/@aws-cdk/aws-stepfunctions/lib/states/task.ts @@ -124,7 +124,7 @@ export class Task extends State implements INextable { ...this.renderNextEnd(), ...this.renderRetryCatch(), ...this.renderInputOutput(), - Type: StateType.Task, + Type: StateType.TASK, Comment: this.comment, Resource: this.taskProps.resourceArn, Parameters: this.taskProps.parameters && FieldUtils.renderObject(this.taskProps.parameters), diff --git a/packages/@aws-cdk/aws-stepfunctions/lib/states/wait.ts b/packages/@aws-cdk/aws-stepfunctions/lib/states/wait.ts index 87be700236972..73f9e983244fd 100644 --- a/packages/@aws-cdk/aws-stepfunctions/lib/states/wait.ts +++ b/packages/@aws-cdk/aws-stepfunctions/lib/states/wait.ts @@ -87,7 +87,7 @@ export class Wait extends State implements INextable { */ public toStateJson(): object { return { - Type: StateType.Wait, + Type: StateType.WAIT, Comment: this.comment, ...this.time._json, ...this.renderNextEnd(), diff --git a/packages/@aws-cdk/cdk/lib/cfn-dynamic-reference.ts b/packages/@aws-cdk/cdk/lib/cfn-dynamic-reference.ts index 9727d7356a821..87ad7037807e5 100644 --- a/packages/@aws-cdk/cdk/lib/cfn-dynamic-reference.ts +++ b/packages/@aws-cdk/cdk/lib/cfn-dynamic-reference.ts @@ -36,15 +36,15 @@ export enum CfnDynamicReferenceService { /** * Plaintext value stored in AWS Systems Manager Parameter Store */ - Ssm = 'ssm', + SSM = 'ssm', /** * Secure string stored in AWS Systems Manager Parameter Store */ - SsmSecure = 'ssm-secure', + SSM_SECURE = 'ssm-secure', /** * Secret stored in AWS Secrets Manager */ - SecretsManager = 'secretsmanager', + SECRETS_MANAGER = 'secretsmanager', } diff --git a/packages/@aws-cdk/cdk/lib/cfn-resource-policy.ts b/packages/@aws-cdk/cdk/lib/cfn-resource-policy.ts index c7f65d39ef881..10e02b1d98801 100644 --- a/packages/@aws-cdk/cdk/lib/cfn-resource-policy.ts +++ b/packages/@aws-cdk/cdk/lib/cfn-resource-policy.ts @@ -76,7 +76,7 @@ export enum CfnDeletionPolicy { * deletion policy to any resource type. By default, if you don't specify a DeletionPolicy, AWS CloudFormation deletes * your resources. However, be aware of the following considerations: */ - Delete = 'Delete', + DELETE = 'Delete', /** * AWS CloudFormation keeps the resource without deleting the resource or its contents when its stack is deleted. @@ -84,7 +84,7 @@ export enum CfnDeletionPolicy { * the stack will be in Delete_Complete state; however, resources that are retained continue to exist and continue to incur * applicable charges until you delete those resources. */ - Retain = 'Retain', + RETAIN = 'Retain', /** * For resources that support snapshots (AWS::EC2::Volume, AWS::ElastiCache::CacheCluster, AWS::ElastiCache::ReplicationGroup, @@ -93,7 +93,7 @@ export enum CfnDeletionPolicy { * Delete_Complete state; however, the snapshots that are created with this policy continue to exist and continue to * incur applicable charges until you delete those snapshots. */ - Snapshot = 'Snapshot', + SNAPSHOT = 'Snapshot', } /** diff --git a/packages/@aws-cdk/cdk/lib/cfn-resource.ts b/packages/@aws-cdk/cdk/lib/cfn-resource.ts index 5acf741ee2142..206a015c352a7 100644 --- a/packages/@aws-cdk/cdk/lib/cfn-resource.ts +++ b/packages/@aws-cdk/cdk/lib/cfn-resource.ts @@ -94,17 +94,17 @@ export class CfnResource extends CfnRefElement { * Sets the deletion policy of the resource based on the removal policy specified. */ public applyRemovalPolicy(policy: RemovalPolicy | undefined, options: RemovalPolicyOptions = {}) { - policy = policy || options.default || RemovalPolicy.Retain; + policy = policy || options.default || RemovalPolicy.RETAIN; let deletionPolicy; switch (policy) { - case RemovalPolicy.Destroy: - deletionPolicy = CfnDeletionPolicy.Delete; + case RemovalPolicy.DESTROY: + deletionPolicy = CfnDeletionPolicy.DELETE; break; - case RemovalPolicy.Retain: - deletionPolicy = CfnDeletionPolicy.Retain; + case RemovalPolicy.RETAIN: + deletionPolicy = CfnDeletionPolicy.RETAIN; break; default: @@ -287,11 +287,11 @@ export class CfnResource extends CfnRefElement { } export enum TagType { - Standard = 'StandardTag', - AutoScalingGroup = 'AutoScalingGroupTag', - Map = 'StringToStringMap', - KeyValue = 'KeyValue', - NotTaggable = 'NotTaggable', + STANDARD = 'StandardTag', + AUTOSCALING_GROUP = 'AutoScalingGroupTag', + MAP = 'StringToStringMap', + KEY_VALUE = 'KeyValue', + NOT_TAGGABLE = 'NotTaggable', } export interface IResourceOptions { diff --git a/packages/@aws-cdk/cdk/lib/construct.ts b/packages/@aws-cdk/cdk/lib/construct.ts index 68c744c357966..35f1452661ad1 100644 --- a/packages/@aws-cdk/cdk/lib/construct.ts +++ b/packages/@aws-cdk/cdk/lib/construct.ts @@ -55,7 +55,7 @@ export class ConstructNode { } // synthesize (leaves first) - for (const construct of root.findAll(ConstructOrder.PostOrder)) { + for (const construct of root.findAll(ConstructOrder.POSTORDER)) { (construct as any).synthesize({ assembly: builder }); // "as any" is needed because we want to keep "synthesize" protected } } finally { @@ -71,7 +71,7 @@ export class ConstructNode { * @param node The root node */ public static prepare(node: ConstructNode) { - const constructs = node.findAll(ConstructOrder.PreOrder); + const constructs = node.findAll(ConstructOrder.PREORDER); // Aspects are applied root to leaf for (const construct of constructs) { @@ -239,13 +239,13 @@ export class ConstructNode { /** * Return this construct and all of its children in the given order */ - public findAll(order: ConstructOrder = ConstructOrder.PreOrder): IConstruct[] { + public findAll(order: ConstructOrder = ConstructOrder.PREORDER): IConstruct[] { const ret = new Array(); visit(this.host); return ret; function visit(node: IConstruct) { - if (order === ConstructOrder.PreOrder) { + if (order === ConstructOrder.PREORDER) { ret.push(node); } @@ -253,7 +253,7 @@ export class ConstructNode { visit(child); } - if (order === ConstructOrder.PostOrder) { + if (order === ConstructOrder.POSTORDER) { ret.push(node); } } @@ -643,12 +643,12 @@ export enum ConstructOrder { /** * Depth-first, pre-order */ - PreOrder, + PREORDER, /** * Depth-first, post-order (leaf nodes first) */ - PostOrder + POSTORDER } /** diff --git a/packages/@aws-cdk/cdk/lib/removal-policy.ts b/packages/@aws-cdk/cdk/lib/removal-policy.ts index eae0e6d2a938e..363c506661945 100644 --- a/packages/@aws-cdk/cdk/lib/removal-policy.ts +++ b/packages/@aws-cdk/cdk/lib/removal-policy.ts @@ -3,13 +3,13 @@ export enum RemovalPolicy { * This is the default removal policy. It means that when the resource is * removed from the app, it will be physically destroyed. */ - Destroy = 'destroy', + DESTROY = 'destroy', /** * This uses the 'Retain' DeletionPolicy, which will cause the resource to be retained * in the account, but orphaned from the stack. */ - Retain = 'retain', + RETAIN = 'retain', } export interface RemovalPolicyOptions { diff --git a/packages/@aws-cdk/cdk/lib/secret-value.ts b/packages/@aws-cdk/cdk/lib/secret-value.ts index 3a4b8db632b53..afe11b3d51266 100644 --- a/packages/@aws-cdk/cdk/lib/secret-value.ts +++ b/packages/@aws-cdk/cdk/lib/secret-value.ts @@ -47,7 +47,7 @@ export class SecretValue extends Intrinsic { options.versionId || '' ]; - const dyref = new CfnDynamicReference(CfnDynamicReferenceService.SecretsManager, parts.join(':')); + const dyref = new CfnDynamicReference(CfnDynamicReferenceService.SECRETS_MANAGER, parts.join(':')); return this.cfnDynamicReference(dyref); } @@ -63,7 +63,7 @@ export class SecretValue extends Intrinsic { */ public static ssmSecure(parameterName: string, version: string): SecretValue { const parts = [ parameterName, version ]; - return this.cfnDynamicReference(new CfnDynamicReference(CfnDynamicReferenceService.SsmSecure, parts.join(':'))); + return this.cfnDynamicReference(new CfnDynamicReference(CfnDynamicReferenceService.SSM_SECURE, parts.join(':'))); } /** diff --git a/packages/@aws-cdk/cdk/lib/stack.ts b/packages/@aws-cdk/cdk/lib/stack.ts index bb48ff67d36f0..ce507463cf8e7 100644 --- a/packages/@aws-cdk/cdk/lib/stack.ts +++ b/packages/@aws-cdk/cdk/lib/stack.ts @@ -192,7 +192,7 @@ export class Stack extends Construct implements ITaggable { this.environment = environment; this.stackName = props.stackName !== undefined ? props.stackName : this.calculateStackName(); - this.tags = new TagManager(TagType.KeyValue, 'aws:cdk:stack', props.tags); + this.tags = new TagManager(TagType.KEY_VALUE, 'aws:cdk:stack', props.tags); if (!VALID_STACK_NAME_REGEX.test(this.stackName)) { throw new Error(`Stack name must match the regular expression: ${VALID_STACK_NAME_REGEX.toString()}, got '${name}'`); @@ -526,7 +526,7 @@ export class Stack extends Construct implements ITaggable { // add an artifact that represents this stack builder.addArtifact(this.stackName, { - type: cxapi.ArtifactType.AwsCloudFormationStack, + type: cxapi.ArtifactType.AWS_CLOUDFORMATION_STACK, environment: this.environment, properties, dependencies: deps.length > 0 ? deps : undefined, diff --git a/packages/@aws-cdk/cdk/lib/tag-manager.ts b/packages/@aws-cdk/cdk/lib/tag-manager.ts index bfbe339aca96f..c4fefd3c53ff4 100644 --- a/packages/@aws-cdk/cdk/lib/tag-manager.ts +++ b/packages/@aws-cdk/cdk/lib/tag-manager.ts @@ -186,11 +186,11 @@ class NoFormat implements ITagFormatter { } const TAG_FORMATTERS: {[key: string]: ITagFormatter} = { - [TagType.AutoScalingGroup]: new AsgFormatter(), - [TagType.Standard]: new StandardFormatter(), - [TagType.Map]: new MapFormatter(), - [TagType.KeyValue]: new KeyValueFormatter(), - [TagType.NotTaggable]: new NoFormat(), + [TagType.AUTOSCALING_GROUP]: new AsgFormatter(), + [TagType.STANDARD]: new StandardFormatter(), + [TagType.MAP]: new MapFormatter(), + [TagType.KEY_VALUE]: new KeyValueFormatter(), + [TagType.NOT_TAGGABLE]: new NoFormat(), }; /** diff --git a/packages/@aws-cdk/cdk/test/test.construct.ts b/packages/@aws-cdk/cdk/test/test.construct.ts index 31c3a246852ea..932c34590b000 100644 --- a/packages/@aws-cdk/cdk/test/test.construct.ts +++ b/packages/@aws-cdk/cdk/test/test.construct.ts @@ -408,9 +408,9 @@ export = { new Construct(c2, '5'); // THEN - test.deepEqual(c1.node.findAll().map(x => x.node.id), c1.node.findAll(ConstructOrder.PreOrder).map(x => x.node.id)); // default is PreOrder - test.deepEqual(c1.node.findAll(ConstructOrder.PreOrder).map(x => x.node.id), [ '1', '2', '4', '5', '3' ]); - test.deepEqual(c1.node.findAll(ConstructOrder.PostOrder).map(x => x.node.id), [ '4', '5', '2', '3', '1' ]); + test.deepEqual(c1.node.findAll().map(x => x.node.id), c1.node.findAll(ConstructOrder.PREORDER).map(x => x.node.id)); // default is PreOrder + test.deepEqual(c1.node.findAll(ConstructOrder.PREORDER).map(x => x.node.id), [ '1', '2', '4', '5', '3' ]); + test.deepEqual(c1.node.findAll(ConstructOrder.POSTORDER).map(x => x.node.id), [ '4', '5', '2', '3', '1' ]); test.done(); }, diff --git a/packages/@aws-cdk/cdk/test/test.dynamic-reference.ts b/packages/@aws-cdk/cdk/test/test.dynamic-reference.ts index e233fb60b3991..33be26fdab223 100644 --- a/packages/@aws-cdk/cdk/test/test.dynamic-reference.ts +++ b/packages/@aws-cdk/cdk/test/test.dynamic-reference.ts @@ -7,7 +7,7 @@ export = { const stack = new Stack(); // WHEN - const ref = new CfnDynamicReference(CfnDynamicReferenceService.Ssm, 'a:b:c'); + const ref = new CfnDynamicReference(CfnDynamicReferenceService.SSM, 'a:b:c'); // THEN test.equal(stack.resolve(ref), '{{resolve:ssm:a:b:c}}'); diff --git a/packages/@aws-cdk/cdk/test/test.resource.ts b/packages/@aws-cdk/cdk/test/test.resource.ts index 7547b3e582240..9a9fab6daacee 100644 --- a/packages/@aws-cdk/cdk/test/test.resource.ts +++ b/packages/@aws-cdk/cdk/test/test.resource.ts @@ -215,8 +215,8 @@ export = { beforeAllowTrafficHook: 'lambda1', }, }; - r1.options.deletionPolicy = CfnDeletionPolicy.Retain; - r1.options.updateReplacePolicy = CfnDeletionPolicy.Snapshot; + r1.options.deletionPolicy = CfnDeletionPolicy.RETAIN; + r1.options.updateReplacePolicy = CfnDeletionPolicy.SNAPSHOT; test.deepEqual(toCloudFormation(stack), { Resources: { @@ -299,9 +299,9 @@ export = { const def = new CfnResource(stack, 'Default1', { type: 'T4' }); const def2 = new CfnResource(stack, 'Default2', { type: 'T4' }); - retain.applyRemovalPolicy(RemovalPolicy.Retain); - destroy.applyRemovalPolicy(RemovalPolicy.Destroy); - def.applyRemovalPolicy(undefined, { default: RemovalPolicy.Destroy }); + retain.applyRemovalPolicy(RemovalPolicy.RETAIN); + destroy.applyRemovalPolicy(RemovalPolicy.DESTROY); + def.applyRemovalPolicy(undefined, { default: RemovalPolicy.DESTROY }); def2.applyRemovalPolicy(undefined); test.deepEqual(toCloudFormation(stack), { diff --git a/packages/@aws-cdk/cdk/test/test.secret-value.ts b/packages/@aws-cdk/cdk/test/test.secret-value.ts index a818e5edff366..c6266857d4c5c 100644 --- a/packages/@aws-cdk/cdk/test/test.secret-value.ts +++ b/packages/@aws-cdk/cdk/test/test.secret-value.ts @@ -64,7 +64,7 @@ export = { const stack = new Stack(); // WHEN - const v = SecretValue.cfnDynamicReference(new CfnDynamicReference(CfnDynamicReferenceService.Ssm, 'foo:bar')); + const v = SecretValue.cfnDynamicReference(new CfnDynamicReference(CfnDynamicReferenceService.SSM, 'foo:bar')); // THEN test.deepEqual(stack.resolve(v), '{{resolve:ssm:foo:bar}}'); diff --git a/packages/@aws-cdk/cdk/test/test.synthesis.ts b/packages/@aws-cdk/cdk/test/test.synthesis.ts index c7b2a506e8c7c..4da477d69c07c 100644 --- a/packages/@aws-cdk/cdk/test/test.synthesis.ts +++ b/packages/@aws-cdk/cdk/test/test.synthesis.ts @@ -55,7 +55,7 @@ export = { protected synthesize(s: ISynthesisSession) { writeJson(s.assembly.outdir, 'foo.json', { bar: 123 }); s.assembly.addArtifact('my-random-construct', { - type: cxapi.ArtifactType.AwsCloudFormationStack, + type: cxapi.ArtifactType.AWS_CLOUDFORMATION_STACK, environment: 'aws://12345/bar', properties: { templateFile: 'foo.json' @@ -107,7 +107,7 @@ export = { calls.push('synthesize'); session.assembly.addArtifact('art', { - type: cxapi.ArtifactType.AwsCloudFormationStack, + type: cxapi.ArtifactType.AWS_CLOUDFORMATION_STACK, properties: { templateFile: 'hey.json', parameters: { diff --git a/packages/@aws-cdk/cdk/test/test.tag-aspect.ts b/packages/@aws-cdk/cdk/test/test.tag-aspect.ts index db23478cc59c8..6b755616e3536 100644 --- a/packages/@aws-cdk/cdk/test/test.tag-aspect.ts +++ b/packages/@aws-cdk/cdk/test/test.tag-aspect.ts @@ -6,7 +6,7 @@ class TaggableResource extends CfnResource { constructor(scope: Construct, id: string, props: CfnResourceProps) { super(scope, id, props); const tags = props.properties === undefined ? undefined : props.properties.tags; - this.tags = new TagManager(TagType.Standard, 'AWS::Fake::Resource', tags); + this.tags = new TagManager(TagType.STANDARD, 'AWS::Fake::Resource', tags); } public testProperties() { return this.cfnProperties; @@ -18,7 +18,7 @@ class AsgTaggableResource extends CfnResource { constructor(scope: Construct, id: string, props: CfnResourceProps) { super(scope, id, props); const tags = props.properties === undefined ? undefined : props.properties.tags; - this.tags = new TagManager(TagType.AutoScalingGroup, 'AWS::Fake::Resource', tags); + this.tags = new TagManager(TagType.AUTOSCALING_GROUP, 'AWS::Fake::Resource', tags); } public testProperties() { return this.cfnProperties; @@ -30,7 +30,7 @@ class MapTaggableResource extends CfnResource { constructor(scope: Construct, id: string, props: CfnResourceProps) { super(scope, id, props); const tags = props.properties === undefined ? undefined : props.properties.tags; - this.tags = new TagManager(TagType.Map, 'AWS::Fake::Resource', tags); + this.tags = new TagManager(TagType.MAP, 'AWS::Fake::Resource', tags); } public testProperties() { return this.cfnProperties; diff --git a/packages/@aws-cdk/cdk/test/test.tag-manager.ts b/packages/@aws-cdk/cdk/test/test.tag-manager.ts index 05d4ee7c132f5..f27390a1954be 100644 --- a/packages/@aws-cdk/cdk/test/test.tag-manager.ts +++ b/packages/@aws-cdk/cdk/test/test.tag-manager.ts @@ -4,19 +4,19 @@ import { TagManager } from '../lib/tag-manager'; export = { '#setTag() supports setting a tag regardless of Type'(test: Test) { - const notTaggable = new TagManager(TagType.NotTaggable, 'AWS::Resource::Type'); + const notTaggable = new TagManager(TagType.NOT_TAGGABLE, 'AWS::Resource::Type'); notTaggable.setTag('key', 'value'); test.deepEqual(notTaggable.renderTags(), undefined); test.done(); }, 'when a tag does not exist': { '#removeTag() does not throw an error'(test: Test) { - const mgr = new TagManager(TagType.Standard, 'AWS::Resource::Type'); + const mgr = new TagManager(TagType.STANDARD, 'AWS::Resource::Type'); test.doesNotThrow(() => (mgr.removeTag('dne', 0))); test.done(); }, '#setTag() creates the tag'(test: Test) { - const mgr = new TagManager(TagType.Standard, 'AWS::Resource::Type'); + const mgr = new TagManager(TagType.STANDARD, 'AWS::Resource::Type'); mgr.setTag('dne', 'notanymore'); test.deepEqual(mgr.renderTags(), [{key: 'dne', value: 'notanymore'}]); test.done(); @@ -24,14 +24,14 @@ export = { }, 'when a tag does exist': { '#removeTag() deletes the tag'(test: Test) { - const mgr = new TagManager(TagType.Standard, 'AWS::Resource::Type'); + const mgr = new TagManager(TagType.STANDARD, 'AWS::Resource::Type'); mgr.setTag('dne', 'notanymore', 0); mgr.removeTag('dne', 0); test.deepEqual(mgr.renderTags(), undefined); test.done(); }, '#setTag() overwrites the tag'(test: Test) { - const mgr = new TagManager(TagType.Standard, 'AWS::Resource::Type'); + const mgr = new TagManager(TagType.STANDARD, 'AWS::Resource::Type'); mgr.setTag('dne', 'notanymore'); mgr.setTag('dne', 'iwin'); test.deepEqual(mgr.renderTags(), [{key: 'dne', value: 'iwin'}]); @@ -40,22 +40,22 @@ export = { }, 'when there are no tags': { '#renderTags() returns undefined'(test: Test) { - const mgr = new TagManager(TagType.Standard, 'AWS::Resource::Type'); + const mgr = new TagManager(TagType.STANDARD, 'AWS::Resource::Type'); test.deepEqual(mgr.renderTags(), undefined); test.done(); }, '#hasTags() returns false'(test: Test) { - const mgr = new TagManager(TagType.Standard, 'AWS::Resource::Type'); + const mgr = new TagManager(TagType.STANDARD, 'AWS::Resource::Type'); test.equal(mgr.hasTags(), false); test.done(); } }, '#renderTags() handles standard, map, keyValue, and ASG tag formats'(test: Test) { const tagged: TagManager[] = []; - const standard = new TagManager(TagType.Standard, 'AWS::Resource::Type'); - const asg = new TagManager(TagType.AutoScalingGroup, 'AWS::Resource::Type'); - const keyValue = new TagManager(TagType.KeyValue, 'AWS::Resource::Type'); - const mapper = new TagManager(TagType.Map, 'AWS::Resource::Type'); + const standard = new TagManager(TagType.STANDARD, 'AWS::Resource::Type'); + const asg = new TagManager(TagType.AUTOSCALING_GROUP, 'AWS::Resource::Type'); + const keyValue = new TagManager(TagType.KEY_VALUE, 'AWS::Resource::Type'); + const mapper = new TagManager(TagType.MAP, 'AWS::Resource::Type'); tagged.push(standard); tagged.push(asg); tagged.push(keyValue); @@ -83,14 +83,14 @@ export = { test.done(); }, 'when there are tags it hasTags returns true'(test: Test) { - const mgr = new TagManager(TagType.Standard, 'AWS::Resource::Type'); + const mgr = new TagManager(TagType.STANDARD, 'AWS::Resource::Type'); mgr.setTag('key', 'myVal', 2); mgr.setTag('key', 'newVal', 1); test.equal(mgr.hasTags(), true); test.done(); }, 'tags with higher or equal priority always take precedence'(test: Test) { - const mgr = new TagManager(TagType.Standard, 'AWS::Resource::Type'); + const mgr = new TagManager(TagType.STANDARD, 'AWS::Resource::Type'); mgr.setTag('key', 'myVal', 2); mgr.setTag('key', 'newVal', 1); test.deepEqual(mgr.renderTags(), [ @@ -105,7 +105,7 @@ export = { test.done(); }, 'excludeResourceTypes only tags resources that do not match'(test: Test) { - const mgr = new TagManager(TagType.Standard, 'AWS::Fake::Resource'); + const mgr = new TagManager(TagType.STANDARD, 'AWS::Fake::Resource'); test.equal(false, mgr.applyTagAspectHere([], ['AWS::Fake::Resource'])); test.equal(true, mgr.applyTagAspectHere([], ['AWS::Wrong::Resource'])); @@ -113,7 +113,7 @@ export = { test.done(); }, 'includeResourceTypes only tags resources that match'(test: Test) { - const mgr = new TagManager(TagType.Standard, 'AWS::Fake::Resource'); + const mgr = new TagManager(TagType.STANDARD, 'AWS::Fake::Resource'); test.equal(true, mgr.applyTagAspectHere(['AWS::Fake::Resource'], [])); test.equal(false, mgr.applyTagAspectHere(['AWS::Wrong::Resource'], [])); diff --git a/packages/@aws-cdk/cx-api/lib/cloud-artifact.ts b/packages/@aws-cdk/cx-api/lib/cloud-artifact.ts index 662152284dd74..c7fbbe188ee7f 100644 --- a/packages/@aws-cdk/cx-api/lib/cloud-artifact.ts +++ b/packages/@aws-cdk/cx-api/lib/cloud-artifact.ts @@ -13,12 +13,12 @@ import { * Type of cloud artifact. */ export enum ArtifactType { - None = 'none', // required due to a jsii bug + NONE = 'none', // required due to a jsii bug /** * The artifact is an AWS CloudFormation stack. */ - AwsCloudFormationStack = 'aws:cloudformation:stack', + AWS_CLOUDFORMATION_STACK = 'aws:cloudformation:stack', } /** @@ -78,7 +78,7 @@ export class CloudArtifact { */ public static from(assembly: CloudAssembly, id: string, artifact: ArtifactManifest): CloudArtifact { switch (artifact.type) { - case ArtifactType.AwsCloudFormationStack: + case ArtifactType.AWS_CLOUDFORMATION_STACK: return new CloudFormationStackArtifact(assembly, id, artifact); default: diff --git a/packages/@aws-cdk/cx-api/test/cloud-assembly-builder.test.ts b/packages/@aws-cdk/cx-api/test/cloud-assembly-builder.test.ts index 79380b99e64bb..5490329fbf1a8 100644 --- a/packages/@aws-cdk/cx-api/test/cloud-assembly-builder.test.ts +++ b/packages/@aws-cdk/cx-api/test/cloud-assembly-builder.test.ts @@ -12,7 +12,7 @@ test('cloud assembly builder', () => { // WHEN session.addArtifact('my-first-artifact', { - type: ArtifactType.AwsCloudFormationStack, + type: ArtifactType.AWS_CLOUDFORMATION_STACK, environment: 'aws://1222344/us-east-1', dependencies: ['minimal-artifact'], metadata: { @@ -37,7 +37,7 @@ test('cloud assembly builder', () => { }); session.addArtifact('minimal-artifact', { - type: ArtifactType.AwsCloudFormationStack, + type: ArtifactType.AWS_CLOUDFORMATION_STACK, environment: 'aws://111/helo-world', properties: { templateFile diff --git a/packages/aws-cdk/lib/api/bootstrap-environment.ts b/packages/aws-cdk/lib/api/bootstrap-environment.ts index 8c9baeb090c8b..630a9810f0de7 100644 --- a/packages/aws-cdk/lib/api/bootstrap-environment.ts +++ b/packages/aws-cdk/lib/api/bootstrap-environment.ts @@ -43,7 +43,7 @@ export async function bootstrapEnvironment(environment: cxapi.Environment, aws: await fs.writeJson(path.join(builder.outdir, templateFile), template, { spaces: 2 }); builder.addArtifact(toolkitStackName, { - type: cxapi.ArtifactType.AwsCloudFormationStack, + type: cxapi.ArtifactType.AWS_CLOUDFORMATION_STACK, environment: cxapi.EnvironmentUtils.format(environment.account, environment.region), properties: { templateFile diff --git a/packages/aws-cdk/test/util.ts b/packages/aws-cdk/test/util.ts index ff725a322f990..2e1c11d97693b 100644 --- a/packages/aws-cdk/test/util.ts +++ b/packages/aws-cdk/test/util.ts @@ -26,7 +26,7 @@ export function testAssembly(...stacks: TestStackArtifact[]): cxapi.CloudAssembl } builder.addArtifact(stack.stackName, { - type: cxapi.ArtifactType.AwsCloudFormationStack, + type: cxapi.ArtifactType.AWS_CLOUDFORMATION_STACK, environment: 'aws://12345/here', dependencies: stack.depends, diff --git a/packages/decdk/examples/ecs.json b/packages/decdk/examples/ecs.json index 426df7464c7b7..ea85e12144140 100644 --- a/packages/decdk/examples/ecs.json +++ b/packages/decdk/examples/ecs.json @@ -16,11 +16,11 @@ "MyTaskDef": { "Type": "@aws-cdk/aws-ecs.TaskDefinition", "Properties": { - "compatibility": "Fargate", + "compatibility": "FARGATE", "family": "redis", "cpu": "1024", "memoryMiB": "1GB", - "networkMode": "AwsVpc" + "networkMode": "AWS_VPC" } }, "ContainerDef": { diff --git a/tools/cfn2ts/lib/codegen.ts b/tools/cfn2ts/lib/codegen.ts index 68b9a6eac33d4..ac73b98a02ab9 100644 --- a/tools/cfn2ts/lib/codegen.ts +++ b/tools/cfn2ts/lib/codegen.ts @@ -720,20 +720,20 @@ function tagType(resource: schema.ResourceType): string { if (schema.isTaggableResource(resource)) { const prop = resource.Properties.Tags; if (schema.isTagPropertyStandard(prop)) { - return `${TAG_TYPE}.Standard`; + return `${TAG_TYPE}.STANDARD`; } if (schema.isTagPropertyAutoScalingGroup(prop)) { - return `${TAG_TYPE}.AutoScalingGroup`; + return `${TAG_TYPE}.AUTOSCALING_GROUP`; } if (schema.isTagPropertyJson(prop) || schema.isTagPropertyStringMap(prop)) { - return `${TAG_TYPE}.Map`; + return `${TAG_TYPE}.MAP`; } } - return `${TAG_TYPE}.NotTaggable`; + return `${TAG_TYPE}.NOT_TAGGABLE`; } function isTaggable(resource: schema.ResourceType): boolean { - return tagType(resource) !== `${TAG_TYPE}.NotTaggable`; + return tagType(resource) !== `${TAG_TYPE}.NOT_TAGGABLE`; } enum Container {