Class CfnEC2Fleet.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnEC2Fleet>
- Enclosing class:
- CfnEC2Fleet
CfnEC2Fleet
.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Reserved.static CfnEC2Fleet.Builder
excessCapacityTerminationPolicy
(String excessCapacityTerminationPolicy) Indicates whether running instances should be terminated if the total target capacity of the EC2 Fleet is decreased below the current size of the EC2 Fleet.launchTemplateConfigs
(List<? extends Object> launchTemplateConfigs) The configuration for the EC2 Fleet.launchTemplateConfigs
(IResolvable launchTemplateConfigs) The configuration for the EC2 Fleet.onDemandOptions
(IResolvable onDemandOptions) Describes the configuration of On-Demand Instances in an EC2 Fleet.onDemandOptions
(CfnEC2Fleet.OnDemandOptionsRequestProperty onDemandOptions) Describes the configuration of On-Demand Instances in an EC2 Fleet.replaceUnhealthyInstances
(Boolean replaceUnhealthyInstances) Indicates whether EC2 Fleet should replace unhealthy Spot Instances.replaceUnhealthyInstances
(IResolvable replaceUnhealthyInstances) Indicates whether EC2 Fleet should replace unhealthy Spot Instances.spotOptions
(IResolvable spotOptions) Describes the configuration of Spot Instances in an EC2 Fleet.spotOptions
(CfnEC2Fleet.SpotOptionsRequestProperty spotOptions) Describes the configuration of Spot Instances in an EC2 Fleet.tagSpecifications
(List<? extends Object> tagSpecifications) The key-value pair for tagging the EC2 Fleet request on creation.tagSpecifications
(IResolvable tagSpecifications) The key-value pair for tagging the EC2 Fleet request on creation.targetCapacitySpecification
(IResolvable targetCapacitySpecification) The number of units to request.targetCapacitySpecification
(CfnEC2Fleet.TargetCapacitySpecificationRequestProperty targetCapacitySpecification) The number of units to request.terminateInstancesWithExpiration
(Boolean terminateInstancesWithExpiration) Indicates whether running instances should be terminated when the EC2 Fleet expires.terminateInstancesWithExpiration
(IResolvable terminateInstancesWithExpiration) Indicates whether running instances should be terminated when the EC2 Fleet expires.The fleet type.The start date and time of the request, in UTC format (for example, YYYY - MM - DD T HH : MM : SS Z).validUntil
(String validUntil) The end date and time of the request, in UTC format (for example, YYYY - MM - DD T HH : MM : SS Z).
-
Method Details
-
create
- Parameters:
scope
-- scope in which this resource is defined.
id
-- scoped id of the resource.
- Returns:
- a new instance of
CfnEC2Fleet.Builder
.
-
launchTemplateConfigs
@Stability(Stable) public CfnEC2Fleet.Builder launchTemplateConfigs(IResolvable launchTemplateConfigs) The configuration for the EC2 Fleet.- Parameters:
launchTemplateConfigs
- The configuration for the EC2 Fleet. This parameter is required.- Returns:
this
-
launchTemplateConfigs
@Stability(Stable) public CfnEC2Fleet.Builder launchTemplateConfigs(List<? extends Object> launchTemplateConfigs) The configuration for the EC2 Fleet.- Parameters:
launchTemplateConfigs
- The configuration for the EC2 Fleet. This parameter is required.- Returns:
this
-
targetCapacitySpecification
@Stability(Stable) public CfnEC2Fleet.Builder targetCapacitySpecification(IResolvable targetCapacitySpecification) The number of units to request.- Parameters:
targetCapacitySpecification
- The number of units to request. This parameter is required.- Returns:
this
-
targetCapacitySpecification
@Stability(Stable) public CfnEC2Fleet.Builder targetCapacitySpecification(CfnEC2Fleet.TargetCapacitySpecificationRequestProperty targetCapacitySpecification) The number of units to request.- Parameters:
targetCapacitySpecification
- The number of units to request. This parameter is required.- Returns:
this
-
context
Reserved.- Parameters:
context
- Reserved. This parameter is required.- Returns:
this
-
excessCapacityTerminationPolicy
@Stability(Stable) public CfnEC2Fleet.Builder excessCapacityTerminationPolicy(String excessCapacityTerminationPolicy) Indicates whether running instances should be terminated if the total target capacity of the EC2 Fleet is decreased below the current size of the EC2 Fleet.Supported only for fleets of type
maintain
.- Parameters:
excessCapacityTerminationPolicy
- Indicates whether running instances should be terminated if the total target capacity of the EC2 Fleet is decreased below the current size of the EC2 Fleet. This parameter is required.- Returns:
this
-
onDemandOptions
Describes the configuration of On-Demand Instances in an EC2 Fleet.- Parameters:
onDemandOptions
- Describes the configuration of On-Demand Instances in an EC2 Fleet. This parameter is required.- Returns:
this
-
onDemandOptions
@Stability(Stable) public CfnEC2Fleet.Builder onDemandOptions(CfnEC2Fleet.OnDemandOptionsRequestProperty onDemandOptions) Describes the configuration of On-Demand Instances in an EC2 Fleet.- Parameters:
onDemandOptions
- Describes the configuration of On-Demand Instances in an EC2 Fleet. This parameter is required.- Returns:
this
-
replaceUnhealthyInstances
@Stability(Stable) public CfnEC2Fleet.Builder replaceUnhealthyInstances(Boolean replaceUnhealthyInstances) Indicates whether EC2 Fleet should replace unhealthy Spot Instances.Supported only for fleets of type
maintain
. For more information, see EC2 Fleet health checks in the Amazon EC2 User Guide .- Parameters:
replaceUnhealthyInstances
- Indicates whether EC2 Fleet should replace unhealthy Spot Instances. This parameter is required.- Returns:
this
-
replaceUnhealthyInstances
@Stability(Stable) public CfnEC2Fleet.Builder replaceUnhealthyInstances(IResolvable replaceUnhealthyInstances) Indicates whether EC2 Fleet should replace unhealthy Spot Instances.Supported only for fleets of type
maintain
. For more information, see EC2 Fleet health checks in the Amazon EC2 User Guide .- Parameters:
replaceUnhealthyInstances
- Indicates whether EC2 Fleet should replace unhealthy Spot Instances. This parameter is required.- Returns:
this
-
spotOptions
Describes the configuration of Spot Instances in an EC2 Fleet.- Parameters:
spotOptions
- Describes the configuration of Spot Instances in an EC2 Fleet. This parameter is required.- Returns:
this
-
spotOptions
@Stability(Stable) public CfnEC2Fleet.Builder spotOptions(CfnEC2Fleet.SpotOptionsRequestProperty spotOptions) Describes the configuration of Spot Instances in an EC2 Fleet.- Parameters:
spotOptions
- Describes the configuration of Spot Instances in an EC2 Fleet. This parameter is required.- Returns:
this
-
tagSpecifications
The key-value pair for tagging the EC2 Fleet request on creation. For more information, see Tagging your resources .If the fleet type is
instant
, specify a resource type offleet
to tag the fleet orinstance
to tag the instances at launch.If the fleet type is
maintain
orrequest
, specify a resource type offleet
to tag the fleet. You cannot specify a resource type ofinstance
. To tag instances at launch, specify the tags in a launch template .- Parameters:
tagSpecifications
- The key-value pair for tagging the EC2 Fleet request on creation. For more information, see Tagging your resources . This parameter is required.- Returns:
this
-
tagSpecifications
@Stability(Stable) public CfnEC2Fleet.Builder tagSpecifications(List<? extends Object> tagSpecifications) The key-value pair for tagging the EC2 Fleet request on creation. For more information, see Tagging your resources .If the fleet type is
instant
, specify a resource type offleet
to tag the fleet orinstance
to tag the instances at launch.If the fleet type is
maintain
orrequest
, specify a resource type offleet
to tag the fleet. You cannot specify a resource type ofinstance
. To tag instances at launch, specify the tags in a launch template .- Parameters:
tagSpecifications
- The key-value pair for tagging the EC2 Fleet request on creation. For more information, see Tagging your resources . This parameter is required.- Returns:
this
-
terminateInstancesWithExpiration
@Stability(Stable) public CfnEC2Fleet.Builder terminateInstancesWithExpiration(Boolean terminateInstancesWithExpiration) Indicates whether running instances should be terminated when the EC2 Fleet expires.- Parameters:
terminateInstancesWithExpiration
- Indicates whether running instances should be terminated when the EC2 Fleet expires. This parameter is required.- Returns:
this
-
terminateInstancesWithExpiration
@Stability(Stable) public CfnEC2Fleet.Builder terminateInstancesWithExpiration(IResolvable terminateInstancesWithExpiration) Indicates whether running instances should be terminated when the EC2 Fleet expires.- Parameters:
terminateInstancesWithExpiration
- Indicates whether running instances should be terminated when the EC2 Fleet expires. This parameter is required.- Returns:
this
-
type
The fleet type. The default value ismaintain
.maintain
- The EC2 Fleet places an asynchronous request for your desired capacity, and continues to maintain your desired Spot capacity by replenishing interrupted Spot Instances.request
- The EC2 Fleet places an asynchronous one-time request for your desired capacity, but does submit Spot requests in alternative capacity pools if Spot capacity is unavailable, and does not maintain Spot capacity if Spot Instances are interrupted.instant
- The EC2 Fleet places a synchronous one-time request for your desired capacity, and returns errors for any instances that could not be launched.
For more information, see EC2 Fleet request types in the Amazon EC2 User Guide .
- Parameters:
type
- The fleet type. The default value ismaintain
. This parameter is required.- Returns:
this
-
validFrom
The start date and time of the request, in UTC format (for example, YYYY - MM - DD T HH : MM : SS Z).The default is to start fulfilling the request immediately.
- Parameters:
validFrom
- The start date and time of the request, in UTC format (for example, YYYY - MM - DD T HH : MM : SS Z). This parameter is required.- Returns:
this
-
validUntil
The end date and time of the request, in UTC format (for example, YYYY - MM - DD T HH : MM : SS Z).At this point, no new EC2 Fleet requests are placed or able to fulfill the request. If no value is specified, the request remains until you cancel it.
- Parameters:
validUntil
- The end date and time of the request, in UTC format (for example, YYYY - MM - DD T HH : MM : SS Z). This parameter is required.- Returns:
this
-
build
- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnEC2Fleet>
- Returns:
- a newly built instance of
CfnEC2Fleet
.
-