Class CfnEC2FleetProps.Builder
java.lang.Object
software.amazon.awscdk.services.ec2.CfnEC2FleetProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnEC2FleetProps>
- Enclosing interface:
CfnEC2FleetProps
@Stability(Stable)
public static final class CfnEC2FleetProps.Builder
extends Object
implements software.amazon.jsii.Builder<CfnEC2FleetProps>
A builder for
CfnEC2FleetProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.Sets the value ofCfnEC2FleetProps.getContext()
excessCapacityTerminationPolicy
(String excessCapacityTerminationPolicy) Sets the value ofCfnEC2FleetProps.getExcessCapacityTerminationPolicy()
launchTemplateConfigs
(List<? extends Object> launchTemplateConfigs) Sets the value ofCfnEC2FleetProps.getLaunchTemplateConfigs()
launchTemplateConfigs
(IResolvable launchTemplateConfigs) Sets the value ofCfnEC2FleetProps.getLaunchTemplateConfigs()
onDemandOptions
(IResolvable onDemandOptions) Sets the value ofCfnEC2FleetProps.getOnDemandOptions()
onDemandOptions
(CfnEC2Fleet.OnDemandOptionsRequestProperty onDemandOptions) Sets the value ofCfnEC2FleetProps.getOnDemandOptions()
replaceUnhealthyInstances
(Boolean replaceUnhealthyInstances) Sets the value ofCfnEC2FleetProps.getReplaceUnhealthyInstances()
replaceUnhealthyInstances
(IResolvable replaceUnhealthyInstances) Sets the value ofCfnEC2FleetProps.getReplaceUnhealthyInstances()
spotOptions
(IResolvable spotOptions) Sets the value ofCfnEC2FleetProps.getSpotOptions()
spotOptions
(CfnEC2Fleet.SpotOptionsRequestProperty spotOptions) Sets the value ofCfnEC2FleetProps.getSpotOptions()
tagSpecifications
(List<? extends Object> tagSpecifications) Sets the value ofCfnEC2FleetProps.getTagSpecifications()
tagSpecifications
(IResolvable tagSpecifications) Sets the value ofCfnEC2FleetProps.getTagSpecifications()
targetCapacitySpecification
(IResolvable targetCapacitySpecification) Sets the value ofCfnEC2FleetProps.getTargetCapacitySpecification()
targetCapacitySpecification
(CfnEC2Fleet.TargetCapacitySpecificationRequestProperty targetCapacitySpecification) Sets the value ofCfnEC2FleetProps.getTargetCapacitySpecification()
terminateInstancesWithExpiration
(Boolean terminateInstancesWithExpiration) Sets the value ofCfnEC2FleetProps.getTerminateInstancesWithExpiration()
terminateInstancesWithExpiration
(IResolvable terminateInstancesWithExpiration) Sets the value ofCfnEC2FleetProps.getTerminateInstancesWithExpiration()
Sets the value ofCfnEC2FleetProps.getType()
Sets the value ofCfnEC2FleetProps.getValidFrom()
validUntil
(String validUntil) Sets the value ofCfnEC2FleetProps.getValidUntil()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
launchTemplateConfigs
@Stability(Stable) public CfnEC2FleetProps.Builder launchTemplateConfigs(IResolvable launchTemplateConfigs) Sets the value ofCfnEC2FleetProps.getLaunchTemplateConfigs()
- Parameters:
launchTemplateConfigs
- The configuration for the EC2 Fleet. This parameter is required.- Returns:
this
-
launchTemplateConfigs
@Stability(Stable) public CfnEC2FleetProps.Builder launchTemplateConfigs(List<? extends Object> launchTemplateConfigs) Sets the value ofCfnEC2FleetProps.getLaunchTemplateConfigs()
- Parameters:
launchTemplateConfigs
- The configuration for the EC2 Fleet. This parameter is required.- Returns:
this
-
targetCapacitySpecification
@Stability(Stable) public CfnEC2FleetProps.Builder targetCapacitySpecification(IResolvable targetCapacitySpecification) Sets the value ofCfnEC2FleetProps.getTargetCapacitySpecification()
- Parameters:
targetCapacitySpecification
- The number of units to request. This parameter is required.- Returns:
this
-
targetCapacitySpecification
@Stability(Stable) public CfnEC2FleetProps.Builder targetCapacitySpecification(CfnEC2Fleet.TargetCapacitySpecificationRequestProperty targetCapacitySpecification) Sets the value ofCfnEC2FleetProps.getTargetCapacitySpecification()
- Parameters:
targetCapacitySpecification
- The number of units to request. This parameter is required.- Returns:
this
-
context
Sets the value ofCfnEC2FleetProps.getContext()
- Parameters:
context
- Reserved.- Returns:
this
-
excessCapacityTerminationPolicy
@Stability(Stable) public CfnEC2FleetProps.Builder excessCapacityTerminationPolicy(String excessCapacityTerminationPolicy) Sets the value ofCfnEC2FleetProps.getExcessCapacityTerminationPolicy()
- 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. Supported only for fleets of typemaintain
.- Returns:
this
-
onDemandOptions
Sets the value ofCfnEC2FleetProps.getOnDemandOptions()
- Parameters:
onDemandOptions
- Describes the configuration of On-Demand Instances in an EC2 Fleet.- Returns:
this
-
onDemandOptions
@Stability(Stable) public CfnEC2FleetProps.Builder onDemandOptions(CfnEC2Fleet.OnDemandOptionsRequestProperty onDemandOptions) Sets the value ofCfnEC2FleetProps.getOnDemandOptions()
- Parameters:
onDemandOptions
- Describes the configuration of On-Demand Instances in an EC2 Fleet.- Returns:
this
-
replaceUnhealthyInstances
@Stability(Stable) public CfnEC2FleetProps.Builder replaceUnhealthyInstances(Boolean replaceUnhealthyInstances) Sets the value ofCfnEC2FleetProps.getReplaceUnhealthyInstances()
- Parameters:
replaceUnhealthyInstances
- Indicates whether EC2 Fleet should replace unhealthy Spot Instances. Supported only for fleets of typemaintain
. For more information, see EC2 Fleet health checks in the Amazon EC2 User Guide .- Returns:
this
-
replaceUnhealthyInstances
@Stability(Stable) public CfnEC2FleetProps.Builder replaceUnhealthyInstances(IResolvable replaceUnhealthyInstances) Sets the value ofCfnEC2FleetProps.getReplaceUnhealthyInstances()
- Parameters:
replaceUnhealthyInstances
- Indicates whether EC2 Fleet should replace unhealthy Spot Instances. Supported only for fleets of typemaintain
. For more information, see EC2 Fleet health checks in the Amazon EC2 User Guide .- Returns:
this
-
spotOptions
Sets the value ofCfnEC2FleetProps.getSpotOptions()
- Parameters:
spotOptions
- Describes the configuration of Spot Instances in an EC2 Fleet.- Returns:
this
-
spotOptions
@Stability(Stable) public CfnEC2FleetProps.Builder spotOptions(CfnEC2Fleet.SpotOptionsRequestProperty spotOptions) Sets the value ofCfnEC2FleetProps.getSpotOptions()
- Parameters:
spotOptions
- Describes the configuration of Spot Instances in an EC2 Fleet.- Returns:
this
-
tagSpecifications
Sets the value ofCfnEC2FleetProps.getTagSpecifications()
- Parameters:
tagSpecifications
- The key-value pair for tagging the EC2 Fleet request on creation. For more information, see Tag your resources . If the fleet type isinstant
, 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 .- Returns:
this
-
tagSpecifications
@Stability(Stable) public CfnEC2FleetProps.Builder tagSpecifications(List<? extends Object> tagSpecifications) Sets the value ofCfnEC2FleetProps.getTagSpecifications()
- Parameters:
tagSpecifications
- The key-value pair for tagging the EC2 Fleet request on creation. For more information, see Tag your resources . If the fleet type isinstant
, 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 .- Returns:
this
-
terminateInstancesWithExpiration
@Stability(Stable) public CfnEC2FleetProps.Builder terminateInstancesWithExpiration(Boolean terminateInstancesWithExpiration) Sets the value ofCfnEC2FleetProps.getTerminateInstancesWithExpiration()
- Parameters:
terminateInstancesWithExpiration
- Indicates whether running instances should be terminated when the EC2 Fleet expires.- Returns:
this
-
terminateInstancesWithExpiration
@Stability(Stable) public CfnEC2FleetProps.Builder terminateInstancesWithExpiration(IResolvable terminateInstancesWithExpiration) Sets the value ofCfnEC2FleetProps.getTerminateInstancesWithExpiration()
- Parameters:
terminateInstancesWithExpiration
- Indicates whether running instances should be terminated when the EC2 Fleet expires.- Returns:
this
-
type
Sets the value ofCfnEC2FleetProps.getType()
- Parameters:
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 .
- Returns:
this
-
validFrom
Sets the value ofCfnEC2FleetProps.getValidFrom()
- Parameters:
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.- Returns:
this
-
validUntil
Sets the value ofCfnEC2FleetProps.getValidUntil()
- Parameters:
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.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnEC2FleetProps>
- Returns:
- a new instance of
CfnEC2FleetProps
- Throws:
NullPointerException
- if any required attribute was not provided
-