Class CfnLaunchTemplatePropsMixin.SpotOptionsProperty.Builder
java.lang.Object
software.amazon.awscdk.cfnpropertymixins.services.ec2.CfnLaunchTemplatePropsMixin.SpotOptionsProperty.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnLaunchTemplatePropsMixin.SpotOptionsProperty>
- Enclosing interface:
CfnLaunchTemplatePropsMixin.SpotOptionsProperty
@Stability(Stable)
public static final class CfnLaunchTemplatePropsMixin.SpotOptionsProperty.Builder
extends Object
implements software.amazon.jsii.Builder<CfnLaunchTemplatePropsMixin.SpotOptionsProperty>
A builder for
CfnLaunchTemplatePropsMixin.SpotOptionsProperty-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionblockDurationMinutes(Number blockDurationMinutes) build()Builds the configured instance.instanceInterruptionBehavior(String instanceInterruptionBehavior) Sets the value ofCfnLaunchTemplatePropsMixin.SpotOptionsProperty.getMaxPrice()spotInstanceType(String spotInstanceType) Sets the value ofCfnLaunchTemplatePropsMixin.SpotOptionsProperty.getSpotInstanceType()validUntil(String validUntil) Sets the value ofCfnLaunchTemplatePropsMixin.SpotOptionsProperty.getValidUntil()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
blockDurationMinutes
@Stability(Stable) public CfnLaunchTemplatePropsMixin.SpotOptionsProperty.Builder blockDurationMinutes(Number blockDurationMinutes) - Parameters:
blockDurationMinutes- Deprecated.- Returns:
this
-
instanceInterruptionBehavior
@Stability(Stable) public CfnLaunchTemplatePropsMixin.SpotOptionsProperty.Builder instanceInterruptionBehavior(String instanceInterruptionBehavior) - Parameters:
instanceInterruptionBehavior- The behavior when a Spot Instance is interrupted. The default isterminate.- Returns:
this
-
maxPrice
@Stability(Stable) public CfnLaunchTemplatePropsMixin.SpotOptionsProperty.Builder maxPrice(String maxPrice) Sets the value ofCfnLaunchTemplatePropsMixin.SpotOptionsProperty.getMaxPrice()- Parameters:
maxPrice- The maximum hourly price you're willing to pay for a Spot Instance. 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 anInvalidParameterValueerror 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.
- Returns:
this
-
spotInstanceType
@Stability(Stable) public CfnLaunchTemplatePropsMixin.SpotOptionsProperty.Builder spotInstanceType(String spotInstanceType) Sets the value ofCfnLaunchTemplatePropsMixin.SpotOptionsProperty.getSpotInstanceType()- Parameters:
spotInstanceType- The Spot Instance request type. If you are using Spot Instances with an Auto Scaling group, useone-timerequests, as the Amazon EC2 Auto Scaling service handles requesting new Spot Instances whenever the group is below its desired capacity.- Returns:
this
-
validUntil
@Stability(Stable) public CfnLaunchTemplatePropsMixin.SpotOptionsProperty.Builder validUntil(String validUntil) Sets the value ofCfnLaunchTemplatePropsMixin.SpotOptionsProperty.getValidUntil()- Parameters:
validUntil- 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
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
- For a persistent request, the request remains active until the
- Returns:
this
-
build
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<CfnLaunchTemplatePropsMixin.SpotOptionsProperty>- Returns:
- a new instance of
CfnLaunchTemplatePropsMixin.SpotOptionsProperty - Throws:
NullPointerException- if any required attribute was not provided
-