Class CfnEC2Fleet.SpotOptionsRequestProperty.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnEC2Fleet.SpotOptionsRequestProperty>
- Enclosing interface:
CfnEC2Fleet.SpotOptionsRequestProperty
CfnEC2Fleet.SpotOptionsRequestProperty
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionallocationStrategy
(String allocationStrategy) Sets the value ofCfnEC2Fleet.SpotOptionsRequestProperty.getAllocationStrategy()
build()
Builds the configured instance.instanceInterruptionBehavior
(String instanceInterruptionBehavior) Sets the value ofCfnEC2Fleet.SpotOptionsRequestProperty.getInstanceInterruptionBehavior()
instancePoolsToUseCount
(Number instancePoolsToUseCount) Sets the value ofCfnEC2Fleet.SpotOptionsRequestProperty.getInstancePoolsToUseCount()
maintenanceStrategies
(IResolvable maintenanceStrategies) Sets the value ofCfnEC2Fleet.SpotOptionsRequestProperty.getMaintenanceStrategies()
maintenanceStrategies
(CfnEC2Fleet.MaintenanceStrategiesProperty maintenanceStrategies) Sets the value ofCfnEC2Fleet.SpotOptionsRequestProperty.getMaintenanceStrategies()
maxTotalPrice
(String maxTotalPrice) Sets the value ofCfnEC2Fleet.SpotOptionsRequestProperty.getMaxTotalPrice()
minTargetCapacity
(Number minTargetCapacity) Sets the value ofCfnEC2Fleet.SpotOptionsRequestProperty.getMinTargetCapacity()
singleAvailabilityZone
(Boolean singleAvailabilityZone) Sets the value ofCfnEC2Fleet.SpotOptionsRequestProperty.getSingleAvailabilityZone()
singleAvailabilityZone
(IResolvable singleAvailabilityZone) Sets the value ofCfnEC2Fleet.SpotOptionsRequestProperty.getSingleAvailabilityZone()
singleInstanceType
(Boolean singleInstanceType) Sets the value ofCfnEC2Fleet.SpotOptionsRequestProperty.getSingleInstanceType()
singleInstanceType
(IResolvable singleInstanceType) Sets the value ofCfnEC2Fleet.SpotOptionsRequestProperty.getSingleInstanceType()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
allocationStrategy
@Stability(Stable) public CfnEC2Fleet.SpotOptionsRequestProperty.Builder allocationStrategy(String allocationStrategy) Sets the value ofCfnEC2Fleet.SpotOptionsRequestProperty.getAllocationStrategy()
- Parameters:
allocationStrategy
- Indicates how to allocate the target Spot Instance capacity across the Spot Instance pools specified by the EC2 Fleet. If the allocation strategy islowestPrice
, EC2 Fleet launches instances from the Spot Instance pools with the lowest price. This is the default allocation strategy.If the allocation strategy is
diversified
, EC2 Fleet launches instances from all the Spot Instance pools that you specify.If the allocation strategy is
capacityOptimized
, EC2 Fleet launches instances from Spot Instance pools that are optimally chosen based on the available Spot Instance capacity.Allowed Values :
lowestPrice
|diversified
|capacityOptimized
|capacityOptimizedPrioritized
- Returns:
this
-
instanceInterruptionBehavior
@Stability(Stable) public CfnEC2Fleet.SpotOptionsRequestProperty.Builder instanceInterruptionBehavior(String instanceInterruptionBehavior) Sets the value ofCfnEC2Fleet.SpotOptionsRequestProperty.getInstanceInterruptionBehavior()
- Parameters:
instanceInterruptionBehavior
- The behavior when a Spot Instance is interrupted. Default:terminate
- Returns:
this
-
instancePoolsToUseCount
@Stability(Stable) public CfnEC2Fleet.SpotOptionsRequestProperty.Builder instancePoolsToUseCount(Number instancePoolsToUseCount) Sets the value ofCfnEC2Fleet.SpotOptionsRequestProperty.getInstancePoolsToUseCount()
- Parameters:
instancePoolsToUseCount
- The number of Spot pools across which to allocate your target Spot capacity. Supported only when SpotAllocationStrategy
is set tolowest-price
. EC2 Fleet selects the cheapest Spot pools and evenly allocates your target Spot capacity across the number of Spot pools that you specify.Note that EC2 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, EC2 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:
this
-
maintenanceStrategies
@Stability(Stable) public CfnEC2Fleet.SpotOptionsRequestProperty.Builder maintenanceStrategies(IResolvable maintenanceStrategies) Sets the value ofCfnEC2Fleet.SpotOptionsRequestProperty.getMaintenanceStrategies()
- Parameters:
maintenanceStrategies
- The strategies for managing your Spot Instances that are at an elevated risk of being interrupted.- Returns:
this
-
maintenanceStrategies
@Stability(Stable) public CfnEC2Fleet.SpotOptionsRequestProperty.Builder maintenanceStrategies(CfnEC2Fleet.MaintenanceStrategiesProperty maintenanceStrategies) Sets the value ofCfnEC2Fleet.SpotOptionsRequestProperty.getMaintenanceStrategies()
- Parameters:
maintenanceStrategies
- The strategies for managing your Spot Instances that are at an elevated risk of being interrupted.- Returns:
this
-
maxTotalPrice
@Stability(Stable) public CfnEC2Fleet.SpotOptionsRequestProperty.Builder maxTotalPrice(String maxTotalPrice) Sets the value ofCfnEC2Fleet.SpotOptionsRequestProperty.getMaxTotalPrice()
- Parameters:
maxTotalPrice
- The maximum amount per hour for Spot Instances that you're willing to pay. 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
-
minTargetCapacity
@Stability(Stable) public CfnEC2Fleet.SpotOptionsRequestProperty.Builder minTargetCapacity(Number minTargetCapacity) Sets the value ofCfnEC2Fleet.SpotOptionsRequestProperty.getMinTargetCapacity()
- Parameters:
minTargetCapacity
- The minimum target capacity for Spot Instances in the fleet. If the minimum target capacity is not reached, the fleet launches no instances.Supported only for fleets of type
instant
.At least one of the following must be specified:
SingleAvailabilityZone
|SingleInstanceType
- Returns:
this
-
singleAvailabilityZone
@Stability(Stable) public CfnEC2Fleet.SpotOptionsRequestProperty.Builder singleAvailabilityZone(Boolean singleAvailabilityZone) Sets the value ofCfnEC2Fleet.SpotOptionsRequestProperty.getSingleAvailabilityZone()
- Parameters:
singleAvailabilityZone
- Indicates that the fleet launches all Spot Instances into a single Availability Zone. Supported only for fleets of typeinstant
.- Returns:
this
-
singleAvailabilityZone
@Stability(Stable) public CfnEC2Fleet.SpotOptionsRequestProperty.Builder singleAvailabilityZone(IResolvable singleAvailabilityZone) Sets the value ofCfnEC2Fleet.SpotOptionsRequestProperty.getSingleAvailabilityZone()
- Parameters:
singleAvailabilityZone
- Indicates that the fleet launches all Spot Instances into a single Availability Zone. Supported only for fleets of typeinstant
.- Returns:
this
-
singleInstanceType
@Stability(Stable) public CfnEC2Fleet.SpotOptionsRequestProperty.Builder singleInstanceType(Boolean singleInstanceType) Sets the value ofCfnEC2Fleet.SpotOptionsRequestProperty.getSingleInstanceType()
- Parameters:
singleInstanceType
- Indicates that the fleet uses a single instance type to launch all Spot Instances in the fleet. Supported only for fleets of typeinstant
.- Returns:
this
-
singleInstanceType
@Stability(Stable) public CfnEC2Fleet.SpotOptionsRequestProperty.Builder singleInstanceType(IResolvable singleInstanceType) Sets the value ofCfnEC2Fleet.SpotOptionsRequestProperty.getSingleInstanceType()
- Parameters:
singleInstanceType
- Indicates that the fleet uses a single instance type to launch all Spot Instances in the fleet. Supported only for fleets of typeinstant
.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnEC2Fleet.SpotOptionsRequestProperty>
- Returns:
- a new instance of
CfnEC2Fleet.SpotOptionsRequestProperty
- Throws:
NullPointerException
- if any required attribute was not provided
-