AWS Native

Pulumi Official
Package maintained by Pulumi
v0.19.0 published on Wednesday, Jun 8, 2022 by Pulumi

ClusterCapacityProviderAssociations

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

Example Usage

Example

using Pulumi;
using AwsNative = Pulumi.AwsNative;

class MyStack : Stack
{
    public MyStack()
    {
        var config = new Config();
        var clusterName = config.Require("clusterName");
        var clusterCPAssociation = new AwsNative.ECS.ClusterCapacityProviderAssociations("clusterCPAssociation", new AwsNative.ECS.ClusterCapacityProviderAssociationsArgs
        {
            Cluster = clusterName,
            CapacityProviders = 
            {
                "FARGATE",
                "FARGATE_SPOT",
            },
            DefaultCapacityProviderStrategy = 
            {
                new AwsNative.ECS.Inputs.ClusterCapacityProviderAssociationsCapacityProviderStrategyArgs
                {
                    Base = 2,
                    Weight = 1,
                    CapacityProvider = "FARGATE",
                },
                new AwsNative.ECS.Inputs.ClusterCapacityProviderAssociationsCapacityProviderStrategyArgs
                {
                    Base = 0,
                    Weight = 1,
                    CapacityProvider = "FARGATE_SPOT",
                },
            },
        });
    }

}
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("FARGATE"),
				pulumi.String("FARGATE_SPOT"),
			},
			DefaultCapacityProviderStrategy: ecs.ClusterCapacityProviderAssociationsCapacityProviderStrategyArray{
				&ecs.ClusterCapacityProviderAssociationsCapacityProviderStrategyArgs{
					Base:             pulumi.Int(2),
					Weight:           pulumi.Int(1),
					CapacityProvider: pulumi.String("FARGATE"),
				},
				&ecs.ClusterCapacityProviderAssociationsCapacityProviderStrategyArgs{
					Base:             pulumi.Int(0),
					Weight:           pulumi.Int(1),
					CapacityProvider: pulumi.String("FARGATE_SPOT"),
				},
			},
		})
		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=[
        "FARGATE",
        "FARGATE_SPOT",
    ],
    default_capacity_provider_strategy=[
        aws_native.ecs.ClusterCapacityProviderAssociationsCapacityProviderStrategyArgs(
            base=2,
            weight=1,
            capacity_provider="FARGATE",
        ),
        aws_native.ecs.ClusterCapacityProviderAssociationsCapacityProviderStrategyArgs(
            base=0,
            weight=1,
            capacity_provider="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: [
        "FARGATE",
        "FARGATE_SPOT",
    ],
    defaultCapacityProviderStrategy: [
        {
            base: 2,
            weight: 1,
            capacityProvider: "FARGATE",
        },
        {
            base: 0,
            weight: 1,
            capacityProvider: "FARGATE_SPOT",
        },
    ],
});

Coming soon!

Example

using Pulumi;
using AwsNative = Pulumi.AwsNative;

class MyStack : Stack
{
    public MyStack()
    {
        var config = new Config();
        var clusterName = config.Require("clusterName");
        var clusterCPAssociation = new AwsNative.ECS.ClusterCapacityProviderAssociations("clusterCPAssociation", new AwsNative.ECS.ClusterCapacityProviderAssociationsArgs
        {
            Cluster = clusterName,
            CapacityProviders = 
            {
                "FARGATE",
                "FARGATE_SPOT",
            },
            DefaultCapacityProviderStrategy = 
            {
                new AwsNative.ECS.Inputs.ClusterCapacityProviderAssociationsCapacityProviderStrategyArgs
                {
                    Base = 2,
                    Weight = 1,
                    CapacityProvider = "FARGATE",
                },
                new AwsNative.ECS.Inputs.ClusterCapacityProviderAssociationsCapacityProviderStrategyArgs
                {
                    Base = 0,
                    Weight = 1,
                    CapacityProvider = "FARGATE_SPOT",
                },
            },
        });
    }

}
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("FARGATE"),
				pulumi.String("FARGATE_SPOT"),
			},
			DefaultCapacityProviderStrategy: ecs.ClusterCapacityProviderAssociationsCapacityProviderStrategyArray{
				&ecs.ClusterCapacityProviderAssociationsCapacityProviderStrategyArgs{
					Base:             pulumi.Int(2),
					Weight:           pulumi.Int(1),
					CapacityProvider: pulumi.String("FARGATE"),
				},
				&ecs.ClusterCapacityProviderAssociationsCapacityProviderStrategyArgs{
					Base:             pulumi.Int(0),
					Weight:           pulumi.Int(1),
					CapacityProvider: pulumi.String("FARGATE_SPOT"),
				},
			},
		})
		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=[
        "FARGATE",
        "FARGATE_SPOT",
    ],
    default_capacity_provider_strategy=[
        aws_native.ecs.ClusterCapacityProviderAssociationsCapacityProviderStrategyArgs(
            base=2,
            weight=1,
            capacity_provider="FARGATE",
        ),
        aws_native.ecs.ClusterCapacityProviderAssociationsCapacityProviderStrategyArgs(
            base=0,
            weight=1,
            capacity_provider="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: [
        "FARGATE",
        "FARGATE_SPOT",
    ],
    defaultCapacityProviderStrategy: [
        {
            base: 2,
            weight: 1,
            capacityProvider: "FARGATE",
        },
        {
            base: 0,
            weight: 1,
            capacityProvider: "FARGATE_SPOT",
        },
    ],
});

Coming soon!

Create a ClusterCapacityProviderAssociations Resource

new ClusterCapacityProviderAssociations(name: string, args: ClusterCapacityProviderAssociationsArgs, opts?: CustomResourceOptions);
@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)
@overload
def ClusterCapacityProviderAssociations(resource_name: str,
                                        args: ClusterCapacityProviderAssociationsArgs,
                                        opts: Optional[ResourceOptions] = 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.

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

The ClusterCapacityProviderAssociations resource accepts the following input properties:

CapacityProviders List<Union<Pulumi.AwsNative.ECS.ClusterCapacityProviderAssociationsCapacityProvider, string>>
Cluster string
DefaultCapacityProviderStrategy List<Pulumi.AwsNative.ECS.Inputs.ClusterCapacityProviderAssociationsCapacityProviderStrategyArgs>
capacityProviders List<"FARGATE" | "FARGATE_SPOT" | String>
cluster String
defaultCapacityProviderStrategy List<Property Map>

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

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

Package Details

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