Fleet Args
data class FleetArgs(val context: Output<String>? = null, val excessCapacityTerminationPolicy: Output<String>? = null, val fleetInstanceSets: Output<List<FleetFleetInstanceSetArgs>>? = null, val fleetState: Output<String>? = null, val fulfilledCapacity: Output<Double>? = null, val fulfilledOnDemandCapacity: Output<Double>? = null, val launchTemplateConfigs: Output<List<FleetLaunchTemplateConfigArgs>>? = null, val onDemandOptions: Output<FleetOnDemandOptionsArgs>? = null, val replaceUnhealthyInstances: Output<Boolean>? = null, val spotOptions: Output<FleetSpotOptionsArgs>? = null, val tags: Output<Map<String, String>>? = null, val targetCapacitySpecification: Output<FleetTargetCapacitySpecificationArgs>? = null, val terminateInstances: Output<Boolean>? = null, val terminateInstancesWithExpiration: Output<Boolean>? = null, val type: Output<String>? = null, val validFrom: Output<String>? = null, val validUntil: Output<String>? = null) : ConvertibleToJava<FleetArgs>
Provides a resource to manage EC2 Fleets.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.ec2.Fleet("example", {
launchTemplateConfigs: [{
launchTemplateSpecification: {
launchTemplateId: exampleAwsLaunchTemplate.id,
version: exampleAwsLaunchTemplate.latestVersion,
},
}],
targetCapacitySpecification: {
defaultTargetCapacityType: "spot",
totalTargetCapacity: 5,
},
});Content copied to clipboard
import pulumi
import pulumi_aws as aws
example = aws.ec2.Fleet("example",
launch_template_configs=[aws.ec2.FleetLaunchTemplateConfigArgs(
launch_template_specification=aws.ec2.FleetLaunchTemplateConfigLaunchTemplateSpecificationArgs(
launch_template_id=example_aws_launch_template["id"],
version=example_aws_launch_template["latestVersion"],
),
)],
target_capacity_specification=aws.ec2.FleetTargetCapacitySpecificationArgs(
default_target_capacity_type="spot",
total_target_capacity=5,
))Content copied to clipboard
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Ec2.Fleet("example", new()
{
LaunchTemplateConfigs = new[]
{
new Aws.Ec2.Inputs.FleetLaunchTemplateConfigArgs
{
LaunchTemplateSpecification = new Aws.Ec2.Inputs.FleetLaunchTemplateConfigLaunchTemplateSpecificationArgs
{
LaunchTemplateId = exampleAwsLaunchTemplate.Id,
Version = exampleAwsLaunchTemplate.LatestVersion,
},
},
},
TargetCapacitySpecification = new Aws.Ec2.Inputs.FleetTargetCapacitySpecificationArgs
{
DefaultTargetCapacityType = "spot",
TotalTargetCapacity = 5,
},
});
});Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ec2.NewFleet(ctx, "example", &ec2.FleetArgs{
LaunchTemplateConfigs: ec2.FleetLaunchTemplateConfigArray{
&ec2.FleetLaunchTemplateConfigArgs{
LaunchTemplateSpecification: &ec2.FleetLaunchTemplateConfigLaunchTemplateSpecificationArgs{
LaunchTemplateId: pulumi.Any(exampleAwsLaunchTemplate.Id),
Version: pulumi.Any(exampleAwsLaunchTemplate.LatestVersion),
},
},
},
TargetCapacitySpecification: &ec2.FleetTargetCapacitySpecificationArgs{
DefaultTargetCapacityType: pulumi.String("spot"),
TotalTargetCapacity: pulumi.Int(5),
},
})
if err != nil {
return err
}
return nil
})
}Content copied to clipboard
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()
.launchTemplateConfigs(FleetLaunchTemplateConfigArgs.builder()
.launchTemplateSpecification(FleetLaunchTemplateConfigLaunchTemplateSpecificationArgs.builder()
.launchTemplateId(exampleAwsLaunchTemplate.id())
.version(exampleAwsLaunchTemplate.latestVersion())
.build())
.build())
.targetCapacitySpecification(FleetTargetCapacitySpecificationArgs.builder()
.defaultTargetCapacityType("spot")
.totalTargetCapacity(5)
.build())
.build());
}
}Content copied to clipboard
resources:
example:
type: aws:ec2:Fleet
properties:
launchTemplateConfigs:
- launchTemplateSpecification:
launchTemplateId: ${exampleAwsLaunchTemplate.id}
version: ${exampleAwsLaunchTemplate.latestVersion}
targetCapacitySpecification:
defaultTargetCapacityType: spot
totalTargetCapacity: 5Content copied to clipboard
Import
Using pulumi import, import aws_ec2_fleet using the Fleet identifier. For example:
$ pulumi import aws:ec2/fleet:Fleet example fleet-b9b55d27-c5fc-41ac-a6f3-48fcc91f080cContent copied to clipboard
Constructors
Link copied to clipboard
fun FleetArgs(context: Output<String>? = null, excessCapacityTerminationPolicy: Output<String>? = null, fleetInstanceSets: Output<List<FleetFleetInstanceSetArgs>>? = null, fleetState: Output<String>? = null, fulfilledCapacity: Output<Double>? = null, fulfilledOnDemandCapacity: Output<Double>? = null, launchTemplateConfigs: Output<List<FleetLaunchTemplateConfigArgs>>? = null, onDemandOptions: Output<FleetOnDemandOptionsArgs>? = null, replaceUnhealthyInstances: Output<Boolean>? = null, spotOptions: Output<FleetSpotOptionsArgs>? = null, tags: Output<Map<String, String>>? = null, targetCapacitySpecification: Output<FleetTargetCapacitySpecificationArgs>? = null, terminateInstances: Output<Boolean>? = null, terminateInstancesWithExpiration: Output<Boolean>? = null, type: Output<String>? = null, validFrom: Output<String>? = null, validUntil: Output<String>? = null)
Functions
Properties
Link copied to clipboard
Link copied to clipboard