Class SpotFleetRequestConfigData
- java.lang.Object
-
- software.amazon.awssdk.services.ec2.model.SpotFleetRequestConfigData
-
- All Implemented Interfaces:
Serializable
,SdkPojo
,ToCopyableBuilder<SpotFleetRequestConfigData.Builder,SpotFleetRequestConfigData>
@Generated("software.amazon.awssdk:codegen") public final class SpotFleetRequestConfigData extends Object implements SdkPojo, Serializable, ToCopyableBuilder<SpotFleetRequestConfigData.Builder,SpotFleetRequestConfigData>
Describes the configuration of a Spot Fleet request.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
SpotFleetRequestConfigData.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AllocationStrategy
allocationStrategy()
The strategy that determines how to allocate the target Spot Instance capacity across the Spot Instance pools specified by the Spot Fleet launch configuration.String
allocationStrategyAsString()
The strategy that determines how to allocate the target Spot Instance capacity across the Spot Instance pools specified by the Spot Fleet launch configuration.static SpotFleetRequestConfigData.Builder
builder()
String
clientToken()
A unique, case-sensitive identifier that you provide to ensure the idempotency of your listings.String
context()
Reserved.boolean
equals(Object obj)
boolean
equalsBySdkFields(Object obj)
ExcessCapacityTerminationPolicy
excessCapacityTerminationPolicy()
Indicates whether running instances should be terminated if you decrease the target capacity of the Spot Fleet request below the current size of the Spot Fleet.String
excessCapacityTerminationPolicyAsString()
Indicates whether running instances should be terminated if you decrease the target capacity of the Spot Fleet request below the current size of the Spot Fleet.Double
fulfilledCapacity()
The number of units fulfilled by this request compared to the set target capacity.<T> Optional<T>
getValueForField(String fieldName, Class<T> clazz)
int
hashCode()
boolean
hasLaunchSpecifications()
For responses, this returns true if the service returned a value for the LaunchSpecifications property.boolean
hasLaunchTemplateConfigs()
For responses, this returns true if the service returned a value for the LaunchTemplateConfigs property.boolean
hasTagSpecifications()
For responses, this returns true if the service returned a value for the TagSpecifications property.String
iamFleetRole()
The Amazon Resource Name (ARN) of an Identity and Access Management (IAM) role that grants the Spot Fleet the permission to request, launch, terminate, and tag instances on your behalf.InstanceInterruptionBehavior
instanceInterruptionBehavior()
The behavior when a Spot Instance is interrupted.String
instanceInterruptionBehaviorAsString()
The behavior when a Spot Instance is interrupted.Integer
instancePoolsToUseCount()
The number of Spot pools across which to allocate your target Spot capacity.List<SpotFleetLaunchSpecification>
launchSpecifications()
The launch specifications for the Spot Fleet request.List<LaunchTemplateConfig>
launchTemplateConfigs()
The launch template and overrides.LoadBalancersConfig
loadBalancersConfig()
One or more Classic Load Balancers and target groups to attach to the Spot Fleet request.OnDemandAllocationStrategy
onDemandAllocationStrategy()
The order of the launch template overrides to use in fulfilling On-Demand capacity.String
onDemandAllocationStrategyAsString()
The order of the launch template overrides to use in fulfilling On-Demand capacity.Double
onDemandFulfilledCapacity()
The number of On-Demand units fulfilled by this request compared to the set target On-Demand capacity.String
onDemandMaxTotalPrice()
The maximum amount per hour for On-Demand Instances that you're willing to pay.Integer
onDemandTargetCapacity()
The number of On-Demand units to request.Boolean
replaceUnhealthyInstances()
Indicates whether Spot Fleet should replace unhealthy instances.List<SdkField<?>>
sdkFields()
static Class<? extends SpotFleetRequestConfigData.Builder>
serializableBuilderClass()
SpotMaintenanceStrategies
spotMaintenanceStrategies()
The strategies for managing your Spot Instances that are at an elevated risk of being interrupted.String
spotMaxTotalPrice()
The maximum amount per hour for Spot Instances that you're willing to pay.String
spotPrice()
The maximum price per unit hour that you are willing to pay for a Spot Instance.List<TagSpecification>
tagSpecifications()
The key-value pair for tagging the Spot Fleet request on creation.Integer
targetCapacity()
The number of units to request for the Spot Fleet.TargetCapacityUnitType
targetCapacityUnitType()
The unit for the target capacity.String
targetCapacityUnitTypeAsString()
The unit for the target capacity.Boolean
terminateInstancesWithExpiration()
Indicates whether running Spot Instances are terminated when the Spot Fleet request expires.SpotFleetRequestConfigData.Builder
toBuilder()
String
toString()
Returns a string representation of this object.FleetType
type()
The type of request.String
typeAsString()
The type of request.Instant
validFrom()
The start date and time of the request, in UTC format (YYYY-MM-DDTHH:MM:SSZ).Instant
validUntil()
The end date and time of the request, in UTC format (YYYY-MM-DDTHH:MM:SSZ).-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
-
-
-
Method Detail
-
allocationStrategy
public final AllocationStrategy allocationStrategy()
The strategy that determines how to allocate the target Spot Instance capacity across the Spot Instance pools specified by the Spot Fleet launch configuration. For more information, see Allocation strategies for Spot Instances in the Amazon EC2 User Guide.
- priceCapacityOptimized (recommended)
-
Spot Fleet identifies the pools with the highest capacity availability for the number of instances that are launching. This means that we will request Spot Instances from the pools that we believe have the lowest chance of interruption in the near term. Spot Fleet then requests Spot Instances from the lowest priced of these pools.
- capacityOptimized
-
Spot Fleet identifies the pools with the highest capacity availability for the number of instances that are launching. This means that we will request Spot Instances from the pools that we believe have the lowest chance of interruption in the near term. To give certain instance types a higher chance of launching first, use
capacityOptimizedPrioritized
. Set a priority for each instance type by using thePriority
parameter forLaunchTemplateOverrides
. You can assign the same priority to differentLaunchTemplateOverrides
. EC2 implements the priorities on a best-effort basis, but optimizes for capacity first.capacityOptimizedPrioritized
is supported only if your Spot Fleet uses a launch template. Note that if theOnDemandAllocationStrategy
is set toprioritized
, the same priority is applied when fulfilling On-Demand capacity. - diversified
-
Spot Fleet requests instances from all of the Spot Instance pools that you specify.
- lowestPrice
-
Spot Fleet requests instances from the lowest priced Spot Instance pool that has available capacity. If the lowest priced pool doesn't have available capacity, the Spot Instances come from the next lowest priced pool that has available capacity. If a pool runs out of capacity before fulfilling your desired capacity, Spot Fleet will continue to fulfill your request by drawing from the next lowest priced pool. To ensure that your desired capacity is met, you might receive Spot Instances from several pools. Because this strategy only considers instance price and not capacity availability, it might lead to high interruption rates.
Default:
lowestPrice
If the service returns an enum value that is not available in the current SDK version,
allocationStrategy
will returnAllocationStrategy.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromallocationStrategyAsString()
.- Returns:
- The strategy that determines how to allocate the target Spot Instance capacity across the Spot Instance
pools specified by the Spot Fleet launch configuration. For more information, see Allocation
strategies for Spot Instances in the Amazon EC2 User Guide.
- priceCapacityOptimized (recommended)
-
Spot Fleet identifies the pools with the highest capacity availability for the number of instances that are launching. This means that we will request Spot Instances from the pools that we believe have the lowest chance of interruption in the near term. Spot Fleet then requests Spot Instances from the lowest priced of these pools.
- capacityOptimized
-
Spot Fleet identifies the pools with the highest capacity availability for the number of instances that are launching. This means that we will request Spot Instances from the pools that we believe have the lowest chance of interruption in the near term. To give certain instance types a higher chance of launching first, use
capacityOptimizedPrioritized
. Set a priority for each instance type by using thePriority
parameter forLaunchTemplateOverrides
. You can assign the same priority to differentLaunchTemplateOverrides
. EC2 implements the priorities on a best-effort basis, but optimizes for capacity first.capacityOptimizedPrioritized
is supported only if your Spot Fleet uses a launch template. Note that if theOnDemandAllocationStrategy
is set toprioritized
, the same priority is applied when fulfilling On-Demand capacity. - diversified
-
Spot Fleet requests instances from all of the Spot Instance pools that you specify.
- lowestPrice
-
Spot Fleet requests instances from the lowest priced Spot Instance pool that has available capacity. If the lowest priced pool doesn't have available capacity, the Spot Instances come from the next lowest priced pool that has available capacity. If a pool runs out of capacity before fulfilling your desired capacity, Spot Fleet will continue to fulfill your request by drawing from the next lowest priced pool. To ensure that your desired capacity is met, you might receive Spot Instances from several pools. Because this strategy only considers instance price and not capacity availability, it might lead to high interruption rates.
Default:
lowestPrice
- See Also:
AllocationStrategy
-
allocationStrategyAsString
public final String allocationStrategyAsString()
The strategy that determines how to allocate the target Spot Instance capacity across the Spot Instance pools specified by the Spot Fleet launch configuration. For more information, see Allocation strategies for Spot Instances in the Amazon EC2 User Guide.
- priceCapacityOptimized (recommended)
-
Spot Fleet identifies the pools with the highest capacity availability for the number of instances that are launching. This means that we will request Spot Instances from the pools that we believe have the lowest chance of interruption in the near term. Spot Fleet then requests Spot Instances from the lowest priced of these pools.
- capacityOptimized
-
Spot Fleet identifies the pools with the highest capacity availability for the number of instances that are launching. This means that we will request Spot Instances from the pools that we believe have the lowest chance of interruption in the near term. To give certain instance types a higher chance of launching first, use
capacityOptimizedPrioritized
. Set a priority for each instance type by using thePriority
parameter forLaunchTemplateOverrides
. You can assign the same priority to differentLaunchTemplateOverrides
. EC2 implements the priorities on a best-effort basis, but optimizes for capacity first.capacityOptimizedPrioritized
is supported only if your Spot Fleet uses a launch template. Note that if theOnDemandAllocationStrategy
is set toprioritized
, the same priority is applied when fulfilling On-Demand capacity. - diversified
-
Spot Fleet requests instances from all of the Spot Instance pools that you specify.
- lowestPrice
-
Spot Fleet requests instances from the lowest priced Spot Instance pool that has available capacity. If the lowest priced pool doesn't have available capacity, the Spot Instances come from the next lowest priced pool that has available capacity. If a pool runs out of capacity before fulfilling your desired capacity, Spot Fleet will continue to fulfill your request by drawing from the next lowest priced pool. To ensure that your desired capacity is met, you might receive Spot Instances from several pools. Because this strategy only considers instance price and not capacity availability, it might lead to high interruption rates.
Default:
lowestPrice
If the service returns an enum value that is not available in the current SDK version,
allocationStrategy
will returnAllocationStrategy.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromallocationStrategyAsString()
.- Returns:
- The strategy that determines how to allocate the target Spot Instance capacity across the Spot Instance
pools specified by the Spot Fleet launch configuration. For more information, see Allocation
strategies for Spot Instances in the Amazon EC2 User Guide.
- priceCapacityOptimized (recommended)
-
Spot Fleet identifies the pools with the highest capacity availability for the number of instances that are launching. This means that we will request Spot Instances from the pools that we believe have the lowest chance of interruption in the near term. Spot Fleet then requests Spot Instances from the lowest priced of these pools.
- capacityOptimized
-
Spot Fleet identifies the pools with the highest capacity availability for the number of instances that are launching. This means that we will request Spot Instances from the pools that we believe have the lowest chance of interruption in the near term. To give certain instance types a higher chance of launching first, use
capacityOptimizedPrioritized
. Set a priority for each instance type by using thePriority
parameter forLaunchTemplateOverrides
. You can assign the same priority to differentLaunchTemplateOverrides
. EC2 implements the priorities on a best-effort basis, but optimizes for capacity first.capacityOptimizedPrioritized
is supported only if your Spot Fleet uses a launch template. Note that if theOnDemandAllocationStrategy
is set toprioritized
, the same priority is applied when fulfilling On-Demand capacity. - diversified
-
Spot Fleet requests instances from all of the Spot Instance pools that you specify.
- lowestPrice
-
Spot Fleet requests instances from the lowest priced Spot Instance pool that has available capacity. If the lowest priced pool doesn't have available capacity, the Spot Instances come from the next lowest priced pool that has available capacity. If a pool runs out of capacity before fulfilling your desired capacity, Spot Fleet will continue to fulfill your request by drawing from the next lowest priced pool. To ensure that your desired capacity is met, you might receive Spot Instances from several pools. Because this strategy only considers instance price and not capacity availability, it might lead to high interruption rates.
Default:
lowestPrice
- See Also:
AllocationStrategy
-
onDemandAllocationStrategy
public final OnDemandAllocationStrategy onDemandAllocationStrategy()
The order of the launch template overrides to use in fulfilling On-Demand capacity. If you specify
lowestPrice
, Spot Fleet uses price to determine the order, launching the lowest price first. If you specifyprioritized
, Spot Fleet uses the priority that you assign to each Spot Fleet launch template override, launching the highest priority first. If you do not specify a value, Spot Fleet defaults tolowestPrice
.If the service returns an enum value that is not available in the current SDK version,
onDemandAllocationStrategy
will returnOnDemandAllocationStrategy.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromonDemandAllocationStrategyAsString()
.- Returns:
- The order of the launch template overrides to use in fulfilling On-Demand capacity. If you specify
lowestPrice
, Spot Fleet uses price to determine the order, launching the lowest price first. If you specifyprioritized
, Spot Fleet uses the priority that you assign to each Spot Fleet launch template override, launching the highest priority first. If you do not specify a value, Spot Fleet defaults tolowestPrice
. - See Also:
OnDemandAllocationStrategy
-
onDemandAllocationStrategyAsString
public final String onDemandAllocationStrategyAsString()
The order of the launch template overrides to use in fulfilling On-Demand capacity. If you specify
lowestPrice
, Spot Fleet uses price to determine the order, launching the lowest price first. If you specifyprioritized
, Spot Fleet uses the priority that you assign to each Spot Fleet launch template override, launching the highest priority first. If you do not specify a value, Spot Fleet defaults tolowestPrice
.If the service returns an enum value that is not available in the current SDK version,
onDemandAllocationStrategy
will returnOnDemandAllocationStrategy.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromonDemandAllocationStrategyAsString()
.- Returns:
- The order of the launch template overrides to use in fulfilling On-Demand capacity. If you specify
lowestPrice
, Spot Fleet uses price to determine the order, launching the lowest price first. If you specifyprioritized
, Spot Fleet uses the priority that you assign to each Spot Fleet launch template override, launching the highest priority first. If you do not specify a value, Spot Fleet defaults tolowestPrice
. - See Also:
OnDemandAllocationStrategy
-
spotMaintenanceStrategies
public final SpotMaintenanceStrategies spotMaintenanceStrategies()
The strategies for managing your Spot Instances that are at an elevated risk of being interrupted.
- Returns:
- The strategies for managing your Spot Instances that are at an elevated risk of being interrupted.
-
clientToken
public final String clientToken()
A unique, case-sensitive identifier that you provide to ensure the idempotency of your listings. This helps to avoid duplicate listings. For more information, see Ensuring Idempotency.
- Returns:
- A unique, case-sensitive identifier that you provide to ensure the idempotency of your listings. This helps to avoid duplicate listings. For more information, see Ensuring Idempotency.
-
excessCapacityTerminationPolicy
public final ExcessCapacityTerminationPolicy excessCapacityTerminationPolicy()
Indicates whether running instances should be terminated if you decrease the target capacity of the Spot Fleet request below the current size of the Spot Fleet.
Supported only for fleets of type
maintain
.If the service returns an enum value that is not available in the current SDK version,
excessCapacityTerminationPolicy
will returnExcessCapacityTerminationPolicy.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromexcessCapacityTerminationPolicyAsString()
.- Returns:
- Indicates whether running instances should be terminated if you decrease the target capacity of the Spot
Fleet request below the current size of the Spot Fleet.
Supported only for fleets of type
maintain
. - See Also:
ExcessCapacityTerminationPolicy
-
excessCapacityTerminationPolicyAsString
public final String excessCapacityTerminationPolicyAsString()
Indicates whether running instances should be terminated if you decrease the target capacity of the Spot Fleet request below the current size of the Spot Fleet.
Supported only for fleets of type
maintain
.If the service returns an enum value that is not available in the current SDK version,
excessCapacityTerminationPolicy
will returnExcessCapacityTerminationPolicy.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromexcessCapacityTerminationPolicyAsString()
.- Returns:
- Indicates whether running instances should be terminated if you decrease the target capacity of the Spot
Fleet request below the current size of the Spot Fleet.
Supported only for fleets of type
maintain
. - See Also:
ExcessCapacityTerminationPolicy
-
fulfilledCapacity
public final Double fulfilledCapacity()
The number of units fulfilled by this request compared to the set target capacity. You cannot set this value.
- Returns:
- The number of units fulfilled by this request compared to the set target capacity. You cannot set this value.
-
onDemandFulfilledCapacity
public final Double onDemandFulfilledCapacity()
The number of On-Demand units fulfilled by this request compared to the set target On-Demand capacity.
- Returns:
- The number of On-Demand units fulfilled by this request compared to the set target On-Demand capacity.
-
iamFleetRole
public final String iamFleetRole()
The Amazon Resource Name (ARN) of an Identity and Access Management (IAM) role that grants the Spot Fleet the permission to request, launch, terminate, and tag instances on your behalf. For more information, see Spot Fleet prerequisites in the Amazon EC2 User Guide. Spot Fleet can terminate Spot Instances on your behalf when you cancel its Spot Fleet request using CancelSpotFleetRequests or when the Spot Fleet request expires, if you set
TerminateInstancesWithExpiration
.- Returns:
- The Amazon Resource Name (ARN) of an Identity and Access Management (IAM) role that grants the Spot Fleet
the permission to request, launch, terminate, and tag instances on your behalf. For more information, see
Spot Fleet prerequisites in the Amazon EC2 User Guide. Spot Fleet can terminate Spot
Instances on your behalf when you cancel its Spot Fleet request using CancelSpotFleetRequests or when the Spot Fleet request expires, if you set
TerminateInstancesWithExpiration
.
-
hasLaunchSpecifications
public final boolean hasLaunchSpecifications()
For responses, this returns true if the service returned a value for the LaunchSpecifications property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()
method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
-
launchSpecifications
public final List<SpotFleetLaunchSpecification> launchSpecifications()
The launch specifications for the Spot Fleet request. If you specify
LaunchSpecifications
, you can't specifyLaunchTemplateConfigs
. If you include On-Demand capacity in your request, you must useLaunchTemplateConfigs
.Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasLaunchSpecifications()
method.- Returns:
- The launch specifications for the Spot Fleet request. If you specify
LaunchSpecifications
, you can't specifyLaunchTemplateConfigs
. If you include On-Demand capacity in your request, you must useLaunchTemplateConfigs
.
-
hasLaunchTemplateConfigs
public final boolean hasLaunchTemplateConfigs()
For responses, this returns true if the service returned a value for the LaunchTemplateConfigs property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()
method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
-
launchTemplateConfigs
public final List<LaunchTemplateConfig> launchTemplateConfigs()
The launch template and overrides. If you specify
LaunchTemplateConfigs
, you can't specifyLaunchSpecifications
. If you include On-Demand capacity in your request, you must useLaunchTemplateConfigs
.Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasLaunchTemplateConfigs()
method.- Returns:
- The launch template and overrides. If you specify
LaunchTemplateConfigs
, you can't specifyLaunchSpecifications
. If you include On-Demand capacity in your request, you must useLaunchTemplateConfigs
.
-
spotPrice
public final 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.
- Returns:
- 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.
-
targetCapacity
public final Integer targetCapacity()
The number of units to request for the Spot Fleet. You can choose to set the target capacity in terms of instances or a performance characteristic that is important to your application workload, such as vCPUs, memory, or I/O. If the request type is
maintain
, you can specify a target capacity of 0 and add capacity later.- Returns:
- The number of units to request for the Spot Fleet. You can choose to set the target capacity in terms of
instances or a performance characteristic that is important to your application workload, such as vCPUs,
memory, or I/O. If the request type is
maintain
, you can specify a target capacity of 0 and add capacity later.
-
onDemandTargetCapacity
public final Integer onDemandTargetCapacity()
The number of On-Demand units to request. You can choose to set the target capacity in terms of instances or a performance characteristic that is important to your application workload, such as vCPUs, memory, or I/O. If the request type is
maintain
, you can specify a target capacity of 0 and add capacity later.- Returns:
- The number of On-Demand units to request. You can choose to set the target capacity in terms of instances
or a performance characteristic that is important to your application workload, such as vCPUs, memory, or
I/O. If the request type is
maintain
, you can specify a target capacity of 0 and add capacity later.
-
onDemandMaxTotalPrice
public final String onDemandMaxTotalPrice()
The maximum amount per hour for On-Demand Instances that you're willing to pay. You can use the
onDemandMaxTotalPrice
parameter, thespotMaxTotalPrice
parameter, or both parameters to ensure that your fleet cost does not exceed your budget. If you set a maximum price per hour for the On-Demand Instances and Spot Instances in your request, Spot Fleet will launch instances until it reaches the maximum amount you're willing to pay. When the maximum amount you're willing to pay is reached, the fleet stops launching instances even if it hasn’t met the target capacity.If your fleet includes T instances that are configured as
unlimited
, and if their average CPU usage exceeds the baseline utilization, you will incur a charge for surplus credits. TheonDemandMaxTotalPrice
does not account for surplus credits, and, if you use surplus credits, your final cost might be higher than what you specified foronDemandMaxTotalPrice
. For more information, see Surplus credits can incur charges in the EC2 User Guide.- Returns:
- The maximum amount per hour for On-Demand Instances that you're willing to pay. You can use the
onDemandMaxTotalPrice
parameter, thespotMaxTotalPrice
parameter, or both parameters to ensure that your fleet cost does not exceed your budget. If you set a maximum price per hour for the On-Demand Instances and Spot Instances in your request, Spot Fleet will launch instances until it reaches the maximum amount you're willing to pay. When the maximum amount you're willing to pay is reached, the fleet stops launching instances even if it hasn’t met the target capacity.If your fleet includes T instances that are configured as
unlimited
, and if their average CPU usage exceeds the baseline utilization, you will incur a charge for surplus credits. TheonDemandMaxTotalPrice
does not account for surplus credits, and, if you use surplus credits, your final cost might be higher than what you specified foronDemandMaxTotalPrice
. For more information, see Surplus credits can incur charges in the EC2 User Guide.
-
spotMaxTotalPrice
public final String spotMaxTotalPrice()
The maximum amount per hour for Spot Instances that you're willing to pay. You can use the
spotMaxTotalPrice
parameter, theonDemandMaxTotalPrice
parameter, or both parameters to ensure that your fleet cost does not exceed your budget. If you set a maximum price per hour for the On-Demand Instances and Spot Instances in your request, Spot Fleet will launch instances until it reaches the maximum amount you're willing to pay. When the maximum amount you're willing to pay is reached, the fleet stops launching instances even if it hasn’t met the target capacity.If your fleet includes T instances that are configured as
unlimited
, and if their average CPU usage exceeds the baseline utilization, you will incur a charge for surplus credits. ThespotMaxTotalPrice
does not account for surplus credits, and, if you use surplus credits, your final cost might be higher than what you specified forspotMaxTotalPrice
. For more information, see Surplus credits can incur charges in the EC2 User Guide.- Returns:
- The maximum amount per hour for Spot Instances that you're willing to pay. You can use the
spotMaxTotalPrice
parameter, theonDemandMaxTotalPrice
parameter, or both parameters to ensure that your fleet cost does not exceed your budget. If you set a maximum price per hour for the On-Demand Instances and Spot Instances in your request, Spot Fleet will launch instances until it reaches the maximum amount you're willing to pay. When the maximum amount you're willing to pay is reached, the fleet stops launching instances even if it hasn’t met the target capacity.If your fleet includes T instances that are configured as
unlimited
, and if their average CPU usage exceeds the baseline utilization, you will incur a charge for surplus credits. ThespotMaxTotalPrice
does not account for surplus credits, and, if you use surplus credits, your final cost might be higher than what you specified forspotMaxTotalPrice
. For more information, see Surplus credits can incur charges in the EC2 User Guide.
-
terminateInstancesWithExpiration
public final Boolean terminateInstancesWithExpiration()
Indicates whether running Spot Instances are terminated when the Spot Fleet request expires.
- Returns:
- Indicates whether running Spot Instances are terminated when the Spot Fleet request expires.
-
type
public final FleetType type()
The type of request. Indicates whether the Spot Fleet only requests the target capacity or also attempts to maintain it. When this value is
request
, the Spot Fleet only places the required requests. It does not attempt to replenish Spot Instances if capacity is diminished, nor does it submit requests in alternative Spot pools if capacity is not available. When this value ismaintain
, the Spot Fleet maintains the target capacity. The Spot Fleet places the required requests to meet capacity and automatically replenishes any interrupted instances. Default:maintain
.instant
is listed but is not used by Spot Fleet.If the service returns an enum value that is not available in the current SDK version,
type
will returnFleetType.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromtypeAsString()
.- Returns:
- The type of request. Indicates whether the Spot Fleet only requests the target capacity or also attempts
to maintain it. When this value is
request
, the Spot Fleet only places the required requests. It does not attempt to replenish Spot Instances if capacity is diminished, nor does it submit requests in alternative Spot pools if capacity is not available. When this value ismaintain
, the Spot Fleet maintains the target capacity. The Spot Fleet places the required requests to meet capacity and automatically replenishes any interrupted instances. Default:maintain
.instant
is listed but is not used by Spot Fleet. - See Also:
FleetType
-
typeAsString
public final String typeAsString()
The type of request. Indicates whether the Spot Fleet only requests the target capacity or also attempts to maintain it. When this value is
request
, the Spot Fleet only places the required requests. It does not attempt to replenish Spot Instances if capacity is diminished, nor does it submit requests in alternative Spot pools if capacity is not available. When this value ismaintain
, the Spot Fleet maintains the target capacity. The Spot Fleet places the required requests to meet capacity and automatically replenishes any interrupted instances. Default:maintain
.instant
is listed but is not used by Spot Fleet.If the service returns an enum value that is not available in the current SDK version,
type
will returnFleetType.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromtypeAsString()
.- Returns:
- The type of request. Indicates whether the Spot Fleet only requests the target capacity or also attempts
to maintain it. When this value is
request
, the Spot Fleet only places the required requests. It does not attempt to replenish Spot Instances if capacity is diminished, nor does it submit requests in alternative Spot pools if capacity is not available. When this value ismaintain
, the Spot Fleet maintains the target capacity. The Spot Fleet places the required requests to meet capacity and automatically replenishes any interrupted instances. Default:maintain
.instant
is listed but is not used by Spot Fleet. - See Also:
FleetType
-
validFrom
public final Instant validFrom()
The start date and time of the request, in UTC format (YYYY-MM-DDTHH:MM:SSZ). By default, Amazon EC2 starts fulfilling the request immediately.
- Returns:
- The start date and time of the request, in UTC format (YYYY-MM-DDTHH:MM:SSZ). By default, Amazon EC2 starts fulfilling the request immediately.
-
validUntil
public final Instant validUntil()
The end date and time of the request, in UTC format (YYYY-MM-DDTHH:MM:SSZ). After the end date and time, no new Spot Instance requests are placed or able to fulfill the request. If no value is specified, the Spot Fleet request remains until you cancel it.
- Returns:
- The end date and time of the request, in UTC format (YYYY-MM-DDTHH:MM:SSZ). After the end date and time, no new Spot Instance requests are placed or able to fulfill the request. If no value is specified, the Spot Fleet request remains until you cancel it.
-
replaceUnhealthyInstances
public final Boolean replaceUnhealthyInstances()
Indicates whether Spot Fleet should replace unhealthy instances.
- Returns:
- Indicates whether Spot Fleet should replace unhealthy instances.
-
instanceInterruptionBehavior
public final InstanceInterruptionBehavior instanceInterruptionBehavior()
The behavior when a Spot Instance is interrupted. The default is
terminate
.If the service returns an enum value that is not available in the current SDK version,
instanceInterruptionBehavior
will returnInstanceInterruptionBehavior.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available frominstanceInterruptionBehaviorAsString()
.- Returns:
- The behavior when a Spot Instance is interrupted. The default is
terminate
. - See Also:
InstanceInterruptionBehavior
-
instanceInterruptionBehaviorAsString
public final String instanceInterruptionBehaviorAsString()
The behavior when a Spot Instance is interrupted. The default is
terminate
.If the service returns an enum value that is not available in the current SDK version,
instanceInterruptionBehavior
will returnInstanceInterruptionBehavior.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available frominstanceInterruptionBehaviorAsString()
.- Returns:
- The behavior when a Spot Instance is interrupted. The default is
terminate
. - See Also:
InstanceInterruptionBehavior
-
loadBalancersConfig
public final LoadBalancersConfig loadBalancersConfig()
One or more Classic Load Balancers and target groups to attach to the Spot Fleet request. Spot Fleet registers the running Spot Instances with the specified Classic Load Balancers and target groups.
With Network Load Balancers, Spot Fleet cannot register instances that have the following instance types: C1, CC1, CC2, CG1, CG2, CR1, CS1, G1, G2, HI1, HS1, M1, M2, M3, and T1.
- Returns:
- One or more Classic Load Balancers and target groups to attach to the Spot Fleet request. Spot Fleet
registers the running Spot Instances with the specified Classic Load Balancers and target groups.
With Network Load Balancers, Spot Fleet cannot register instances that have the following instance types: C1, CC1, CC2, CG1, CG2, CR1, CS1, G1, G2, HI1, HS1, M1, M2, M3, and T1.
-
instancePoolsToUseCount
public final Integer instancePoolsToUseCount()
The number of Spot pools across which to allocate your target Spot capacity. Valid only when Spot AllocationStrategy is set to
lowest-price
. Spot Fleet selects the cheapest Spot pools and evenly allocates your target Spot capacity across the number of Spot pools that you specify.Note that Spot Fleet attempts to draw Spot Instances from the number of pools that you specify on a best effort basis. If a pool runs out of Spot capacity before fulfilling your target capacity, Spot Fleet will continue to fulfill your request by drawing from the next cheapest pool. To ensure that your target capacity is met, you might receive Spot Instances from more than the number of pools that you specified. Similarly, if most of the pools have no Spot capacity, you might receive your full target capacity from fewer than the number of pools that you specified.
- Returns:
- The number of Spot pools across which to allocate your target Spot capacity. Valid only when Spot
AllocationStrategy is set to
lowest-price
. Spot Fleet selects the cheapest Spot pools and evenly allocates your target Spot capacity across the number of Spot pools that you specify.Note that Spot Fleet attempts to draw Spot Instances from the number of pools that you specify on a best effort basis. If a pool runs out of Spot capacity before fulfilling your target capacity, Spot Fleet will continue to fulfill your request by drawing from the next cheapest pool. To ensure that your target capacity is met, you might receive Spot Instances from more than the number of pools that you specified. Similarly, if most of the pools have no Spot capacity, you might receive your full target capacity from fewer than the number of pools that you specified.
-
context
public final String context()
Reserved.
- Returns:
- Reserved.
-
targetCapacityUnitType
public final TargetCapacityUnitType targetCapacityUnitType()
The unit for the target capacity. You can specify this parameter only when using attribute-based instance type selection.
Default:
units
(the number of instances)If the service returns an enum value that is not available in the current SDK version,
targetCapacityUnitType
will returnTargetCapacityUnitType.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromtargetCapacityUnitTypeAsString()
.- Returns:
- The unit for the target capacity. You can specify this parameter only when using attribute-based instance
type selection.
Default:
units
(the number of instances) - See Also:
TargetCapacityUnitType
-
targetCapacityUnitTypeAsString
public final String targetCapacityUnitTypeAsString()
The unit for the target capacity. You can specify this parameter only when using attribute-based instance type selection.
Default:
units
(the number of instances)If the service returns an enum value that is not available in the current SDK version,
targetCapacityUnitType
will returnTargetCapacityUnitType.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromtargetCapacityUnitTypeAsString()
.- Returns:
- The unit for the target capacity. You can specify this parameter only when using attribute-based instance
type selection.
Default:
units
(the number of instances) - See Also:
TargetCapacityUnitType
-
hasTagSpecifications
public final boolean hasTagSpecifications()
For responses, this returns true if the service returned a value for the TagSpecifications property. This DOES NOT check that the value is non-empty (for which, you should check theisEmpty()
method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
-
tagSpecifications
public final List<TagSpecification> tagSpecifications()
The key-value pair for tagging the Spot Fleet request on creation. The value for
ResourceType
must bespot-fleet-request
, otherwise the Spot Fleet request fails. To tag instances at launch, specify the tags in the launch template (valid only if you useLaunchTemplateConfigs
) or in theSpotFleetTagSpecification
(valid only if you useLaunchSpecifications
). For information about tagging after launch, see Tag your resources.Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the
hasTagSpecifications()
method.- Returns:
- The key-value pair for tagging the Spot Fleet request on creation. The value for
ResourceType
must bespot-fleet-request
, otherwise the Spot Fleet request fails. To tag instances at launch, specify the tags in the launch template (valid only if you useLaunchTemplateConfigs
) or in theSpotFleetTagSpecification
(valid only if you useLaunchSpecifications
). For information about tagging after launch, see Tag your resources.
-
toBuilder
public SpotFleetRequestConfigData.Builder toBuilder()
- Specified by:
toBuilder
in interfaceToCopyableBuilder<SpotFleetRequestConfigData.Builder,SpotFleetRequestConfigData>
-
builder
public static SpotFleetRequestConfigData.Builder builder()
-
serializableBuilderClass
public static Class<? extends SpotFleetRequestConfigData.Builder> serializableBuilderClass()
-
equalsBySdkFields
public final boolean equalsBySdkFields(Object obj)
- Specified by:
equalsBySdkFields
in interfaceSdkPojo
-
toString
public final String toString()
Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
-
-