Class CfnLaunchTemplate.SpotOptionsProperty
Specifies options for Spot Instances.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnLaunchTemplate.SpotOptionsProperty : CfnLaunchTemplate.ISpotOptionsProperty
Syntax (vb)
Public Class CfnLaunchTemplate.SpotOptionsProperty Implements CfnLaunchTemplate.ISpotOptionsProperty
Remarks
SpotOptions is a property of AWS::EC2::LaunchTemplate InstanceMarketOptions .
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.EC2;
var spotOptionsProperty = new SpotOptionsProperty {
BlockDurationMinutes = 123,
InstanceInterruptionBehavior = "instanceInterruptionBehavior",
MaxPrice = "maxPrice",
SpotInstanceType = "spotInstanceType",
ValidUntil = "validUntil"
};
Synopsis
Constructors
| SpotOptionsProperty() | Specifies options for Spot Instances. |
Properties
| BlockDurationMinutes | Deprecated. |
| InstanceInterruptionBehavior | The behavior when a Spot Instance is interrupted. |
| MaxPrice | The maximum hourly price you're willing to pay for a Spot Instance. |
| SpotInstanceType | The Spot Instance request type. |
| ValidUntil | The end date of the request, in UTC format ( YYYY-MM-DD T HH:MM:SS Z). Supported only for persistent requests. |
Constructors
SpotOptionsProperty()
Specifies options for Spot Instances.
public SpotOptionsProperty()
Remarks
SpotOptions is a property of AWS::EC2::LaunchTemplate InstanceMarketOptions .
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.EC2;
var spotOptionsProperty = new SpotOptionsProperty {
BlockDurationMinutes = 123,
InstanceInterruptionBehavior = "instanceInterruptionBehavior",
MaxPrice = "maxPrice",
SpotInstanceType = "spotInstanceType",
ValidUntil = "validUntil"
};
Properties
BlockDurationMinutes
Deprecated.
public double? BlockDurationMinutes { get; set; }
Property Value
Remarks
InstanceInterruptionBehavior
The behavior when a Spot Instance is interrupted.
public string? InstanceInterruptionBehavior { get; set; }
Property Value
Remarks
MaxPrice
The maximum hourly price you're willing to pay for a Spot Instance.
public string? MaxPrice { get; set; }
Property Value
Remarks
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.
SpotInstanceType
The Spot Instance request type.
public string? SpotInstanceType { get; set; }
Property Value
Remarks
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.
ValidUntil
The end date of the request, in UTC format ( YYYY-MM-DD T HH:MM:SS Z). Supported only for persistent requests.
public string? ValidUntil { get; set; }
Property Value
Remarks
Default: 7 days from the current date