Class CfnEC2Fleet.Builder

java.lang.Object
software.amazon.awscdk.services.ec2.CfnEC2Fleet.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<CfnEC2Fleet>
Enclosing class:
CfnEC2Fleet

@Stability(Stable) public static final class CfnEC2Fleet.Builder extends Object implements software.amazon.jsii.Builder<CfnEC2Fleet>
A fluent builder for CfnEC2Fleet.
  • Method Details

    • create

      @Stability(Stable) public static CfnEC2Fleet.Builder create(Construct scope, String id)
      Parameters:
      scope -
      • scope in which this resource is defined.
      This parameter is required.
      id -
      • scoped id of the resource.
      This parameter is required.
      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

      @Stability(Stable) public CfnEC2Fleet.Builder context(String 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

      @Stability(Stable) public CfnEC2Fleet.Builder onDemandOptions(IResolvable 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

      @Stability(Stable) public CfnEC2Fleet.Builder spotOptions(IResolvable 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

      @Stability(Stable) public CfnEC2Fleet.Builder tagSpecifications(IResolvable 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 of fleet to tag the fleet or instance to tag the instances at launch.

      If the fleet type is maintain or request , specify a resource type of fleet to tag the fleet. You cannot specify a resource type of instance . 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 of fleet to tag the fleet or instance to tag the instances at launch.

      If the fleet type is maintain or request , specify a resource type of fleet to tag the fleet. You cannot specify a resource type of instance . 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

      @Stability(Stable) public CfnEC2Fleet.Builder type(String type)
      The fleet type. The default value is maintain .

      • 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 is maintain . This parameter is required.
      Returns:
      this
    • validFrom

      @Stability(Stable) public CfnEC2Fleet.Builder validFrom(String 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

      @Stability(Stable) public CfnEC2Fleet.Builder validUntil(String 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

      @Stability(Stable) public CfnEC2Fleet build()
      Specified by:
      build in interface software.amazon.jsii.Builder<CfnEC2Fleet>
      Returns:
      a newly built instance of CfnEC2Fleet.