Skip to content

Commit

Permalink
refactor(ecs): rename hwType to hardwareType (aws#2916)
Browse files Browse the repository at this point in the history
This change spells out the previously abbreviated `hwType` into `hardwareType` and it closes aws#2896.

BREAKING CHANGE: 

* **ecs**: the property that specifies the type of EC2 AMI optimized for ECS was renamed to `hardwareType` from `hwType`.
  • Loading branch information
hencrice authored and rix0rrr committed Jun 19, 2019
1 parent 5b44a4d commit 1aa0589
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-ecs/lib/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -230,7 +230,7 @@ export interface EcsOptimizedAmiProps {
*
* @default AmiHardwareType.Standard
*/
readonly hwType?: AmiHardwareType;
readonly hardwareType?: AmiHardwareType;
}

/**
Expand All @@ -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`);
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-ecs/test/test.ecs-cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}),
});

Expand All @@ -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,
}),
});
});
Expand Down

0 comments on commit 1aa0589

Please sign in to comment.