Skip to content

Commit d640055

Browse files
SoManyHsrix0rrr
authored andcommitted
feat(autoscaling): allow setting spotPrice (#2571)
Fixes #2208.
1 parent 5fe0af5 commit d640055

File tree

6 files changed

+540
-1
lines changed

6 files changed

+540
-1
lines changed

packages/@aws-cdk/aws-autoscaling/lib/auto-scaling-group.ts

+9
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,14 @@ export interface CommonAutoScalingGroupProps {
148148
* @default - Use subnet setting.
149149
*/
150150
readonly associatePublicIpAddress?: boolean;
151+
152+
/**
153+
* The maximum hourly price (in USD) to be paid for any Spot Instance launched to fulfill the request. Spot Instances are
154+
* launched when the price you specify exceeds the current Spot market price.
155+
*
156+
* @default none
157+
*/
158+
readonly spotPrice?: string;
151159
}
152160

153161
/**
@@ -378,6 +386,7 @@ export class AutoScalingGroup extends AutoScalingGroupBase implements
378386
iamInstanceProfile: iamProfile.ref,
379387
userData: userDataToken,
380388
associatePublicIpAddress: props.associatePublicIpAddress,
389+
spotPrice: props.spotPrice,
381390
});
382391

383392
launchConfig.node.addDependency(this.role);

0 commit comments

Comments
 (0)