Class CfnEC2Fleet.OnDemandOptionsRequestProperty.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnEC2Fleet.OnDemandOptionsRequestProperty>
- Enclosing interface:
CfnEC2Fleet.OnDemandOptionsRequestProperty
CfnEC2Fleet.OnDemandOptionsRequestProperty
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionallocationStrategy
(String allocationStrategy) Sets the value ofCfnEC2Fleet.OnDemandOptionsRequestProperty.getAllocationStrategy()
build()
Builds the configured instance.capacityReservationOptions
(IResolvable capacityReservationOptions) capacityReservationOptions
(CfnEC2Fleet.CapacityReservationOptionsRequestProperty capacityReservationOptions) maxTotalPrice
(String maxTotalPrice) Sets the value ofCfnEC2Fleet.OnDemandOptionsRequestProperty.getMaxTotalPrice()
minTargetCapacity
(Number minTargetCapacity) Sets the value ofCfnEC2Fleet.OnDemandOptionsRequestProperty.getMinTargetCapacity()
singleAvailabilityZone
(Boolean singleAvailabilityZone) Sets the value ofCfnEC2Fleet.OnDemandOptionsRequestProperty.getSingleAvailabilityZone()
singleAvailabilityZone
(IResolvable singleAvailabilityZone) Sets the value ofCfnEC2Fleet.OnDemandOptionsRequestProperty.getSingleAvailabilityZone()
singleInstanceType
(Boolean singleInstanceType) Sets the value ofCfnEC2Fleet.OnDemandOptionsRequestProperty.getSingleInstanceType()
singleInstanceType
(IResolvable singleInstanceType) Sets the value ofCfnEC2Fleet.OnDemandOptionsRequestProperty.getSingleInstanceType()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
allocationStrategy
@Stability(Stable) public CfnEC2Fleet.OnDemandOptionsRequestProperty.Builder allocationStrategy(String allocationStrategy) Sets the value ofCfnEC2Fleet.OnDemandOptionsRequestProperty.getAllocationStrategy()
- Parameters:
allocationStrategy
- The strategy that determines the order of the launch template overrides to use in fulfilling On-Demand capacity.lowest-price
- EC2 Fleet uses price to determine the order, launching the lowest price first.prioritized
- EC2 Fleet uses the priority that you assigned to each launch template override, launching the highest priority first.Default:
lowest-price
- Returns:
this
-
capacityReservationOptions
@Stability(Stable) public CfnEC2Fleet.OnDemandOptionsRequestProperty.Builder capacityReservationOptions(IResolvable capacityReservationOptions) - Parameters:
capacityReservationOptions
- The strategy for using unused Capacity Reservations for fulfilling On-Demand capacity. Supported only for fleets of typeinstant
.- Returns:
this
-
capacityReservationOptions
@Stability(Stable) public CfnEC2Fleet.OnDemandOptionsRequestProperty.Builder capacityReservationOptions(CfnEC2Fleet.CapacityReservationOptionsRequestProperty capacityReservationOptions) - Parameters:
capacityReservationOptions
- The strategy for using unused Capacity Reservations for fulfilling On-Demand capacity. Supported only for fleets of typeinstant
.- Returns:
this
-
maxTotalPrice
@Stability(Stable) public CfnEC2Fleet.OnDemandOptionsRequestProperty.Builder maxTotalPrice(String maxTotalPrice) Sets the value ofCfnEC2Fleet.OnDemandOptionsRequestProperty.getMaxTotalPrice()
- Parameters:
maxTotalPrice
- The maximum amount per hour for On-Demand Instances that you're willing to pay.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. TheMaxTotalPrice
does not account for surplus credits, and, if you use surplus credits, your final cost might be higher than what you specified forMaxTotalPrice
. For more information, see Surplus credits can incur charges in the Amazon EC2 User Guide .- Returns:
this
-
minTargetCapacity
@Stability(Stable) public CfnEC2Fleet.OnDemandOptionsRequestProperty.Builder minTargetCapacity(Number minTargetCapacity) Sets the value ofCfnEC2Fleet.OnDemandOptionsRequestProperty.getMinTargetCapacity()
- Parameters:
minTargetCapacity
- The minimum target capacity for On-Demand Instances in the fleet. If this minimum capacity isn't reached, no instances are launched.Constraints: Maximum value of
1000
. Supported only for fleets of typeinstant
.At least one of the following must be specified:
SingleAvailabilityZone
|SingleInstanceType
- Returns:
this
-
singleAvailabilityZone
@Stability(Stable) public CfnEC2Fleet.OnDemandOptionsRequestProperty.Builder singleAvailabilityZone(Boolean singleAvailabilityZone) Sets the value ofCfnEC2Fleet.OnDemandOptionsRequestProperty.getSingleAvailabilityZone()
- Parameters:
singleAvailabilityZone
- Indicates that the fleet launches all On-Demand Instances into a single Availability Zone. Supported only for fleets of typeinstant
.- Returns:
this
-
singleAvailabilityZone
@Stability(Stable) public CfnEC2Fleet.OnDemandOptionsRequestProperty.Builder singleAvailabilityZone(IResolvable singleAvailabilityZone) Sets the value ofCfnEC2Fleet.OnDemandOptionsRequestProperty.getSingleAvailabilityZone()
- Parameters:
singleAvailabilityZone
- Indicates that the fleet launches all On-Demand Instances into a single Availability Zone. Supported only for fleets of typeinstant
.- Returns:
this
-
singleInstanceType
@Stability(Stable) public CfnEC2Fleet.OnDemandOptionsRequestProperty.Builder singleInstanceType(Boolean singleInstanceType) Sets the value ofCfnEC2Fleet.OnDemandOptionsRequestProperty.getSingleInstanceType()
- Parameters:
singleInstanceType
- Indicates that the fleet uses a single instance type to launch all On-Demand Instances in the fleet. Supported only for fleets of typeinstant
.- Returns:
this
-
singleInstanceType
@Stability(Stable) public CfnEC2Fleet.OnDemandOptionsRequestProperty.Builder singleInstanceType(IResolvable singleInstanceType) Sets the value ofCfnEC2Fleet.OnDemandOptionsRequestProperty.getSingleInstanceType()
- Parameters:
singleInstanceType
- Indicates that the fleet uses a single instance type to launch all On-Demand 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.OnDemandOptionsRequestProperty>
- Returns:
- a new instance of
CfnEC2Fleet.OnDemandOptionsRequestProperty
- Throws:
NullPointerException
- if any required attribute was not provided
-