Class CfnEC2Fleet.OnDemandOptionsRequestProperty.Builder
java.lang.Object
software.amazon.awscdk.services.ec2.CfnEC2Fleet.OnDemandOptionsRequestProperty.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnEC2Fleet.OnDemandOptionsRequestProperty>
- Enclosing interface:
- CfnEC2Fleet.OnDemandOptionsRequestProperty
@Stability(Stable)
public static final class CfnEC2Fleet.OnDemandOptionsRequestProperty.Builder
extends Object
implements software.amazon.jsii.Builder<CfnEC2Fleet.OnDemandOptionsRequestProperty>
A builder for
CfnEC2Fleet.OnDemandOptionsRequestProperty
-
Constructor Summary
Constructors -
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.- 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 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.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
-