Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(ecs): rename hwType in EcsOptimizedAmiProps to `hardware… #2916

Merged
merged 1 commit into from
Jun 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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