Skip to content

Commit 1aa0589

Browse files
hencricerix0rrr
authored andcommitted
refactor(ecs): rename hwType to hardwareType (#2916)
This change spells out the previously abbreviated `hwType` into `hardwareType` and it closes #2896. BREAKING CHANGE: * **ecs**: the property that specifies the type of EC2 AMI optimized for ECS was renamed to `hardwareType` from `hwType`.
1 parent 5b44a4d commit 1aa0589

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/@aws-cdk/aws-ecs/lib/cluster.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ export interface EcsOptimizedAmiProps {
221221
/**
222222
* What generation of Amazon Linux to use
223223
*
224-
* @default AmazonLinuxGeneration.AmazonLinux if hwType equal to AmiHardwareType.Standard else AmazonLinuxGeneration.AmazonLinux2
224+
* @default AmazonLinuxGeneration.AmazonLinux if hardwareType equal to AmiHardwareType.Standard else AmazonLinuxGeneration.AmazonLinux2
225225
*/
226226
readonly generation?: ec2.AmazonLinuxGeneration;
227227

@@ -230,7 +230,7 @@ export interface EcsOptimizedAmiProps {
230230
*
231231
* @default AmiHardwareType.Standard
232232
*/
233-
readonly hwType?: AmiHardwareType;
233+
readonly hardwareType?: AmiHardwareType;
234234
}
235235

236236
/**
@@ -243,7 +243,7 @@ export class EcsOptimizedAmi implements ec2.IMachineImageSource {
243243
private readonly amiParameterName: string;
244244

245245
constructor(props?: EcsOptimizedAmiProps) {
246-
this.hwType = (props && props.hwType) || AmiHardwareType.Standard;
246+
this.hwType = (props && props.hardwareType) || AmiHardwareType.Standard;
247247
if (props && props.generation) { // generation defined in the props object
248248
if (props.generation === ec2.AmazonLinuxGeneration.AmazonLinux && this.hwType !== AmiHardwareType.Standard) {
249249
throw new Error(`Amazon Linux does not support special hardware type. Use Amazon Linux 2 instead`);

packages/@aws-cdk/aws-ecs/test/test.ecs-cluster.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ export = {
229229
cluster.addCapacity('GpuAutoScalingGroup', {
230230
instanceType: new ec2.InstanceType('t2.micro'),
231231
machineImage: new ecs.EcsOptimizedAmi({
232-
hwType: ecs.AmiHardwareType.Gpu
232+
hardwareType: ecs.AmiHardwareType.Gpu
233233
}),
234234
});
235235

@@ -254,7 +254,7 @@ export = {
254254
instanceType: new ec2.InstanceType('t2.micro'),
255255
machineImage: new ecs.EcsOptimizedAmi({
256256
generation: ec2.AmazonLinuxGeneration.AmazonLinux,
257-
hwType: ecs.AmiHardwareType.Gpu,
257+
hardwareType: ecs.AmiHardwareType.Gpu,
258258
}),
259259
});
260260
});

0 commit comments

Comments
 (0)