From 5b6b49f0af3cb2bb75c96f9832e56edf23427c65 Mon Sep 17 00:00:00 2001 From: Yenlin Chen <3822365+hencrice@users.noreply.github.com> Date: Mon, 17 Jun 2019 18:17:30 -0700 Subject: [PATCH] refactor(ecs): rename `hwType` in `EcsOptimizedAmiProps` to `hardwareType` This change spells out the previously abbreviated `hwType` into `hardwareType` and it closes #2896. BREAKING CHANGE: the property that specifies the type of EC2 AMI optimized for ECS was renamed to `hardwareType` from `hwType`. --- packages/@aws-cdk/aws-ecs/lib/cluster.ts | 6 +++--- packages/@aws-cdk/aws-ecs/test/test.ecs-cluster.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/@aws-cdk/aws-ecs/lib/cluster.ts b/packages/@aws-cdk/aws-ecs/lib/cluster.ts index 4ac0dcbffb6a4..9d65e43a5d059 100644 --- a/packages/@aws-cdk/aws-ecs/lib/cluster.ts +++ b/packages/@aws-cdk/aws-ecs/lib/cluster.ts @@ -221,7 +221,7 @@ export interface EcsOptimizedAmiProps { /** * What generation of Amazon Linux to use * - * @default AmazonLinuxGeneration.AmazonLinux if hwType equal to AmiHardwareType.Standard else AmazonLinuxGeneration.AmazonLinux2 + * @default AmazonLinuxGeneration.AmazonLinux if hardwareType equal to AmiHardwareType.Standard else AmazonLinuxGeneration.AmazonLinux2 */ readonly generation?: ec2.AmazonLinuxGeneration; @@ -230,7 +230,7 @@ export interface EcsOptimizedAmiProps { * * @default AmiHardwareType.Standard */ - readonly hwType?: AmiHardwareType; + readonly hardwareType?: AmiHardwareType; } /** @@ -243,7 +243,7 @@ export class EcsOptimizedAmi implements ec2.IMachineImageSource { private readonly amiParameterName: string; constructor(props?: EcsOptimizedAmiProps) { - this.hwType = (props && props.hwType) || AmiHardwareType.Standard; + this.hwType = (props && props.hardwareType) || AmiHardwareType.Standard; if (props && props.generation) { // generation defined in the props object if (props.generation === ec2.AmazonLinuxGeneration.AmazonLinux && this.hwType !== AmiHardwareType.Standard) { throw new Error(`Amazon Linux does not support special hardware type. Use Amazon Linux 2 instead`); diff --git a/packages/@aws-cdk/aws-ecs/test/test.ecs-cluster.ts b/packages/@aws-cdk/aws-ecs/test/test.ecs-cluster.ts index aadabf7c3f485..a2986621549a7 100644 --- a/packages/@aws-cdk/aws-ecs/test/test.ecs-cluster.ts +++ b/packages/@aws-cdk/aws-ecs/test/test.ecs-cluster.ts @@ -229,7 +229,7 @@ export = { cluster.addCapacity('GpuAutoScalingGroup', { instanceType: new ec2.InstanceType('t2.micro'), machineImage: new ecs.EcsOptimizedAmi({ - hwType: ecs.AmiHardwareType.Gpu + hardwareType: ecs.AmiHardwareType.Gpu }), }); @@ -254,7 +254,7 @@ export = { instanceType: new ec2.InstanceType('t2.micro'), machineImage: new ecs.EcsOptimizedAmi({ generation: ec2.AmazonLinuxGeneration.AmazonLinux, - hwType: ecs.AmiHardwareType.Gpu, + hardwareType: ecs.AmiHardwareType.Gpu, }), }); });