Interface CfnLaunchTemplate.SpotOptionsProperty

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
CfnLaunchTemplate.SpotOptionsProperty.Jsii$Proxy
Enclosing class:
CfnLaunchTemplate

@Stability(Stable) public static interface CfnLaunchTemplate.SpotOptionsProperty extends software.amazon.jsii.JsiiSerializable
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 software.amazon.awscdk.services.ec2.*;
 SpotOptionsProperty spotOptionsProperty = SpotOptionsProperty.builder()
         .blockDurationMinutes(123)
         .instanceInterruptionBehavior("instanceInterruptionBehavior")
         .maxPrice("maxPrice")
         .spotInstanceType("spotInstanceType")
         .validUntil("validUntil")
         .build();
 
  • Method Details

    • getBlockDurationMinutes

      @Stability(Stable) @Nullable default Number getBlockDurationMinutes()
      Deprecated.
    • getInstanceInterruptionBehavior

      @Stability(Stable) @Nullable default String getInstanceInterruptionBehavior()
      The behavior when a Spot Instance is interrupted.

      The default is terminate .

    • getMaxPrice

      @Stability(Stable) @Nullable default String getMaxPrice()
      The maximum hourly price you're willing to pay for the Spot Instances.

      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 specify a maximum price, your Spot Instances will be interrupted more frequently than if you do not specify this parameter.

    • getSpotInstanceType

      @Stability(Stable) @Nullable default String getSpotInstanceType()
      The Spot Instance request type.

      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.

    • getValidUntil

      @Stability(Stable) @Nullable default String getValidUntil()
      The end date of the request, in UTC format ( YYYY-MM-DD T HH:MM:SS Z). Supported only for persistent requests.

      • For a persistent request, the request remains active until the ValidUntil date and time is reached. Otherwise, the request remains active until you cancel it.
      • For a one-time request, ValidUntil is not supported. The request remains active until all instances launch or you cancel the request.

      Default: 7 days from the current date

    • builder

      @Stability(Stable) static CfnLaunchTemplate.SpotOptionsProperty.Builder builder()
      Returns:
      a CfnLaunchTemplate.SpotOptionsProperty.Builder of CfnLaunchTemplate.SpotOptionsProperty