Class Fleet


  • public class Fleet
    extends com.pulumi.resources.CustomResource
    Provides a resource to manage EC2 Fleets. ## Example Usage
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.ec2.Fleet;
     import com.pulumi.aws.ec2.FleetArgs;
     import com.pulumi.aws.ec2.inputs.FleetTargetCapacitySpecificationArgs;
     import com.pulumi.aws.ec2.inputs.FleetLaunchTemplateConfigArgs;
     import com.pulumi.aws.ec2.inputs.FleetLaunchTemplateConfigLaunchTemplateSpecificationArgs;
     import java.util.ArrayList;
     import java.util.Arrays;
     import java.util.Map;
     import java.io.File;
     import java.nio.file.Files;
     import java.nio.file.Paths;
     
     public class App {
         public static void main(String[] args) {
             Pulumi.run(App::stack);
         }
     
         public static void stack(Context ctx) {
             var example = new Fleet("example", FleetArgs.builder()
                 .targetCapacitySpecification(FleetTargetCapacitySpecificationArgs.builder()
                     .defaultTargetCapacityType("spot")
                     .totalTargetCapacity(5)
                     .build())
                 .launchTemplateConfigs(FleetLaunchTemplateConfigArgs.builder()
                     .launchTemplateSpecification(FleetLaunchTemplateConfigLaunchTemplateSpecificationArgs.builder()
                         .launchTemplateId(exampleAwsLaunchTemplate.id())
                         .version(exampleAwsLaunchTemplate.latestVersion())
                         .build())
                     .build())
                 .build());
     
         }
     }
     
     
    ## Import Using `pulumi import`, import `aws.ec2.Fleet` using the Fleet identifier. For example: ```sh $ pulumi import aws:ec2/fleet:Fleet example fleet-b9b55d27-c5fc-41ac-a6f3-48fcc91f080c ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Constructor Summary

      Constructors 
      Constructor Description
      Fleet​(java.lang.String name)  
      Fleet​(java.lang.String name, FleetArgs args)  
      Fleet​(java.lang.String name, FleetArgs args, com.pulumi.resources.CustomResourceOptions options)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.lang.String> arn()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> context()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> excessCapacityTerminationPolicy()  
      com.pulumi.core.Output<java.util.List<FleetFleetInstanceSet>> fleetInstanceSets()  
      com.pulumi.core.Output<java.lang.String> fleetState()  
      com.pulumi.core.Output<java.lang.Double> fulfilledCapacity()  
      com.pulumi.core.Output<java.lang.Double> fulfilledOnDemandCapacity()  
      static Fleet get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, FleetState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.util.List<FleetLaunchTemplateConfig>> launchTemplateConfigs()  
      com.pulumi.core.Output<java.util.Optional<FleetOnDemandOptions>> onDemandOptions()  
      com.pulumi.core.Output<java.lang.String> region()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> replaceUnhealthyInstances()  
      com.pulumi.core.Output<java.util.Optional<FleetSpotOptions>> spotOptions()  
      com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()  
      com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()  
      com.pulumi.core.Output<FleetTargetCapacitySpecification> targetCapacitySpecification()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> terminateInstances()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> terminateInstancesWithExpiration()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> type()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> validFrom()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> validUntil()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Fleet

        public Fleet​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • Fleet

        public Fleet​(java.lang.String name,
                     FleetArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • Fleet

        public Fleet​(java.lang.String name,
                     FleetArgs args,
                     @Nullable
                     com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • arn

        public com.pulumi.core.Output<java.lang.String> arn()
        Returns:
        The ARN of the fleet
      • context

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> context()
        Returns:
        Reserved.
      • excessCapacityTerminationPolicy

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> excessCapacityTerminationPolicy()
        Returns:
        Whether running instances should be terminated if the total target capacity of the EC2 Fleet is decreased below the current size of the EC2. Valid values: `no-termination`, `termination`. Defaults to `termination`. Supported only for fleets of type `maintain`.
      • fleetInstanceSets

        public com.pulumi.core.Output<java.util.List<FleetFleetInstanceSet>> fleetInstanceSets()
        Returns:
        Information about the instances that were launched by the fleet. Available only when `type` is set to `instant`.
      • fleetState

        public com.pulumi.core.Output<java.lang.String> fleetState()
        Returns:
        The state of the EC2 Fleet.
      • fulfilledCapacity

        public com.pulumi.core.Output<java.lang.Double> fulfilledCapacity()
        Returns:
        The number of units fulfilled by this request compared to the set target capacity.
      • fulfilledOnDemandCapacity

        public com.pulumi.core.Output<java.lang.Double> fulfilledOnDemandCapacity()
        Returns:
        The number of units fulfilled by this request compared to the set target On-Demand capacity.
      • launchTemplateConfigs

        public com.pulumi.core.Output<java.util.List<FleetLaunchTemplateConfig>> launchTemplateConfigs()
        Returns:
        Nested argument containing EC2 Launch Template configurations. Defined below.
      • onDemandOptions

        public com.pulumi.core.Output<java.util.Optional<FleetOnDemandOptions>> onDemandOptions()
        Returns:
        Nested argument containing On-Demand configurations. Defined below.
      • region

        public com.pulumi.core.Output<java.lang.String> region()
        Returns:
        Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
      • replaceUnhealthyInstances

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> replaceUnhealthyInstances()
        Returns:
        Whether EC2 Fleet should replace unhealthy instances. Defaults to `false`. Supported only for fleets of type `maintain`.
      • spotOptions

        public com.pulumi.core.Output<java.util.Optional<FleetSpotOptions>> spotOptions()
        Returns:
        Nested argument containing Spot configurations. Defined below.
      • tags

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()
        Returns:
        Map of Fleet tags. To tag instances at launch, specify the tags in the Launch Template. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
      • tagsAll

        public com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()
        Returns:
        A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
      • targetCapacitySpecification

        public com.pulumi.core.Output<FleetTargetCapacitySpecification> targetCapacitySpecification()
        Returns:
        Nested argument containing target capacity configurations. Defined below.
      • terminateInstances

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> terminateInstances()
        Returns:
        Whether to terminate instances for an EC2 Fleet if it is deleted successfully. Defaults to `false`.
      • terminateInstancesWithExpiration

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> terminateInstancesWithExpiration()
        Returns:
        Whether running instances should be terminated when the EC2 Fleet expires. Defaults to `false`.
      • type

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> type()
        Returns:
        The type of request. Indicates whether the EC2 Fleet only requests the target capacity, or also attempts to maintain it. Valid values: `maintain`, `request`, `instant`. Defaults to `maintain`.
      • validFrom

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> validFrom()
        Returns:
        The start date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). The default is to start fulfilling the request immediately.
      • validUntil

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> validUntil()
        Returns:
        The end date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). 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.
      • get

        public static Fleet get​(java.lang.String name,
                                com.pulumi.core.Output<java.lang.String> id,
                                @Nullable
                                FleetState state,
                                @Nullable
                                com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.