Class CfnLaunchTemplate.SpotOptionsProperty.Builder
java.lang.Object
software.amazon.awscdk.services.ec2.CfnLaunchTemplate.SpotOptionsProperty.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnLaunchTemplate.SpotOptionsProperty>
- Enclosing interface:
- CfnLaunchTemplate.SpotOptionsProperty
@Stability(Stable)
public static final class CfnLaunchTemplate.SpotOptionsProperty.Builder
extends Object
implements software.amazon.jsii.Builder<CfnLaunchTemplate.SpotOptionsProperty>
A builder for
CfnLaunchTemplate.SpotOptionsProperty
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionblockDurationMinutes
(Number blockDurationMinutes) Sets the value ofCfnLaunchTemplate.SpotOptionsProperty.getBlockDurationMinutes()
build()
Builds the configured instance.instanceInterruptionBehavior
(String instanceInterruptionBehavior) Sets the value ofCfnLaunchTemplate.SpotOptionsProperty.getInstanceInterruptionBehavior()
Sets the value ofCfnLaunchTemplate.SpotOptionsProperty.getMaxPrice()
spotInstanceType
(String spotInstanceType) Sets the value ofCfnLaunchTemplate.SpotOptionsProperty.getSpotInstanceType()
validUntil
(String validUntil) Sets the value ofCfnLaunchTemplate.SpotOptionsProperty.getValidUntil()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
blockDurationMinutes
@Stability(Stable) public CfnLaunchTemplate.SpotOptionsProperty.Builder blockDurationMinutes(Number blockDurationMinutes) Sets the value ofCfnLaunchTemplate.SpotOptionsProperty.getBlockDurationMinutes()
- Parameters:
blockDurationMinutes
- Deprecated.- Returns:
this
-
instanceInterruptionBehavior
@Stability(Stable) public CfnLaunchTemplate.SpotOptionsProperty.Builder instanceInterruptionBehavior(String instanceInterruptionBehavior) Sets the value ofCfnLaunchTemplate.SpotOptionsProperty.getInstanceInterruptionBehavior()
- Parameters:
instanceInterruptionBehavior
- The behavior when a Spot Instance is interrupted. The default isterminate
.- Returns:
this
-
maxPrice
Sets the value ofCfnLaunchTemplate.SpotOptionsProperty.getMaxPrice()
- Parameters:
maxPrice
- 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.
- Returns:
this
-
spotInstanceType
@Stability(Stable) public CfnLaunchTemplate.SpotOptionsProperty.Builder spotInstanceType(String spotInstanceType) Sets the value ofCfnLaunchTemplate.SpotOptionsProperty.getSpotInstanceType()
- Parameters:
spotInstanceType
- The Spot Instance request type. If you are using Spot Instances with an Auto Scaling group, useone-time
requests, 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 CfnLaunchTemplate.SpotOptionsProperty.Builder validUntil(String validUntil) Sets the value ofCfnLaunchTemplate.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
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
- For a persistent request, the request remains active until the
- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnLaunchTemplate.SpotOptionsProperty>
- Returns:
- a new instance of
CfnLaunchTemplate.SpotOptionsProperty
- Throws:
NullPointerException
- if any required attribute was not provided
-