Fleet

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.FleetLaunchTemplateConfigArgs;
import com.pulumi.aws.ec2.inputs.FleetLaunchTemplateConfigLaunchTemplateSpecificationArgs;
import com.pulumi.aws.ec2.inputs.FleetTargetCapacitySpecificationArgs;
import java.util.List;
import java.util.ArrayList;
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()
.launchTemplateConfig(FleetLaunchTemplateConfigArgs.builder()
.launchTemplateSpecification(FleetLaunchTemplateConfigLaunchTemplateSpecificationArgs.builder()
.launchTemplateId(aws_launch_template.example().id())
.version(aws_launch_template.example().latest_version())
.build())
.build())
.targetCapacitySpecification(FleetTargetCapacitySpecificationArgs.builder()
.defaultTargetCapacityType("spot")
.totalTargetCapacity(5)
.build())
.build());
}
}

Import

aws_ec2_fleet can be imported by using the Fleet identifier, e.g.,

$ pulumi import aws:ec2/fleet:Fleet example fleet-b9b55d27-c5fc-41ac-a6f3-48fcc91f080c

Properties

Link copied to clipboard
val arn: Output<String>

The ARN of the fleet

Link copied to clipboard
val context: Output<String>?

Reserved.

Link copied to clipboard

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.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

Nested argument containing EC2 Launch Template configurations. Defined below.

Link copied to clipboard

Nested argument containing On-Demand configurations. Defined below.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Whether EC2 Fleet should replace unhealthy instances. Defaults to false.

Link copied to clipboard

Nested argument containing Spot configurations. Defined below.

Link copied to clipboard
val tags: Output<Map<String, String>>?

Map of Fleet tags. To tag instances at launch, specify the tags in the Launch Template. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Link copied to clipboard
val tagsAll: Output<Map<String, String>>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Link copied to clipboard

Nested argument containing target capacity configurations. Defined below.

Link copied to clipboard

Whether to terminate instances for an EC2 Fleet if it is deleted successfully. Defaults to false.

Link copied to clipboard

Whether running instances should be terminated when the EC2 Fleet expires. Defaults to false.

Link copied to clipboard
val type: Output<String>?

The type of request. Indicates whether the EC2 Fleet only requests the target capacity, or also attempts to maintain it. Valid values: maintain, request. Defaults to maintain.

Link copied to clipboard
val urn: Output<String>