Skip to content

Commit

Permalink
feat(autoscaling): allow setting spotPrice (#2571)
Browse files Browse the repository at this point in the history
Fixes #2208.
  • Loading branch information
SoManyHs authored and rix0rrr committed May 29, 2019
1 parent 5fe0af5 commit d640055
Show file tree
Hide file tree
Showing 6 changed files with 540 additions and 1 deletion.
9 changes: 9 additions & 0 deletions packages/@aws-cdk/aws-autoscaling/lib/auto-scaling-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,14 @@ export interface CommonAutoScalingGroupProps {
* @default - Use subnet setting.
*/
readonly associatePublicIpAddress?: boolean;

/**
* The maximum hourly price (in USD) to be paid for any Spot Instance launched to fulfill the request. Spot Instances are
* launched when the price you specify exceeds the current Spot market price.
*
* @default none
*/
readonly spotPrice?: string;
}

/**
Expand Down Expand Up @@ -378,6 +386,7 @@ export class AutoScalingGroup extends AutoScalingGroupBase implements
iamInstanceProfile: iamProfile.ref,
userData: userDataToken,
associatePublicIpAddress: props.associatePublicIpAddress,
spotPrice: props.spotPrice,
});

launchConfig.node.addDependency(this.role);
Expand Down
Loading

0 comments on commit d640055

Please sign in to comment.