github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ec2/fleet.go (about)

     1  // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
     2  // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
     3  
     4  package ec2
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"errors"
    11  	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal"
    12  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    13  )
    14  
    15  // Provides a resource to manage EC2 Fleets.
    16  //
    17  // ## Example Usage
    18  //
    19  // <!--Start PulumiCodeChooser -->
    20  // ```go
    21  // package main
    22  //
    23  // import (
    24  //
    25  //	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
    26  //	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    27  //
    28  // )
    29  //
    30  //	func main() {
    31  //		pulumi.Run(func(ctx *pulumi.Context) error {
    32  //			_, err := ec2.NewFleet(ctx, "example", &ec2.FleetArgs{
    33  //				LaunchTemplateConfigs: ec2.FleetLaunchTemplateConfigArray{
    34  //					&ec2.FleetLaunchTemplateConfigArgs{
    35  //						LaunchTemplateSpecification: &ec2.FleetLaunchTemplateConfigLaunchTemplateSpecificationArgs{
    36  //							LaunchTemplateId: pulumi.Any(exampleAwsLaunchTemplate.Id),
    37  //							Version:          pulumi.Any(exampleAwsLaunchTemplate.LatestVersion),
    38  //						},
    39  //					},
    40  //				},
    41  //				TargetCapacitySpecification: &ec2.FleetTargetCapacitySpecificationArgs{
    42  //					DefaultTargetCapacityType: pulumi.String("spot"),
    43  //					TotalTargetCapacity:       pulumi.Int(5),
    44  //				},
    45  //			})
    46  //			if err != nil {
    47  //				return err
    48  //			}
    49  //			return nil
    50  //		})
    51  //	}
    52  //
    53  // ```
    54  // <!--End PulumiCodeChooser -->
    55  //
    56  // ## Import
    57  //
    58  // Using `pulumi import`, import `aws_ec2_fleet` using the Fleet identifier. For example:
    59  //
    60  // ```sh
    61  // $ pulumi import aws:ec2/fleet:Fleet example fleet-b9b55d27-c5fc-41ac-a6f3-48fcc91f080c
    62  // ```
    63  type Fleet struct {
    64  	pulumi.CustomResourceState
    65  
    66  	// The ARN of the fleet
    67  	Arn pulumi.StringOutput `pulumi:"arn"`
    68  	// Reserved.
    69  	Context pulumi.StringPtrOutput `pulumi:"context"`
    70  	// 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`.
    71  	ExcessCapacityTerminationPolicy pulumi.StringPtrOutput `pulumi:"excessCapacityTerminationPolicy"`
    72  	// Information about the instances that were launched by the fleet. Available only when `type` is set to `instant`.
    73  	FleetInstanceSets FleetFleetInstanceSetArrayOutput `pulumi:"fleetInstanceSets"`
    74  	// The state of the EC2 Fleet.
    75  	FleetState pulumi.StringOutput `pulumi:"fleetState"`
    76  	// The number of units fulfilled by this request compared to the set target capacity.
    77  	FulfilledCapacity pulumi.Float64Output `pulumi:"fulfilledCapacity"`
    78  	// The number of units fulfilled by this request compared to the set target On-Demand capacity.
    79  	FulfilledOnDemandCapacity pulumi.Float64Output `pulumi:"fulfilledOnDemandCapacity"`
    80  	// Nested argument containing EC2 Launch Template configurations. Defined below.
    81  	LaunchTemplateConfigs FleetLaunchTemplateConfigArrayOutput `pulumi:"launchTemplateConfigs"`
    82  	// Nested argument containing On-Demand configurations. Defined below.
    83  	OnDemandOptions FleetOnDemandOptionsPtrOutput `pulumi:"onDemandOptions"`
    84  	// Whether EC2 Fleet should replace unhealthy instances. Defaults to `false`. Supported only for fleets of type `maintain`.
    85  	ReplaceUnhealthyInstances pulumi.BoolPtrOutput `pulumi:"replaceUnhealthyInstances"`
    86  	// Nested argument containing Spot configurations. Defined below.
    87  	SpotOptions FleetSpotOptionsPtrOutput `pulumi:"spotOptions"`
    88  	// 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.
    89  	Tags pulumi.StringMapOutput `pulumi:"tags"`
    90  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
    91  	//
    92  	// Deprecated: Please use `tags` instead.
    93  	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
    94  	// Nested argument containing target capacity configurations. Defined below.
    95  	TargetCapacitySpecification FleetTargetCapacitySpecificationOutput `pulumi:"targetCapacitySpecification"`
    96  	// Whether to terminate instances for an EC2 Fleet if it is deleted successfully. Defaults to `false`.
    97  	TerminateInstances pulumi.BoolPtrOutput `pulumi:"terminateInstances"`
    98  	// Whether running instances should be terminated when the EC2 Fleet expires. Defaults to `false`.
    99  	TerminateInstancesWithExpiration pulumi.BoolPtrOutput `pulumi:"terminateInstancesWithExpiration"`
   100  	// 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`.
   101  	Type pulumi.StringPtrOutput `pulumi:"type"`
   102  	// 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.
   103  	ValidFrom pulumi.StringPtrOutput `pulumi:"validFrom"`
   104  	// 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.
   105  	ValidUntil pulumi.StringPtrOutput `pulumi:"validUntil"`
   106  }
   107  
   108  // NewFleet registers a new resource with the given unique name, arguments, and options.
   109  func NewFleet(ctx *pulumi.Context,
   110  	name string, args *FleetArgs, opts ...pulumi.ResourceOption) (*Fleet, error) {
   111  	if args == nil {
   112  		return nil, errors.New("missing one or more required arguments")
   113  	}
   114  
   115  	if args.LaunchTemplateConfigs == nil {
   116  		return nil, errors.New("invalid value for required argument 'LaunchTemplateConfigs'")
   117  	}
   118  	if args.TargetCapacitySpecification == nil {
   119  		return nil, errors.New("invalid value for required argument 'TargetCapacitySpecification'")
   120  	}
   121  	opts = internal.PkgResourceDefaultOpts(opts)
   122  	var resource Fleet
   123  	err := ctx.RegisterResource("aws:ec2/fleet:Fleet", name, args, &resource, opts...)
   124  	if err != nil {
   125  		return nil, err
   126  	}
   127  	return &resource, nil
   128  }
   129  
   130  // GetFleet gets an existing Fleet resource's state with the given name, ID, and optional
   131  // state properties that are used to uniquely qualify the lookup (nil if not required).
   132  func GetFleet(ctx *pulumi.Context,
   133  	name string, id pulumi.IDInput, state *FleetState, opts ...pulumi.ResourceOption) (*Fleet, error) {
   134  	var resource Fleet
   135  	err := ctx.ReadResource("aws:ec2/fleet:Fleet", name, id, state, &resource, opts...)
   136  	if err != nil {
   137  		return nil, err
   138  	}
   139  	return &resource, nil
   140  }
   141  
   142  // Input properties used for looking up and filtering Fleet resources.
   143  type fleetState struct {
   144  	// The ARN of the fleet
   145  	Arn *string `pulumi:"arn"`
   146  	// Reserved.
   147  	Context *string `pulumi:"context"`
   148  	// 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`.
   149  	ExcessCapacityTerminationPolicy *string `pulumi:"excessCapacityTerminationPolicy"`
   150  	// Information about the instances that were launched by the fleet. Available only when `type` is set to `instant`.
   151  	FleetInstanceSets []FleetFleetInstanceSet `pulumi:"fleetInstanceSets"`
   152  	// The state of the EC2 Fleet.
   153  	FleetState *string `pulumi:"fleetState"`
   154  	// The number of units fulfilled by this request compared to the set target capacity.
   155  	FulfilledCapacity *float64 `pulumi:"fulfilledCapacity"`
   156  	// The number of units fulfilled by this request compared to the set target On-Demand capacity.
   157  	FulfilledOnDemandCapacity *float64 `pulumi:"fulfilledOnDemandCapacity"`
   158  	// Nested argument containing EC2 Launch Template configurations. Defined below.
   159  	LaunchTemplateConfigs []FleetLaunchTemplateConfig `pulumi:"launchTemplateConfigs"`
   160  	// Nested argument containing On-Demand configurations. Defined below.
   161  	OnDemandOptions *FleetOnDemandOptions `pulumi:"onDemandOptions"`
   162  	// Whether EC2 Fleet should replace unhealthy instances. Defaults to `false`. Supported only for fleets of type `maintain`.
   163  	ReplaceUnhealthyInstances *bool `pulumi:"replaceUnhealthyInstances"`
   164  	// Nested argument containing Spot configurations. Defined below.
   165  	SpotOptions *FleetSpotOptions `pulumi:"spotOptions"`
   166  	// 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.
   167  	Tags map[string]string `pulumi:"tags"`
   168  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   169  	//
   170  	// Deprecated: Please use `tags` instead.
   171  	TagsAll map[string]string `pulumi:"tagsAll"`
   172  	// Nested argument containing target capacity configurations. Defined below.
   173  	TargetCapacitySpecification *FleetTargetCapacitySpecification `pulumi:"targetCapacitySpecification"`
   174  	// Whether to terminate instances for an EC2 Fleet if it is deleted successfully. Defaults to `false`.
   175  	TerminateInstances *bool `pulumi:"terminateInstances"`
   176  	// Whether running instances should be terminated when the EC2 Fleet expires. Defaults to `false`.
   177  	TerminateInstancesWithExpiration *bool `pulumi:"terminateInstancesWithExpiration"`
   178  	// 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`.
   179  	Type *string `pulumi:"type"`
   180  	// 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.
   181  	ValidFrom *string `pulumi:"validFrom"`
   182  	// 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.
   183  	ValidUntil *string `pulumi:"validUntil"`
   184  }
   185  
   186  type FleetState struct {
   187  	// The ARN of the fleet
   188  	Arn pulumi.StringPtrInput
   189  	// Reserved.
   190  	Context pulumi.StringPtrInput
   191  	// 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`.
   192  	ExcessCapacityTerminationPolicy pulumi.StringPtrInput
   193  	// Information about the instances that were launched by the fleet. Available only when `type` is set to `instant`.
   194  	FleetInstanceSets FleetFleetInstanceSetArrayInput
   195  	// The state of the EC2 Fleet.
   196  	FleetState pulumi.StringPtrInput
   197  	// The number of units fulfilled by this request compared to the set target capacity.
   198  	FulfilledCapacity pulumi.Float64PtrInput
   199  	// The number of units fulfilled by this request compared to the set target On-Demand capacity.
   200  	FulfilledOnDemandCapacity pulumi.Float64PtrInput
   201  	// Nested argument containing EC2 Launch Template configurations. Defined below.
   202  	LaunchTemplateConfigs FleetLaunchTemplateConfigArrayInput
   203  	// Nested argument containing On-Demand configurations. Defined below.
   204  	OnDemandOptions FleetOnDemandOptionsPtrInput
   205  	// Whether EC2 Fleet should replace unhealthy instances. Defaults to `false`. Supported only for fleets of type `maintain`.
   206  	ReplaceUnhealthyInstances pulumi.BoolPtrInput
   207  	// Nested argument containing Spot configurations. Defined below.
   208  	SpotOptions FleetSpotOptionsPtrInput
   209  	// 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.
   210  	Tags pulumi.StringMapInput
   211  	// A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   212  	//
   213  	// Deprecated: Please use `tags` instead.
   214  	TagsAll pulumi.StringMapInput
   215  	// Nested argument containing target capacity configurations. Defined below.
   216  	TargetCapacitySpecification FleetTargetCapacitySpecificationPtrInput
   217  	// Whether to terminate instances for an EC2 Fleet if it is deleted successfully. Defaults to `false`.
   218  	TerminateInstances pulumi.BoolPtrInput
   219  	// Whether running instances should be terminated when the EC2 Fleet expires. Defaults to `false`.
   220  	TerminateInstancesWithExpiration pulumi.BoolPtrInput
   221  	// 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`.
   222  	Type pulumi.StringPtrInput
   223  	// 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.
   224  	ValidFrom pulumi.StringPtrInput
   225  	// 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.
   226  	ValidUntil pulumi.StringPtrInput
   227  }
   228  
   229  func (FleetState) ElementType() reflect.Type {
   230  	return reflect.TypeOf((*fleetState)(nil)).Elem()
   231  }
   232  
   233  type fleetArgs struct {
   234  	// Reserved.
   235  	Context *string `pulumi:"context"`
   236  	// 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`.
   237  	ExcessCapacityTerminationPolicy *string `pulumi:"excessCapacityTerminationPolicy"`
   238  	// Information about the instances that were launched by the fleet. Available only when `type` is set to `instant`.
   239  	FleetInstanceSets []FleetFleetInstanceSet `pulumi:"fleetInstanceSets"`
   240  	// The state of the EC2 Fleet.
   241  	FleetState *string `pulumi:"fleetState"`
   242  	// The number of units fulfilled by this request compared to the set target capacity.
   243  	FulfilledCapacity *float64 `pulumi:"fulfilledCapacity"`
   244  	// The number of units fulfilled by this request compared to the set target On-Demand capacity.
   245  	FulfilledOnDemandCapacity *float64 `pulumi:"fulfilledOnDemandCapacity"`
   246  	// Nested argument containing EC2 Launch Template configurations. Defined below.
   247  	LaunchTemplateConfigs []FleetLaunchTemplateConfig `pulumi:"launchTemplateConfigs"`
   248  	// Nested argument containing On-Demand configurations. Defined below.
   249  	OnDemandOptions *FleetOnDemandOptions `pulumi:"onDemandOptions"`
   250  	// Whether EC2 Fleet should replace unhealthy instances. Defaults to `false`. Supported only for fleets of type `maintain`.
   251  	ReplaceUnhealthyInstances *bool `pulumi:"replaceUnhealthyInstances"`
   252  	// Nested argument containing Spot configurations. Defined below.
   253  	SpotOptions *FleetSpotOptions `pulumi:"spotOptions"`
   254  	// 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.
   255  	Tags map[string]string `pulumi:"tags"`
   256  	// Nested argument containing target capacity configurations. Defined below.
   257  	TargetCapacitySpecification FleetTargetCapacitySpecification `pulumi:"targetCapacitySpecification"`
   258  	// Whether to terminate instances for an EC2 Fleet if it is deleted successfully. Defaults to `false`.
   259  	TerminateInstances *bool `pulumi:"terminateInstances"`
   260  	// Whether running instances should be terminated when the EC2 Fleet expires. Defaults to `false`.
   261  	TerminateInstancesWithExpiration *bool `pulumi:"terminateInstancesWithExpiration"`
   262  	// 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`.
   263  	Type *string `pulumi:"type"`
   264  	// 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.
   265  	ValidFrom *string `pulumi:"validFrom"`
   266  	// 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.
   267  	ValidUntil *string `pulumi:"validUntil"`
   268  }
   269  
   270  // The set of arguments for constructing a Fleet resource.
   271  type FleetArgs struct {
   272  	// Reserved.
   273  	Context pulumi.StringPtrInput
   274  	// 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`.
   275  	ExcessCapacityTerminationPolicy pulumi.StringPtrInput
   276  	// Information about the instances that were launched by the fleet. Available only when `type` is set to `instant`.
   277  	FleetInstanceSets FleetFleetInstanceSetArrayInput
   278  	// The state of the EC2 Fleet.
   279  	FleetState pulumi.StringPtrInput
   280  	// The number of units fulfilled by this request compared to the set target capacity.
   281  	FulfilledCapacity pulumi.Float64PtrInput
   282  	// The number of units fulfilled by this request compared to the set target On-Demand capacity.
   283  	FulfilledOnDemandCapacity pulumi.Float64PtrInput
   284  	// Nested argument containing EC2 Launch Template configurations. Defined below.
   285  	LaunchTemplateConfigs FleetLaunchTemplateConfigArrayInput
   286  	// Nested argument containing On-Demand configurations. Defined below.
   287  	OnDemandOptions FleetOnDemandOptionsPtrInput
   288  	// Whether EC2 Fleet should replace unhealthy instances. Defaults to `false`. Supported only for fleets of type `maintain`.
   289  	ReplaceUnhealthyInstances pulumi.BoolPtrInput
   290  	// Nested argument containing Spot configurations. Defined below.
   291  	SpotOptions FleetSpotOptionsPtrInput
   292  	// 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.
   293  	Tags pulumi.StringMapInput
   294  	// Nested argument containing target capacity configurations. Defined below.
   295  	TargetCapacitySpecification FleetTargetCapacitySpecificationInput
   296  	// Whether to terminate instances for an EC2 Fleet if it is deleted successfully. Defaults to `false`.
   297  	TerminateInstances pulumi.BoolPtrInput
   298  	// Whether running instances should be terminated when the EC2 Fleet expires. Defaults to `false`.
   299  	TerminateInstancesWithExpiration pulumi.BoolPtrInput
   300  	// 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`.
   301  	Type pulumi.StringPtrInput
   302  	// 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.
   303  	ValidFrom pulumi.StringPtrInput
   304  	// 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.
   305  	ValidUntil pulumi.StringPtrInput
   306  }
   307  
   308  func (FleetArgs) ElementType() reflect.Type {
   309  	return reflect.TypeOf((*fleetArgs)(nil)).Elem()
   310  }
   311  
   312  type FleetInput interface {
   313  	pulumi.Input
   314  
   315  	ToFleetOutput() FleetOutput
   316  	ToFleetOutputWithContext(ctx context.Context) FleetOutput
   317  }
   318  
   319  func (*Fleet) ElementType() reflect.Type {
   320  	return reflect.TypeOf((**Fleet)(nil)).Elem()
   321  }
   322  
   323  func (i *Fleet) ToFleetOutput() FleetOutput {
   324  	return i.ToFleetOutputWithContext(context.Background())
   325  }
   326  
   327  func (i *Fleet) ToFleetOutputWithContext(ctx context.Context) FleetOutput {
   328  	return pulumi.ToOutputWithContext(ctx, i).(FleetOutput)
   329  }
   330  
   331  // FleetArrayInput is an input type that accepts FleetArray and FleetArrayOutput values.
   332  // You can construct a concrete instance of `FleetArrayInput` via:
   333  //
   334  //	FleetArray{ FleetArgs{...} }
   335  type FleetArrayInput interface {
   336  	pulumi.Input
   337  
   338  	ToFleetArrayOutput() FleetArrayOutput
   339  	ToFleetArrayOutputWithContext(context.Context) FleetArrayOutput
   340  }
   341  
   342  type FleetArray []FleetInput
   343  
   344  func (FleetArray) ElementType() reflect.Type {
   345  	return reflect.TypeOf((*[]*Fleet)(nil)).Elem()
   346  }
   347  
   348  func (i FleetArray) ToFleetArrayOutput() FleetArrayOutput {
   349  	return i.ToFleetArrayOutputWithContext(context.Background())
   350  }
   351  
   352  func (i FleetArray) ToFleetArrayOutputWithContext(ctx context.Context) FleetArrayOutput {
   353  	return pulumi.ToOutputWithContext(ctx, i).(FleetArrayOutput)
   354  }
   355  
   356  // FleetMapInput is an input type that accepts FleetMap and FleetMapOutput values.
   357  // You can construct a concrete instance of `FleetMapInput` via:
   358  //
   359  //	FleetMap{ "key": FleetArgs{...} }
   360  type FleetMapInput interface {
   361  	pulumi.Input
   362  
   363  	ToFleetMapOutput() FleetMapOutput
   364  	ToFleetMapOutputWithContext(context.Context) FleetMapOutput
   365  }
   366  
   367  type FleetMap map[string]FleetInput
   368  
   369  func (FleetMap) ElementType() reflect.Type {
   370  	return reflect.TypeOf((*map[string]*Fleet)(nil)).Elem()
   371  }
   372  
   373  func (i FleetMap) ToFleetMapOutput() FleetMapOutput {
   374  	return i.ToFleetMapOutputWithContext(context.Background())
   375  }
   376  
   377  func (i FleetMap) ToFleetMapOutputWithContext(ctx context.Context) FleetMapOutput {
   378  	return pulumi.ToOutputWithContext(ctx, i).(FleetMapOutput)
   379  }
   380  
   381  type FleetOutput struct{ *pulumi.OutputState }
   382  
   383  func (FleetOutput) ElementType() reflect.Type {
   384  	return reflect.TypeOf((**Fleet)(nil)).Elem()
   385  }
   386  
   387  func (o FleetOutput) ToFleetOutput() FleetOutput {
   388  	return o
   389  }
   390  
   391  func (o FleetOutput) ToFleetOutputWithContext(ctx context.Context) FleetOutput {
   392  	return o
   393  }
   394  
   395  // The ARN of the fleet
   396  func (o FleetOutput) Arn() pulumi.StringOutput {
   397  	return o.ApplyT(func(v *Fleet) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput)
   398  }
   399  
   400  // Reserved.
   401  func (o FleetOutput) Context() pulumi.StringPtrOutput {
   402  	return o.ApplyT(func(v *Fleet) pulumi.StringPtrOutput { return v.Context }).(pulumi.StringPtrOutput)
   403  }
   404  
   405  // 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`.
   406  func (o FleetOutput) ExcessCapacityTerminationPolicy() pulumi.StringPtrOutput {
   407  	return o.ApplyT(func(v *Fleet) pulumi.StringPtrOutput { return v.ExcessCapacityTerminationPolicy }).(pulumi.StringPtrOutput)
   408  }
   409  
   410  // Information about the instances that were launched by the fleet. Available only when `type` is set to `instant`.
   411  func (o FleetOutput) FleetInstanceSets() FleetFleetInstanceSetArrayOutput {
   412  	return o.ApplyT(func(v *Fleet) FleetFleetInstanceSetArrayOutput { return v.FleetInstanceSets }).(FleetFleetInstanceSetArrayOutput)
   413  }
   414  
   415  // The state of the EC2 Fleet.
   416  func (o FleetOutput) FleetState() pulumi.StringOutput {
   417  	return o.ApplyT(func(v *Fleet) pulumi.StringOutput { return v.FleetState }).(pulumi.StringOutput)
   418  }
   419  
   420  // The number of units fulfilled by this request compared to the set target capacity.
   421  func (o FleetOutput) FulfilledCapacity() pulumi.Float64Output {
   422  	return o.ApplyT(func(v *Fleet) pulumi.Float64Output { return v.FulfilledCapacity }).(pulumi.Float64Output)
   423  }
   424  
   425  // The number of units fulfilled by this request compared to the set target On-Demand capacity.
   426  func (o FleetOutput) FulfilledOnDemandCapacity() pulumi.Float64Output {
   427  	return o.ApplyT(func(v *Fleet) pulumi.Float64Output { return v.FulfilledOnDemandCapacity }).(pulumi.Float64Output)
   428  }
   429  
   430  // Nested argument containing EC2 Launch Template configurations. Defined below.
   431  func (o FleetOutput) LaunchTemplateConfigs() FleetLaunchTemplateConfigArrayOutput {
   432  	return o.ApplyT(func(v *Fleet) FleetLaunchTemplateConfigArrayOutput { return v.LaunchTemplateConfigs }).(FleetLaunchTemplateConfigArrayOutput)
   433  }
   434  
   435  // Nested argument containing On-Demand configurations. Defined below.
   436  func (o FleetOutput) OnDemandOptions() FleetOnDemandOptionsPtrOutput {
   437  	return o.ApplyT(func(v *Fleet) FleetOnDemandOptionsPtrOutput { return v.OnDemandOptions }).(FleetOnDemandOptionsPtrOutput)
   438  }
   439  
   440  // Whether EC2 Fleet should replace unhealthy instances. Defaults to `false`. Supported only for fleets of type `maintain`.
   441  func (o FleetOutput) ReplaceUnhealthyInstances() pulumi.BoolPtrOutput {
   442  	return o.ApplyT(func(v *Fleet) pulumi.BoolPtrOutput { return v.ReplaceUnhealthyInstances }).(pulumi.BoolPtrOutput)
   443  }
   444  
   445  // Nested argument containing Spot configurations. Defined below.
   446  func (o FleetOutput) SpotOptions() FleetSpotOptionsPtrOutput {
   447  	return o.ApplyT(func(v *Fleet) FleetSpotOptionsPtrOutput { return v.SpotOptions }).(FleetSpotOptionsPtrOutput)
   448  }
   449  
   450  // 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.
   451  func (o FleetOutput) Tags() pulumi.StringMapOutput {
   452  	return o.ApplyT(func(v *Fleet) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
   453  }
   454  
   455  // A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
   456  //
   457  // Deprecated: Please use `tags` instead.
   458  func (o FleetOutput) TagsAll() pulumi.StringMapOutput {
   459  	return o.ApplyT(func(v *Fleet) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput)
   460  }
   461  
   462  // Nested argument containing target capacity configurations. Defined below.
   463  func (o FleetOutput) TargetCapacitySpecification() FleetTargetCapacitySpecificationOutput {
   464  	return o.ApplyT(func(v *Fleet) FleetTargetCapacitySpecificationOutput { return v.TargetCapacitySpecification }).(FleetTargetCapacitySpecificationOutput)
   465  }
   466  
   467  // Whether to terminate instances for an EC2 Fleet if it is deleted successfully. Defaults to `false`.
   468  func (o FleetOutput) TerminateInstances() pulumi.BoolPtrOutput {
   469  	return o.ApplyT(func(v *Fleet) pulumi.BoolPtrOutput { return v.TerminateInstances }).(pulumi.BoolPtrOutput)
   470  }
   471  
   472  // Whether running instances should be terminated when the EC2 Fleet expires. Defaults to `false`.
   473  func (o FleetOutput) TerminateInstancesWithExpiration() pulumi.BoolPtrOutput {
   474  	return o.ApplyT(func(v *Fleet) pulumi.BoolPtrOutput { return v.TerminateInstancesWithExpiration }).(pulumi.BoolPtrOutput)
   475  }
   476  
   477  // 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`.
   478  func (o FleetOutput) Type() pulumi.StringPtrOutput {
   479  	return o.ApplyT(func(v *Fleet) pulumi.StringPtrOutput { return v.Type }).(pulumi.StringPtrOutput)
   480  }
   481  
   482  // 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.
   483  func (o FleetOutput) ValidFrom() pulumi.StringPtrOutput {
   484  	return o.ApplyT(func(v *Fleet) pulumi.StringPtrOutput { return v.ValidFrom }).(pulumi.StringPtrOutput)
   485  }
   486  
   487  // 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.
   488  func (o FleetOutput) ValidUntil() pulumi.StringPtrOutput {
   489  	return o.ApplyT(func(v *Fleet) pulumi.StringPtrOutput { return v.ValidUntil }).(pulumi.StringPtrOutput)
   490  }
   491  
   492  type FleetArrayOutput struct{ *pulumi.OutputState }
   493  
   494  func (FleetArrayOutput) ElementType() reflect.Type {
   495  	return reflect.TypeOf((*[]*Fleet)(nil)).Elem()
   496  }
   497  
   498  func (o FleetArrayOutput) ToFleetArrayOutput() FleetArrayOutput {
   499  	return o
   500  }
   501  
   502  func (o FleetArrayOutput) ToFleetArrayOutputWithContext(ctx context.Context) FleetArrayOutput {
   503  	return o
   504  }
   505  
   506  func (o FleetArrayOutput) Index(i pulumi.IntInput) FleetOutput {
   507  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Fleet {
   508  		return vs[0].([]*Fleet)[vs[1].(int)]
   509  	}).(FleetOutput)
   510  }
   511  
   512  type FleetMapOutput struct{ *pulumi.OutputState }
   513  
   514  func (FleetMapOutput) ElementType() reflect.Type {
   515  	return reflect.TypeOf((*map[string]*Fleet)(nil)).Elem()
   516  }
   517  
   518  func (o FleetMapOutput) ToFleetMapOutput() FleetMapOutput {
   519  	return o
   520  }
   521  
   522  func (o FleetMapOutput) ToFleetMapOutputWithContext(ctx context.Context) FleetMapOutput {
   523  	return o
   524  }
   525  
   526  func (o FleetMapOutput) MapIndex(k pulumi.StringInput) FleetOutput {
   527  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Fleet {
   528  		return vs[0].(map[string]*Fleet)[vs[1].(string)]
   529  	}).(FleetOutput)
   530  }
   531  
   532  func init() {
   533  	pulumi.RegisterInputType(reflect.TypeOf((*FleetInput)(nil)).Elem(), &Fleet{})
   534  	pulumi.RegisterInputType(reflect.TypeOf((*FleetArrayInput)(nil)).Elem(), FleetArray{})
   535  	pulumi.RegisterInputType(reflect.TypeOf((*FleetMapInput)(nil)).Elem(), FleetMap{})
   536  	pulumi.RegisterOutputType(FleetOutput{})
   537  	pulumi.RegisterOutputType(FleetArrayOutput{})
   538  	pulumi.RegisterOutputType(FleetMapOutput{})
   539  }