public static final class LaunchTemplateSpotOptions.Builder
extends java.lang.Object
LaunchTemplateSpotOptions
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
LaunchTemplateSpotOptions.Builder |
blockDuration(Duration blockDuration)
Sets the value of
LaunchTemplateSpotOptions.getBlockDuration() |
LaunchTemplateSpotOptions |
build()
Builds the configured instance.
|
LaunchTemplateSpotOptions.Builder |
interruptionBehavior(SpotInstanceInterruption interruptionBehavior)
Sets the value of
LaunchTemplateSpotOptions.getInterruptionBehavior() |
LaunchTemplateSpotOptions.Builder |
maxPrice(java.lang.Number maxPrice)
Sets the value of
LaunchTemplateSpotOptions.getMaxPrice() |
LaunchTemplateSpotOptions.Builder |
requestType(SpotRequestType requestType)
Sets the value of
LaunchTemplateSpotOptions.getRequestType() |
LaunchTemplateSpotOptions.Builder |
validUntil(Expiration validUntil)
Sets the value of
LaunchTemplateSpotOptions.getValidUntil() |
public LaunchTemplateSpotOptions.Builder blockDuration(Duration blockDuration)
LaunchTemplateSpotOptions.getBlockDuration()
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.
You can use a duration of 1, 2, 3, 4, 5, or 6 hours.this
public LaunchTemplateSpotOptions.Builder interruptionBehavior(SpotInstanceInterruption interruptionBehavior)
LaunchTemplateSpotOptions.getInterruptionBehavior()
interruptionBehavior
- The behavior when a Spot Instance is interrupted.this
public LaunchTemplateSpotOptions.Builder maxPrice(java.lang.Number maxPrice)
LaunchTemplateSpotOptions.getMaxPrice()
maxPrice
- 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.this
public LaunchTemplateSpotOptions.Builder requestType(SpotRequestType requestType)
LaunchTemplateSpotOptions.getRequestType()
requestType
- 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.this
public LaunchTemplateSpotOptions.Builder validUntil(Expiration validUntil)
LaunchTemplateSpotOptions.getValidUntil()
validUntil
- 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.this
public LaunchTemplateSpotOptions build()
LaunchTemplateSpotOptions
java.lang.NullPointerException
- if any required attribute was not provided