Class Fleet
Provides a resource to manage EC2 Fleets.
Example Usage
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var example = new Aws.Ec2.Fleet("example", new Aws.Ec2.FleetArgs
{
LaunchTemplateConfig = new Aws.Ec2.Inputs.FleetLaunchTemplateConfigArgs
{
LaunchTemplateSpecification = new Aws.Ec2.Inputs.FleetLaunchTemplateConfigLaunchTemplateSpecificationArgs
{
LaunchTemplateId = aws_launch_template.Example.Id,
Version = aws_launch_template.Example.Latest_version,
},
},
TargetCapacitySpecification = new Aws.Ec2.Inputs.FleetTargetCapacitySpecificationArgs
{
DefaultTargetCapacityType = "spot",
TotalTargetCapacity = 5,
},
});
}
}
Inherited Members
Namespace: Pulumi.Aws.Ec2
Assembly: Pulumi.Aws.dll
Syntax
public class Fleet : CustomResource
Constructors
View SourceFleet(String, FleetArgs, CustomResourceOptions)
Create a Fleet resource with the given unique name, arguments, and options.
Declaration
public Fleet(string name, FleetArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| FleetArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceExcessCapacityTerminationPolicy
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.
Declaration
public Output<string> ExcessCapacityTerminationPolicy { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
LaunchTemplateConfig
Nested argument containing EC2 Launch Template configurations. Defined below.
Declaration
public Output<FleetLaunchTemplateConfig> LaunchTemplateConfig { get; }
Property Value
| Type | Description |
|---|---|
| Output<FleetLaunchTemplateConfig> |
OnDemandOptions
Nested argument containing On-Demand configurations. Defined below.
Declaration
public Output<FleetOnDemandOptions> OnDemandOptions { get; }
Property Value
| Type | Description |
|---|---|
| Output<FleetOnDemandOptions> |
ReplaceUnhealthyInstances
Whether EC2 Fleet should replace unhealthy instances. Defaults to false.
Declaration
public Output<bool?> ReplaceUnhealthyInstances { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
SpotOptions
Nested argument containing Spot configurations. Defined below.
Declaration
public Output<FleetSpotOptions> SpotOptions { get; }
Property Value
| Type | Description |
|---|---|
| Output<FleetSpotOptions> |
Tags
Map of Fleet tags. To tag instances at launch, specify the tags in the Launch Template.
Declaration
public Output<ImmutableDictionary<string, object>> Tags { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.Object>> |
TargetCapacitySpecification
Nested argument containing target capacity configurations. Defined below.
Declaration
public Output<FleetTargetCapacitySpecification> TargetCapacitySpecification { get; }
Property Value
| Type | Description |
|---|---|
| Output<FleetTargetCapacitySpecification> |
TerminateInstances
Whether to terminate instances for an EC2 Fleet if it is deleted successfully. Defaults to false.
Declaration
public Output<bool?> TerminateInstances { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
TerminateInstancesWithExpiration
Whether running instances should be terminated when the EC2 Fleet expires. Defaults to false.
Declaration
public Output<bool?> TerminateInstancesWithExpiration { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
Type
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.
Declaration
public Output<string> Type { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, FleetState, CustomResourceOptions)
Get an existing Fleet resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static Fleet Get(string name, Input<string> id, FleetState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| FleetState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| Fleet |