Interface LaunchTemplateSpotOptions

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
LaunchTemplateSpotOptions.Jsii$Proxy

@Generated(value="jsii-pacmak/1.104.0 (build e79254c)", date="2024-11-06T23:25:08.849Z") @Stability(Stable) public interface LaunchTemplateSpotOptions extends software.amazon.jsii.JsiiSerializable
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 software.amazon.awscdk.*;
 import software.amazon.awscdk.services.ec2.*;
 Expiration expiration;
 LaunchTemplateSpotOptions launchTemplateSpotOptions = LaunchTemplateSpotOptions.builder()
         .blockDuration(Duration.minutes(30))
         .interruptionBehavior(SpotInstanceInterruption.STOP)
         .maxPrice(123)
         .requestType(SpotRequestType.ONE_TIME)
         .validUntil(expiration)
         .build();
 
  • Method Details

    • getBlockDuration

      @Stability(Stable) @Nullable default Duration getBlockDuration()
      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.

      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 Also:
    • getInterruptionBehavior

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

      Default: Spot instances will terminate when interrupted.

    • getMaxPrice

      @Stability(Stable) @Nullable default Number getMaxPrice()
      Maximum hourly price you're willing to pay for each Spot instance.

      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.

    • getRequestType

      @Stability(Stable) @Nullable default SpotRequestType getRequestType()
      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.

      Default: One-time spot request.

    • getValidUntil

      @Stability(Stable) @Nullable default Expiration getValidUntil()
      The end date of the request.

      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.

    • builder

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