Show / Hide Table of Contents

Class LaunchTemplateSpotOptions

Interface for the Spot market instance options provided in a LaunchTemplate.

Inheritance
object
LaunchTemplateSpotOptions
Implements
ILaunchTemplateSpotOptions
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class LaunchTemplateSpotOptions : ILaunchTemplateSpotOptions
Syntax (vb)
Public Class LaunchTemplateSpotOptions Implements ILaunchTemplateSpotOptions
Remarks

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;
            using Amazon.CDK.AWS.EC2;

            Expiration expiration;

            var launchTemplateSpotOptions = new LaunchTemplateSpotOptions {
                BlockDuration = Duration.Minutes(30),
                InterruptionBehavior = SpotInstanceInterruption.STOP,
                MaxPrice = 123,
                RequestType = SpotRequestType.ONE_TIME,
                ValidUntil = expiration
            };

Synopsis

Constructors

LaunchTemplateSpotOptions()

Interface for the Spot market instance options provided in a LaunchTemplate.

Properties

BlockDuration

Spot Instances with a defined duration (also known as Spot blocks) are designed not to be interrupted and will run continuously for the duration you select.

InterruptionBehavior

The behavior when a Spot Instance is interrupted.

MaxPrice

Maximum hourly price you're willing to pay for each Spot instance.

RequestType

The Spot Instance request type.

ValidUntil

The end date of the request.

Constructors

LaunchTemplateSpotOptions()

Interface for the Spot market instance options provided in a LaunchTemplate.

public LaunchTemplateSpotOptions()
Remarks

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;
            using Amazon.CDK.AWS.EC2;

            Expiration expiration;

            var launchTemplateSpotOptions = new LaunchTemplateSpotOptions {
                BlockDuration = Duration.Minutes(30),
                InterruptionBehavior = SpotInstanceInterruption.STOP,
                MaxPrice = 123,
                RequestType = SpotRequestType.ONE_TIME,
                ValidUntil = expiration
            };

Properties

BlockDuration

Spot Instances with a defined duration (also known as Spot blocks) are designed not to be interrupted and will run continuously for the duration you select.

public Duration? BlockDuration { get; set; }
Property Value

Duration

Remarks

You can use a duration of 1, 2, 3, 4, 5, or 6 hours.

Default: Requested spot instances do not have a pre-defined duration.

See: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-requests.html#fixed-duration-spot-instances

InterruptionBehavior

The behavior when a Spot Instance is interrupted.

public SpotInstanceInterruption? InterruptionBehavior { get; set; }
Property Value

SpotInstanceInterruption?

Remarks

Default: Spot instances will terminate when interrupted.

MaxPrice

Maximum hourly price you're willing to pay for each Spot instance.

public double? MaxPrice { get; set; }
Property Value

double?

Remarks

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: Maximum hourly price will default to the on-demand price for the instance type.

RequestType

The Spot Instance request type.

public SpotRequestType? RequestType { get; set; }
Property Value

SpotRequestType?

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.

Default: One-time spot request.

ValidUntil

The end date of the request.

public Expiration? ValidUntil { get; set; }
Property Value

Expiration

Remarks

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: The default end date is 7 days from the current date.

Implements

ILaunchTemplateSpotOptions
Back to top Generated by DocFX