1. Packages
  2. AWS Cloud Control
  3. API Docs
  4. ecs
  5. ClusterCapacityProviderAssociations

We recommend new projects start with resources from the AWS provider.

AWS Cloud Control v1.9.0 published on Monday, Nov 18, 2024 by Pulumi

aws-native.ecs.ClusterCapacityProviderAssociations

Explore with Pulumi AI

aws-native logo

We recommend new projects start with resources from the AWS provider.

AWS Cloud Control v1.9.0 published on Monday, Nov 18, 2024 by Pulumi

    Associate a set of ECS Capacity Providers with a specified ECS Cluster

    Example Usage

    Example

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AwsNative = Pulumi.AwsNative;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var clusterName = config.Require("clusterName");
        var clusterCPAssociation = new AwsNative.Ecs.ClusterCapacityProviderAssociations("clusterCPAssociation", new()
        {
            Cluster = clusterName,
            CapacityProviders = new[]
            {
                AwsNative.Ecs.ClusterCapacityProviderAssociationsCapacityProvider.Fargate,
                AwsNative.Ecs.ClusterCapacityProviderAssociationsCapacityProvider.FargateSpot,
            },
            DefaultCapacityProviderStrategy = new[]
            {
                new AwsNative.Ecs.Inputs.ClusterCapacityProviderAssociationsCapacityProviderStrategyArgs
                {
                    Base = 2,
                    Weight = 1,
                    CapacityProvider = AwsNative.Ecs.ClusterCapacityProviderAssociationsCapacityProvider.Fargate,
                },
                new AwsNative.Ecs.Inputs.ClusterCapacityProviderAssociationsCapacityProviderStrategyArgs
                {
                    Base = 0,
                    Weight = 1,
                    CapacityProvider = AwsNative.Ecs.ClusterCapacityProviderAssociationsCapacityProvider.FargateSpot,
                },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws-native/sdk/go/aws/ecs"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		clusterName := cfg.Require("clusterName")
    		_, err := ecs.NewClusterCapacityProviderAssociations(ctx, "clusterCPAssociation", &ecs.ClusterCapacityProviderAssociationsArgs{
    			Cluster: pulumi.String(clusterName),
    			CapacityProviders: pulumi.StringArray{
    				pulumi.String(ecs.ClusterCapacityProviderAssociationsCapacityProviderFargate),
    				pulumi.String(ecs.ClusterCapacityProviderAssociationsCapacityProviderFargateSpot),
    			},
    			DefaultCapacityProviderStrategy: ecs.ClusterCapacityProviderAssociationsCapacityProviderStrategyArray{
    				&ecs.ClusterCapacityProviderAssociationsCapacityProviderStrategyArgs{
    					Base:             pulumi.Int(2),
    					Weight:           pulumi.Int(1),
    					CapacityProvider: pulumi.String(ecs.ClusterCapacityProviderAssociationsCapacityProviderFargate),
    				},
    				&ecs.ClusterCapacityProviderAssociationsCapacityProviderStrategyArgs{
    					Base:             pulumi.Int(0),
    					Weight:           pulumi.Int(1),
    					CapacityProvider: pulumi.String(ecs.ClusterCapacityProviderAssociationsCapacityProviderFargateSpot),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Coming soon!

    import pulumi
    import pulumi_aws_native as aws_native
    
    config = pulumi.Config()
    cluster_name = config.require("clusterName")
    cluster_cpassociation = aws_native.ecs.ClusterCapacityProviderAssociations("clusterCPAssociation",
        cluster=cluster_name,
        capacity_providers=[
            aws_native.ecs.ClusterCapacityProviderAssociationsCapacityProvider.FARGATE,
            aws_native.ecs.ClusterCapacityProviderAssociationsCapacityProvider.FARGATE_SPOT,
        ],
        default_capacity_provider_strategy=[
            {
                "base": 2,
                "weight": 1,
                "capacity_provider": aws_native.ecs.ClusterCapacityProviderAssociationsCapacityProvider.FARGATE,
            },
            {
                "base": 0,
                "weight": 1,
                "capacity_provider": aws_native.ecs.ClusterCapacityProviderAssociationsCapacityProvider.FARGATE_SPOT,
            },
        ])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws_native from "@pulumi/aws-native";
    
    const config = new pulumi.Config();
    const clusterName = config.require("clusterName");
    const clusterCPAssociation = new aws_native.ecs.ClusterCapacityProviderAssociations("clusterCPAssociation", {
        cluster: clusterName,
        capacityProviders: [
            aws_native.ecs.ClusterCapacityProviderAssociationsCapacityProvider.Fargate,
            aws_native.ecs.ClusterCapacityProviderAssociationsCapacityProvider.FargateSpot,
        ],
        defaultCapacityProviderStrategy: [
            {
                base: 2,
                weight: 1,
                capacityProvider: aws_native.ecs.ClusterCapacityProviderAssociationsCapacityProvider.Fargate,
            },
            {
                base: 0,
                weight: 1,
                capacityProvider: aws_native.ecs.ClusterCapacityProviderAssociationsCapacityProvider.FargateSpot,
            },
        ],
    });
    

    Coming soon!

    Example

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AwsNative = Pulumi.AwsNative;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var clusterName = config.Require("clusterName");
        var clusterCPAssociation = new AwsNative.Ecs.ClusterCapacityProviderAssociations("clusterCPAssociation", new()
        {
            Cluster = clusterName,
            CapacityProviders = new[]
            {
                AwsNative.Ecs.ClusterCapacityProviderAssociationsCapacityProvider.Fargate,
                AwsNative.Ecs.ClusterCapacityProviderAssociationsCapacityProvider.FargateSpot,
            },
            DefaultCapacityProviderStrategy = new[]
            {
                new AwsNative.Ecs.Inputs.ClusterCapacityProviderAssociationsCapacityProviderStrategyArgs
                {
                    Base = 2,
                    Weight = 1,
                    CapacityProvider = AwsNative.Ecs.ClusterCapacityProviderAssociationsCapacityProvider.Fargate,
                },
                new AwsNative.Ecs.Inputs.ClusterCapacityProviderAssociationsCapacityProviderStrategyArgs
                {
                    Base = 0,
                    Weight = 1,
                    CapacityProvider = AwsNative.Ecs.ClusterCapacityProviderAssociationsCapacityProvider.FargateSpot,
                },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws-native/sdk/go/aws/ecs"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		clusterName := cfg.Require("clusterName")
    		_, err := ecs.NewClusterCapacityProviderAssociations(ctx, "clusterCPAssociation", &ecs.ClusterCapacityProviderAssociationsArgs{
    			Cluster: pulumi.String(clusterName),
    			CapacityProviders: pulumi.StringArray{
    				pulumi.String(ecs.ClusterCapacityProviderAssociationsCapacityProviderFargate),
    				pulumi.String(ecs.ClusterCapacityProviderAssociationsCapacityProviderFargateSpot),
    			},
    			DefaultCapacityProviderStrategy: ecs.ClusterCapacityProviderAssociationsCapacityProviderStrategyArray{
    				&ecs.ClusterCapacityProviderAssociationsCapacityProviderStrategyArgs{
    					Base:             pulumi.Int(2),
    					Weight:           pulumi.Int(1),
    					CapacityProvider: pulumi.String(ecs.ClusterCapacityProviderAssociationsCapacityProviderFargate),
    				},
    				&ecs.ClusterCapacityProviderAssociationsCapacityProviderStrategyArgs{
    					Base:             pulumi.Int(0),
    					Weight:           pulumi.Int(1),
    					CapacityProvider: pulumi.String(ecs.ClusterCapacityProviderAssociationsCapacityProviderFargateSpot),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Coming soon!

    import pulumi
    import pulumi_aws_native as aws_native
    
    config = pulumi.Config()
    cluster_name = config.require("clusterName")
    cluster_cpassociation = aws_native.ecs.ClusterCapacityProviderAssociations("clusterCPAssociation",
        cluster=cluster_name,
        capacity_providers=[
            aws_native.ecs.ClusterCapacityProviderAssociationsCapacityProvider.FARGATE,
            aws_native.ecs.ClusterCapacityProviderAssociationsCapacityProvider.FARGATE_SPOT,
        ],
        default_capacity_provider_strategy=[
            {
                "base": 2,
                "weight": 1,
                "capacity_provider": aws_native.ecs.ClusterCapacityProviderAssociationsCapacityProvider.FARGATE,
            },
            {
                "base": 0,
                "weight": 1,
                "capacity_provider": aws_native.ecs.ClusterCapacityProviderAssociationsCapacityProvider.FARGATE_SPOT,
            },
        ])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws_native from "@pulumi/aws-native";
    
    const config = new pulumi.Config();
    const clusterName = config.require("clusterName");
    const clusterCPAssociation = new aws_native.ecs.ClusterCapacityProviderAssociations("clusterCPAssociation", {
        cluster: clusterName,
        capacityProviders: [
            aws_native.ecs.ClusterCapacityProviderAssociationsCapacityProvider.Fargate,
            aws_native.ecs.ClusterCapacityProviderAssociationsCapacityProvider.FargateSpot,
        ],
        defaultCapacityProviderStrategy: [
            {
                base: 2,
                weight: 1,
                capacityProvider: aws_native.ecs.ClusterCapacityProviderAssociationsCapacityProvider.Fargate,
            },
            {
                base: 0,
                weight: 1,
                capacityProvider: aws_native.ecs.ClusterCapacityProviderAssociationsCapacityProvider.FargateSpot,
            },
        ],
    });
    

    Coming soon!

    Create ClusterCapacityProviderAssociations Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ClusterCapacityProviderAssociations(name: string, args: ClusterCapacityProviderAssociationsArgs, opts?: CustomResourceOptions);
    @overload
    def ClusterCapacityProviderAssociations(resource_name: str,
                                            args: ClusterCapacityProviderAssociationsArgs,
                                            opts: Optional[ResourceOptions] = None)
    
    @overload
    def ClusterCapacityProviderAssociations(resource_name: str,
                                            opts: Optional[ResourceOptions] = None,
                                            capacity_providers: Optional[Sequence[Union[ClusterCapacityProviderAssociationsCapacityProvider, str]]] = None,
                                            cluster: Optional[str] = None,
                                            default_capacity_provider_strategy: Optional[Sequence[ClusterCapacityProviderAssociationsCapacityProviderStrategyArgs]] = None)
    func NewClusterCapacityProviderAssociations(ctx *Context, name string, args ClusterCapacityProviderAssociationsArgs, opts ...ResourceOption) (*ClusterCapacityProviderAssociations, error)
    public ClusterCapacityProviderAssociations(string name, ClusterCapacityProviderAssociationsArgs args, CustomResourceOptions? opts = null)
    public ClusterCapacityProviderAssociations(String name, ClusterCapacityProviderAssociationsArgs args)
    public ClusterCapacityProviderAssociations(String name, ClusterCapacityProviderAssociationsArgs args, CustomResourceOptions options)
    
    type: aws-native:ecs:ClusterCapacityProviderAssociations
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args ClusterCapacityProviderAssociationsArgs
    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 ClusterCapacityProviderAssociationsArgs
    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 ClusterCapacityProviderAssociationsArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ClusterCapacityProviderAssociationsArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ClusterCapacityProviderAssociationsArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    ClusterCapacityProviderAssociations Resource Properties

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

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The ClusterCapacityProviderAssociations resource accepts the following input properties:

    CapacityProviders List<Union<Pulumi.AwsNative.Ecs.ClusterCapacityProviderAssociationsCapacityProvider, string>>
    The capacity providers to associate with the cluster.
    Cluster string
    The cluster the capacity provider association is the target of.
    DefaultCapacityProviderStrategy List<Pulumi.AwsNative.Ecs.Inputs.ClusterCapacityProviderAssociationsCapacityProviderStrategy>
    The default capacity provider strategy to associate with the cluster.
    CapacityProviders []string
    The capacity providers to associate with the cluster.
    Cluster string
    The cluster the capacity provider association is the target of.
    DefaultCapacityProviderStrategy []ClusterCapacityProviderAssociationsCapacityProviderStrategyArgs
    The default capacity provider strategy to associate with the cluster.
    capacityProviders List<Either<ClusterCapacityProviderAssociationsCapacityProvider,String>>
    The capacity providers to associate with the cluster.
    cluster String
    The cluster the capacity provider association is the target of.
    defaultCapacityProviderStrategy List<ClusterCapacityProviderAssociationsCapacityProviderStrategy>
    The default capacity provider strategy to associate with the cluster.
    capacityProviders (ClusterCapacityProviderAssociationsCapacityProvider | string)[]
    The capacity providers to associate with the cluster.
    cluster string
    The cluster the capacity provider association is the target of.
    defaultCapacityProviderStrategy ClusterCapacityProviderAssociationsCapacityProviderStrategy[]
    The default capacity provider strategy to associate with the cluster.
    capacity_providers Sequence[Union[ClusterCapacityProviderAssociationsCapacityProvider, str]]
    The capacity providers to associate with the cluster.
    cluster str
    The cluster the capacity provider association is the target of.
    default_capacity_provider_strategy Sequence[ClusterCapacityProviderAssociationsCapacityProviderStrategyArgs]
    The default capacity provider strategy to associate with the cluster.
    capacityProviders List<"FARGATE" | "FARGATE_SPOT" | String>
    The capacity providers to associate with the cluster.
    cluster String
    The cluster the capacity provider association is the target of.
    defaultCapacityProviderStrategy List<Property Map>
    The default capacity provider strategy to associate with the cluster.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ClusterCapacityProviderAssociations 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.

    Supporting Types

    ClusterCapacityProviderAssociationsCapacityProvider, ClusterCapacityProviderAssociationsCapacityProviderArgs

    Fargate
    FARGATE
    FargateSpot
    FARGATE_SPOT
    ClusterCapacityProviderAssociationsCapacityProviderFargate
    FARGATE
    ClusterCapacityProviderAssociationsCapacityProviderFargateSpot
    FARGATE_SPOT
    Fargate
    FARGATE
    FargateSpot
    FARGATE_SPOT
    Fargate
    FARGATE
    FargateSpot
    FARGATE_SPOT
    FARGATE
    FARGATE
    FARGATE_SPOT
    FARGATE_SPOT
    "FARGATE"
    FARGATE
    "FARGATE_SPOT"
    FARGATE_SPOT

    ClusterCapacityProviderAssociationsCapacityProviderStrategy, ClusterCapacityProviderAssociationsCapacityProviderStrategyArgs

    Package Details

    Repository
    AWS Native pulumi/pulumi-aws-native
    License
    Apache-2.0
    aws-native logo

    We recommend new projects start with resources from the AWS provider.

    AWS Cloud Control v1.9.0 published on Monday, Nov 18, 2024 by Pulumi