Interface RequestSpotInstancesRequest.Builder
-
- All Superinterfaces:
AwsRequest.Builder
,Buildable
,CopyableBuilder<RequestSpotInstancesRequest.Builder,RequestSpotInstancesRequest>
,Ec2Request.Builder
,SdkBuilder<RequestSpotInstancesRequest.Builder,RequestSpotInstancesRequest>
,SdkPojo
,SdkRequest.Builder
- Enclosing class:
- RequestSpotInstancesRequest
public static interface RequestSpotInstancesRequest.Builder extends Ec2Request.Builder, SdkPojo, CopyableBuilder<RequestSpotInstancesRequest.Builder,RequestSpotInstancesRequest>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description RequestSpotInstancesRequest.Builder
availabilityZoneGroup(String availabilityZoneGroup)
The user-specified name for a logical grouping of requests.RequestSpotInstancesRequest.Builder
blockDurationMinutes(Integer blockDurationMinutes)
Deprecated.RequestSpotInstancesRequest.Builder
clientToken(String clientToken)
Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.RequestSpotInstancesRequest.Builder
dryRun(Boolean dryRun)
Checks whether you have the required permissions for the action, without actually making the request, and provides an error response.RequestSpotInstancesRequest.Builder
instanceCount(Integer instanceCount)
The maximum number of Spot Instances to launch.RequestSpotInstancesRequest.Builder
instanceInterruptionBehavior(String instanceInterruptionBehavior)
The behavior when a Spot Instance is interrupted.RequestSpotInstancesRequest.Builder
instanceInterruptionBehavior(InstanceInterruptionBehavior instanceInterruptionBehavior)
The behavior when a Spot Instance is interrupted.RequestSpotInstancesRequest.Builder
launchGroup(String launchGroup)
The instance launch group.default RequestSpotInstancesRequest.Builder
launchSpecification(Consumer<RequestSpotLaunchSpecification.Builder> launchSpecification)
The launch specification.RequestSpotInstancesRequest.Builder
launchSpecification(RequestSpotLaunchSpecification launchSpecification)
The launch specification.RequestSpotInstancesRequest.Builder
overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer)
RequestSpotInstancesRequest.Builder
overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration)
RequestSpotInstancesRequest.Builder
spotPrice(String spotPrice)
The maximum price per unit hour that you are willing to pay for a Spot Instance.RequestSpotInstancesRequest.Builder
tagSpecifications(Collection<TagSpecification> tagSpecifications)
The key-value pair for tagging the Spot Instance request on creation.RequestSpotInstancesRequest.Builder
tagSpecifications(Consumer<TagSpecification.Builder>... tagSpecifications)
The key-value pair for tagging the Spot Instance request on creation.RequestSpotInstancesRequest.Builder
tagSpecifications(TagSpecification... tagSpecifications)
The key-value pair for tagging the Spot Instance request on creation.RequestSpotInstancesRequest.Builder
type(String type)
The Spot Instance request type.RequestSpotInstancesRequest.Builder
type(SpotInstanceType type)
The Spot Instance request type.RequestSpotInstancesRequest.Builder
validFrom(Instant validFrom)
The start date of the request.RequestSpotInstancesRequest.Builder
validUntil(Instant validUntil)
The end date of the request, in UTC format (YYYY-MM-DDTHH:MM:SSZ).-
Methods inherited from interface software.amazon.awssdk.awscore.AwsRequest.Builder
overrideConfiguration
-
Methods inherited from interface software.amazon.awssdk.utils.builder.CopyableBuilder
copy
-
Methods inherited from interface software.amazon.awssdk.services.ec2.model.Ec2Request.Builder
build
-
Methods inherited from interface software.amazon.awssdk.utils.builder.SdkBuilder
applyMutation, build
-
Methods inherited from interface software.amazon.awssdk.core.SdkPojo
equalsBySdkFields, sdkFields
-
-
-
-
Method Detail
-
availabilityZoneGroup
RequestSpotInstancesRequest.Builder availabilityZoneGroup(String availabilityZoneGroup)
The user-specified name for a logical grouping of requests.
When you specify an Availability Zone group in a Spot Instance request, all Spot Instances in the request are launched in the same Availability Zone. Instance proximity is maintained with this parameter, but the choice of Availability Zone is not. The group applies only to requests for Spot Instances of the same instance type. Any additional Spot Instance requests that are specified with the same Availability Zone group name are launched in that same Availability Zone, as long as at least one instance from the group is still active.
If there is no active instance running in the Availability Zone group that you specify for a new Spot Instance request (all instances are terminated, the request is expired, or the maximum price you specified falls below current Spot price), then Amazon EC2 launches the instance in any Availability Zone where the constraint can be met. Consequently, the subsequent set of Spot Instances could be placed in a different zone from the original request, even if you specified the same Availability Zone group.
Default: Instances are launched in any available Availability Zone.
- Parameters:
availabilityZoneGroup
- The user-specified name for a logical grouping of requests.When you specify an Availability Zone group in a Spot Instance request, all Spot Instances in the request are launched in the same Availability Zone. Instance proximity is maintained with this parameter, but the choice of Availability Zone is not. The group applies only to requests for Spot Instances of the same instance type. Any additional Spot Instance requests that are specified with the same Availability Zone group name are launched in that same Availability Zone, as long as at least one instance from the group is still active.
If there is no active instance running in the Availability Zone group that you specify for a new Spot Instance request (all instances are terminated, the request is expired, or the maximum price you specified falls below current Spot price), then Amazon EC2 launches the instance in any Availability Zone where the constraint can be met. Consequently, the subsequent set of Spot Instances could be placed in a different zone from the original request, even if you specified the same Availability Zone group.
Default: Instances are launched in any available Availability Zone.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
blockDurationMinutes
RequestSpotInstancesRequest.Builder blockDurationMinutes(Integer blockDurationMinutes)
Deprecated.
- Parameters:
blockDurationMinutes
- Deprecated.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
clientToken
RequestSpotInstancesRequest.Builder clientToken(String clientToken)
Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency in the Amazon EC2 User Guide for Linux Instances.
- Parameters:
clientToken
- Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency in the Amazon EC2 User Guide for Linux Instances.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
dryRun
RequestSpotInstancesRequest.Builder dryRun(Boolean dryRun)
Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is
DryRunOperation
. Otherwise, it isUnauthorizedOperation
.- Parameters:
dryRun
- Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response isDryRunOperation
. Otherwise, it isUnauthorizedOperation
.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
instanceCount
RequestSpotInstancesRequest.Builder instanceCount(Integer instanceCount)
The maximum number of Spot Instances to launch.
Default: 1
- Parameters:
instanceCount
- The maximum number of Spot Instances to launch.Default: 1
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
launchGroup
RequestSpotInstancesRequest.Builder launchGroup(String launchGroup)
The instance launch group. Launch groups are Spot Instances that launch together and terminate together.
Default: Instances are launched and terminated individually
- Parameters:
launchGroup
- The instance launch group. Launch groups are Spot Instances that launch together and terminate together.Default: Instances are launched and terminated individually
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
launchSpecification
RequestSpotInstancesRequest.Builder launchSpecification(RequestSpotLaunchSpecification launchSpecification)
The launch specification.
- Parameters:
launchSpecification
- The launch specification.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
launchSpecification
default RequestSpotInstancesRequest.Builder launchSpecification(Consumer<RequestSpotLaunchSpecification.Builder> launchSpecification)
The launch specification.
This is a convenience method that creates an instance of theRequestSpotLaunchSpecification.Builder
avoiding the need to create one manually viaRequestSpotLaunchSpecification.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed tolaunchSpecification(RequestSpotLaunchSpecification)
.- Parameters:
launchSpecification
- a consumer that will call methods onRequestSpotLaunchSpecification.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
launchSpecification(RequestSpotLaunchSpecification)
-
spotPrice
RequestSpotInstancesRequest.Builder spotPrice(String spotPrice)
The maximum price per unit hour that you are 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 specify a maximum price, your instances will be interrupted more frequently than if you do not specify this parameter.
- Parameters:
spotPrice
- The maximum price per unit hour that you are 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 specify a maximum price, your instances will be interrupted more frequently than if you do not specify this parameter.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
type
RequestSpotInstancesRequest.Builder type(String type)
The Spot Instance request type.
Default:
one-time
- Parameters:
type
- The Spot Instance request type.Default:
one-time
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
SpotInstanceType
,SpotInstanceType
-
type
RequestSpotInstancesRequest.Builder type(SpotInstanceType type)
The Spot Instance request type.
Default:
one-time
- Parameters:
type
- The Spot Instance request type.Default:
one-time
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
SpotInstanceType
,SpotInstanceType
-
validFrom
RequestSpotInstancesRequest.Builder validFrom(Instant validFrom)
The start date of the request. If this is a one-time request, the request becomes active at this date and time and remains active until all instances launch, the request expires, or the request is canceled. If the request is persistent, the request becomes active at this date and time and remains active until it expires or is canceled.
The specified start date and time cannot be equal to the current date and time. You must specify a start date and time that occurs after the current date and time.
- Parameters:
validFrom
- The start date of the request. If this is a one-time request, the request becomes active at this date and time and remains active until all instances launch, the request expires, or the request is canceled. If the request is persistent, the request becomes active at this date and time and remains active until it expires or is canceled.The specified start date and time cannot be equal to the current date and time. You must specify a start date and time that occurs after the current date and time.
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
validUntil
RequestSpotInstancesRequest.Builder validUntil(Instant validUntil)
The end date of the request, in UTC format (YYYY-MM-DDTHH:MM:SSZ).
-
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, the request remains active until all instances launch, the request is canceled, or the
ValidUntil
date and time is reached. By default, the request is valid for 7 days from the date the request was created.
- Parameters:
validUntil
- The end date of the request, in UTC format (YYYY-MM-DDTHH:MM:SSZ).-
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, the request remains active until all instances launch, the request is canceled, or the
ValidUntil
date and time is reached. By default, the request is valid for 7 days from the date the request was created.
-
- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
-
tagSpecifications
RequestSpotInstancesRequest.Builder tagSpecifications(Collection<TagSpecification> tagSpecifications)
The key-value pair for tagging the Spot Instance request on creation. The value for
ResourceType
must bespot-instances-request
, otherwise the Spot Instance request fails. To tag the Spot Instance request after it has been created, see CreateTags.- Parameters:
tagSpecifications
- The key-value pair for tagging the Spot Instance request on creation. The value forResourceType
must bespot-instances-request
, otherwise the Spot Instance request fails. To tag the Spot Instance request after it has been created, see CreateTags.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
tagSpecifications
RequestSpotInstancesRequest.Builder tagSpecifications(TagSpecification... tagSpecifications)
The key-value pair for tagging the Spot Instance request on creation. The value for
ResourceType
must bespot-instances-request
, otherwise the Spot Instance request fails. To tag the Spot Instance request after it has been created, see CreateTags.- Parameters:
tagSpecifications
- The key-value pair for tagging the Spot Instance request on creation. The value forResourceType
must bespot-instances-request
, otherwise the Spot Instance request fails. To tag the Spot Instance request after it has been created, see CreateTags.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
tagSpecifications
RequestSpotInstancesRequest.Builder tagSpecifications(Consumer<TagSpecification.Builder>... tagSpecifications)
The key-value pair for tagging the Spot Instance request on creation. The value for
This is a convenience method that creates an instance of theResourceType
must bespot-instances-request
, otherwise the Spot Instance request fails. To tag the Spot Instance request after it has been created, see CreateTags.TagSpecification.Builder
avoiding the need to create one manually viaTagSpecification.builder()
.When the
Consumer
completes,SdkBuilder.build()
is called immediately and its result is passed to#tagSpecifications(List
.) - Parameters:
tagSpecifications
- a consumer that will call methods onTagSpecification.Builder
- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
#tagSpecifications(java.util.Collection
)
-
instanceInterruptionBehavior
RequestSpotInstancesRequest.Builder instanceInterruptionBehavior(String instanceInterruptionBehavior)
The behavior when a Spot Instance is interrupted. The default is
terminate
.- Parameters:
instanceInterruptionBehavior
- The behavior when a Spot Instance is interrupted. The default isterminate
.- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
InstanceInterruptionBehavior
,InstanceInterruptionBehavior
-
instanceInterruptionBehavior
RequestSpotInstancesRequest.Builder instanceInterruptionBehavior(InstanceInterruptionBehavior instanceInterruptionBehavior)
The behavior when a Spot Instance is interrupted. The default is
terminate
.- Parameters:
instanceInterruptionBehavior
- The behavior when a Spot Instance is interrupted. The default isterminate
.- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
InstanceInterruptionBehavior
,InstanceInterruptionBehavior
-
overrideConfiguration
RequestSpotInstancesRequest.Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration)
- Specified by:
overrideConfiguration
in interfaceAwsRequest.Builder
-
overrideConfiguration
RequestSpotInstancesRequest.Builder overrideConfiguration(Consumer<AwsRequestOverrideConfiguration.Builder> builderConsumer)
- Specified by:
overrideConfiguration
in interfaceAwsRequest.Builder
-
-