AWS Classic

v5.16.0 published on Saturday, Sep 24, 2022 by Pulumi

ClusterCapacityProviders

Import

ECS cluster capacity providers can be imported using the cluster_name attribute. For example

 $ pulumi import aws:ecs/clusterCapacityProviders:ClusterCapacityProviders example my-cluster

Example Usage

using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var exampleCluster = new Aws.Ecs.Cluster("exampleCluster");

    var exampleClusterCapacityProviders = new Aws.Ecs.ClusterCapacityProviders("exampleClusterCapacityProviders", new()
    {
        ClusterName = exampleCluster.Name,
        CapacityProviders = new[]
        {
            "FARGATE",
        },
        DefaultCapacityProviderStrategies = new[]
        {
            new Aws.Ecs.Inputs.ClusterCapacityProvidersDefaultCapacityProviderStrategyArgs
            {
                Base = 1,
                Weight = 100,
                CapacityProvider = "FARGATE",
            },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/ecs"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleCluster, err := ecs.NewCluster(ctx, "exampleCluster", nil)
		if err != nil {
			return err
		}
		_, err = ecs.NewClusterCapacityProviders(ctx, "exampleClusterCapacityProviders", &ecs.ClusterCapacityProvidersArgs{
			ClusterName: exampleCluster.Name,
			CapacityProviders: pulumi.StringArray{
				pulumi.String("FARGATE"),
			},
			DefaultCapacityProviderStrategies: ecs.ClusterCapacityProvidersDefaultCapacityProviderStrategyArray{
				&ecs.ClusterCapacityProvidersDefaultCapacityProviderStrategyArgs{
					Base:             pulumi.Int(1),
					Weight:           pulumi.Int(100),
					CapacityProvider: pulumi.String("FARGATE"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.ecs.Cluster;
import com.pulumi.aws.ecs.ClusterCapacityProviders;
import com.pulumi.aws.ecs.ClusterCapacityProvidersArgs;
import com.pulumi.aws.ecs.inputs.ClusterCapacityProvidersDefaultCapacityProviderStrategyArgs;
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 exampleCluster = new Cluster("exampleCluster");

        var exampleClusterCapacityProviders = new ClusterCapacityProviders("exampleClusterCapacityProviders", ClusterCapacityProvidersArgs.builder()        
            .clusterName(exampleCluster.name())
            .capacityProviders("FARGATE")
            .defaultCapacityProviderStrategies(ClusterCapacityProvidersDefaultCapacityProviderStrategyArgs.builder()
                .base(1)
                .weight(100)
                .capacityProvider("FARGATE")
                .build())
            .build());

    }
}
import pulumi
import pulumi_aws as aws

example_cluster = aws.ecs.Cluster("exampleCluster")
example_cluster_capacity_providers = aws.ecs.ClusterCapacityProviders("exampleClusterCapacityProviders",
    cluster_name=example_cluster.name,
    capacity_providers=["FARGATE"],
    default_capacity_provider_strategies=[aws.ecs.ClusterCapacityProvidersDefaultCapacityProviderStrategyArgs(
        base=1,
        weight=100,
        capacity_provider="FARGATE",
    )])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const exampleCluster = new aws.ecs.Cluster("exampleCluster", {});
const exampleClusterCapacityProviders = new aws.ecs.ClusterCapacityProviders("exampleClusterCapacityProviders", {
    clusterName: exampleCluster.name,
    capacityProviders: ["FARGATE"],
    defaultCapacityProviderStrategies: [{
        base: 1,
        weight: 100,
        capacityProvider: "FARGATE",
    }],
});
resources:
  exampleCluster:
    type: aws:ecs:Cluster
  exampleClusterCapacityProviders:
    type: aws:ecs:ClusterCapacityProviders
    properties:
      clusterName: ${exampleCluster.name}
      capacityProviders:
        - FARGATE
      defaultCapacityProviderStrategies:
        - base: 1
          weight: 100
          capacityProvider: FARGATE

Create a ClusterCapacityProviders Resource

new ClusterCapacityProviders(name: string, args: ClusterCapacityProvidersArgs, opts?: CustomResourceOptions);
@overload
def ClusterCapacityProviders(resource_name: str,
                             opts: Optional[ResourceOptions] = None,
                             capacity_providers: Optional[Sequence[str]] = None,
                             cluster_name: Optional[str] = None,
                             default_capacity_provider_strategies: Optional[Sequence[ClusterCapacityProvidersDefaultCapacityProviderStrategyArgs]] = None)
@overload
def ClusterCapacityProviders(resource_name: str,
                             args: ClusterCapacityProvidersArgs,
                             opts: Optional[ResourceOptions] = None)
func NewClusterCapacityProviders(ctx *Context, name string, args ClusterCapacityProvidersArgs, opts ...ResourceOption) (*ClusterCapacityProviders, error)
public ClusterCapacityProviders(string name, ClusterCapacityProvidersArgs args, CustomResourceOptions? opts = null)
public ClusterCapacityProviders(String name, ClusterCapacityProvidersArgs args)
public ClusterCapacityProviders(String name, ClusterCapacityProvidersArgs args, CustomResourceOptions options)
type: aws:ecs:ClusterCapacityProviders
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args ClusterCapacityProvidersArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args ClusterCapacityProvidersArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args ClusterCapacityProvidersArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ClusterCapacityProvidersArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args ClusterCapacityProvidersArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

ClusterCapacityProviders Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The ClusterCapacityProviders resource accepts the following input properties:

ClusterName string

Name of the ECS cluster to manage capacity providers for.

CapacityProviders List<string>

Set of names of one or more capacity providers to associate with the cluster. Valid values also include FARGATE and FARGATE_SPOT.

DefaultCapacityProviderStrategies List<ClusterCapacityProvidersDefaultCapacityProviderStrategyArgs>

Set of capacity provider strategies to use by default for the cluster. Detailed below.

ClusterName string

Name of the ECS cluster to manage capacity providers for.

CapacityProviders []string

Set of names of one or more capacity providers to associate with the cluster. Valid values also include FARGATE and FARGATE_SPOT.

DefaultCapacityProviderStrategies []ClusterCapacityProvidersDefaultCapacityProviderStrategyArgs

Set of capacity provider strategies to use by default for the cluster. Detailed below.

clusterName String

Name of the ECS cluster to manage capacity providers for.

capacityProviders List<String>

Set of names of one or more capacity providers to associate with the cluster. Valid values also include FARGATE and FARGATE_SPOT.

defaultCapacityProviderStrategies List<ClusterCapacityProvidersDefaultCapacityProviderStrategyArgs>

Set of capacity provider strategies to use by default for the cluster. Detailed below.

clusterName string

Name of the ECS cluster to manage capacity providers for.

capacityProviders string[]

Set of names of one or more capacity providers to associate with the cluster. Valid values also include FARGATE and FARGATE_SPOT.

defaultCapacityProviderStrategies ClusterCapacityProvidersDefaultCapacityProviderStrategyArgs[]

Set of capacity provider strategies to use by default for the cluster. Detailed below.

cluster_name str

Name of the ECS cluster to manage capacity providers for.

capacity_providers Sequence[str]

Set of names of one or more capacity providers to associate with the cluster. Valid values also include FARGATE and FARGATE_SPOT.

default_capacity_provider_strategies Sequence[ClusterCapacityProvidersDefaultCapacityProviderStrategyArgs]

Set of capacity provider strategies to use by default for the cluster. Detailed below.

clusterName String

Name of the ECS cluster to manage capacity providers for.

capacityProviders List<String>

Set of names of one or more capacity providers to associate with the cluster. Valid values also include FARGATE and FARGATE_SPOT.

defaultCapacityProviderStrategies List<Property Map>

Set of capacity provider strategies to use by default for the cluster. Detailed below.

Outputs

All input properties are implicitly available as output properties. Additionally, the ClusterCapacityProviders resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up an Existing ClusterCapacityProviders Resource

Get an existing ClusterCapacityProviders resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ClusterCapacityProvidersState, opts?: CustomResourceOptions): ClusterCapacityProviders
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        capacity_providers: Optional[Sequence[str]] = None,
        cluster_name: Optional[str] = None,
        default_capacity_provider_strategies: Optional[Sequence[ClusterCapacityProvidersDefaultCapacityProviderStrategyArgs]] = None) -> ClusterCapacityProviders
func GetClusterCapacityProviders(ctx *Context, name string, id IDInput, state *ClusterCapacityProvidersState, opts ...ResourceOption) (*ClusterCapacityProviders, error)
public static ClusterCapacityProviders Get(string name, Input<string> id, ClusterCapacityProvidersState? state, CustomResourceOptions? opts = null)
public static ClusterCapacityProviders get(String name, Output<String> id, ClusterCapacityProvidersState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
CapacityProviders List<string>

Set of names of one or more capacity providers to associate with the cluster. Valid values also include FARGATE and FARGATE_SPOT.

ClusterName string

Name of the ECS cluster to manage capacity providers for.

DefaultCapacityProviderStrategies List<ClusterCapacityProvidersDefaultCapacityProviderStrategyArgs>

Set of capacity provider strategies to use by default for the cluster. Detailed below.

CapacityProviders []string

Set of names of one or more capacity providers to associate with the cluster. Valid values also include FARGATE and FARGATE_SPOT.

ClusterName string

Name of the ECS cluster to manage capacity providers for.

DefaultCapacityProviderStrategies []ClusterCapacityProvidersDefaultCapacityProviderStrategyArgs

Set of capacity provider strategies to use by default for the cluster. Detailed below.

capacityProviders List<String>

Set of names of one or more capacity providers to associate with the cluster. Valid values also include FARGATE and FARGATE_SPOT.

clusterName String

Name of the ECS cluster to manage capacity providers for.

defaultCapacityProviderStrategies List<ClusterCapacityProvidersDefaultCapacityProviderStrategyArgs>

Set of capacity provider strategies to use by default for the cluster. Detailed below.

capacityProviders string[]

Set of names of one or more capacity providers to associate with the cluster. Valid values also include FARGATE and FARGATE_SPOT.

clusterName string

Name of the ECS cluster to manage capacity providers for.

defaultCapacityProviderStrategies ClusterCapacityProvidersDefaultCapacityProviderStrategyArgs[]

Set of capacity provider strategies to use by default for the cluster. Detailed below.

capacity_providers Sequence[str]

Set of names of one or more capacity providers to associate with the cluster. Valid values also include FARGATE and FARGATE_SPOT.

cluster_name str

Name of the ECS cluster to manage capacity providers for.

default_capacity_provider_strategies Sequence[ClusterCapacityProvidersDefaultCapacityProviderStrategyArgs]

Set of capacity provider strategies to use by default for the cluster. Detailed below.

capacityProviders List<String>

Set of names of one or more capacity providers to associate with the cluster. Valid values also include FARGATE and FARGATE_SPOT.

clusterName String

Name of the ECS cluster to manage capacity providers for.

defaultCapacityProviderStrategies List<Property Map>

Set of capacity provider strategies to use by default for the cluster. Detailed below.

Supporting Types

ClusterCapacityProvidersDefaultCapacityProviderStrategy

CapacityProvider string

Name of the capacity provider.

Base int

The number of tasks, at a minimum, to run on the specified capacity provider. Only one capacity provider in a capacity provider strategy can have a base defined. Defaults to 0.

Weight int

The relative percentage of the total number of launched tasks that should use the specified capacity provider. The weight value is taken into consideration after the base count of tasks has been satisfied. Defaults to 0.

CapacityProvider string

Name of the capacity provider.

Base int

The number of tasks, at a minimum, to run on the specified capacity provider. Only one capacity provider in a capacity provider strategy can have a base defined. Defaults to 0.

Weight int

The relative percentage of the total number of launched tasks that should use the specified capacity provider. The weight value is taken into consideration after the base count of tasks has been satisfied. Defaults to 0.

capacityProvider String

Name of the capacity provider.

base Integer

The number of tasks, at a minimum, to run on the specified capacity provider. Only one capacity provider in a capacity provider strategy can have a base defined. Defaults to 0.

weight Integer

The relative percentage of the total number of launched tasks that should use the specified capacity provider. The weight value is taken into consideration after the base count of tasks has been satisfied. Defaults to 0.

capacityProvider string

Name of the capacity provider.

base number

The number of tasks, at a minimum, to run on the specified capacity provider. Only one capacity provider in a capacity provider strategy can have a base defined. Defaults to 0.

weight number

The relative percentage of the total number of launched tasks that should use the specified capacity provider. The weight value is taken into consideration after the base count of tasks has been satisfied. Defaults to 0.

capacity_provider str

Name of the capacity provider.

base int

The number of tasks, at a minimum, to run on the specified capacity provider. Only one capacity provider in a capacity provider strategy can have a base defined. Defaults to 0.

weight int

The relative percentage of the total number of launched tasks that should use the specified capacity provider. The weight value is taken into consideration after the base count of tasks has been satisfied. Defaults to 0.

capacityProvider String

Name of the capacity provider.

base Number

The number of tasks, at a minimum, to run on the specified capacity provider. Only one capacity provider in a capacity provider strategy can have a base defined. Defaults to 0.

weight Number

The relative percentage of the total number of launched tasks that should use the specified capacity provider. The weight value is taken into consideration after the base count of tasks has been satisfied. Defaults to 0.

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.