SpotOptionsProperty Struct
Specifies options for Spot Instances.
SpotOptions is a property of AWS::EC2::LaunchTemplate InstanceMarketOptions .
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
const spotOptionsProperty: ec2.CfnLaunchTemplate.SpotOptionsProperty = {
blockDurationMinutes: 123,
instanceInterruptionBehavior: 'instanceInterruptionBehavior',
maxPrice: 'maxPrice',
spotInstanceType: 'spotInstanceType',
validUntil: 'validUntil',
};
Properties
blockDurationMinutesnumberblock_duration_minutesint | floatblockDurationMinutesNumberBlockDurationMinutesdoubleBlockDurationMinutes*float64#instanceInterruptionBehaviorstringinstance_interruption_behaviorstrinstanceInterruptionBehaviorStringInstanceInterruptionBehaviorstringInstanceInterruptionBehavior*string#The default is terminate .
notes
We do not recommend using this parameter because it can lead to increased interruptions. If you do not specify this parameter, you will pay the current Spot price. If you do specify this parameter, it must be more than USD $0.001. Specifying a value below USD $0.001 will result in an InvalidParameterValue error message when the launch template is used to launch an instance.
If you specify a maximum price, your Spot Instances will be interrupted more frequently than if you do not specify this parameter.
spotInstanceTypestringspot_instance_typestrspotInstanceTypeStringSpotInstanceTypestringSpotInstanceType*string#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.
notes
- For a persistent request, the request remains active until the
ValidUntildate and time is reached. Otherwise, the request remains active until you cancel it. - For a one-time request,
ValidUntilis not supported. The request remains active until all instances launch or you cancel the request.
Default: 7 days from the current date