LaunchTemplateSpotOptions Struct
Interface for the Spot market instance options provided in a LaunchTemplate.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from 'aws-cdk-lib';
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
declare const expiration: cdk.Expiration;
const launchTemplateSpotOptions: ec2.LaunchTemplateSpotOptions = {
blockDuration: cdk.Duration.minutes(30),
interruptionBehavior: ec2.SpotInstanceInterruption.STOP,
maxPrice: 123,
requestType: ec2.SpotRequestType.ONE_TIME,
validUntil: expiration,
};
Properties
blockDurationDurationblock_durationDurationblockDurationDurationBlockDurationDurationBlockDurationDuration= Requested spot instances do not …#You can use a duration of 1, 2, 3, 4, 5, or 6 hours.
default
Default: Requested spot instances do not have a pre-defined duration.
interruptionBehaviorSpotInstanceInterruptioninterruption_behaviorSpotInstanceInterruptioninterruptionBehaviorSpotInstanceInterruptionInterruptionBehaviorSpotInstanceInterruptionInterruptionBehaviorSpotInstanceInterruption= Spot instances will terminate wh…#default
Default: Spot instances will terminate when interrupted.
maxPricenumbermax_priceint | floatmaxPriceNumberMaxPricedoubleMaxPrice*float64= Maximum hourly price will defaul…#The value is given in dollars. ex: 0.01 for 1 cent per hour, or 0.001 for one-tenth of a cent per hour.
default
Default: Maximum hourly price will default to the on-demand price for the instance type.
requestTypeSpotRequestTyperequest_typeSpotRequestTyperequestTypeSpotRequestTypeRequestTypeSpotRequestTypeRequestTypeSpotRequestType= One-time spot request.#If you are using Spot Instances with an Auto Scaling group, use one-time requests, as the Amazon EC2 Auto Scaling service handles requesting new Spot Instances whenever the group is below its desired capacity.
validUntilExpirationvalid_untilExpirationvalidUntilExpirationValidUntilExpirationValidUntilExpiration= The default end date is 7 days f…#For a one-time request, the request remains active until all instances launch, the request is canceled, or this date is reached. If the request is persistent, it remains active until it is canceled or this date and time is reached.
default
Default: The default end date is 7 days from the current date.