We recommend new projects start with resources from the AWS provider.
aws-native.ecs.ClusterCapacityProviderAssociations
Explore with Pulumi AI
We recommend new projects start with resources from the AWS provider.
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:
- Capacity
Providers List<Union<Pulumi.Aws Native. Ecs. Cluster Capacity Provider Associations Capacity Provider, string>> - The capacity providers to associate with the cluster.
- Cluster string
- The cluster the capacity provider association is the target of.
- Default
Capacity List<Pulumi.Provider Strategy Aws Native. Ecs. Inputs. Cluster Capacity Provider Associations Capacity Provider Strategy> - The default capacity provider strategy to associate with the cluster.
- Capacity
Providers []string - The capacity providers to associate with the cluster.
- Cluster string
- The cluster the capacity provider association is the target of.
- Default
Capacity []ClusterProvider Strategy Capacity Provider Associations Capacity Provider Strategy Args - The default capacity provider strategy to associate with the cluster.
- capacity
Providers List<Either<ClusterCapacity Provider Associations Capacity Provider,String>> - The capacity providers to associate with the cluster.
- cluster String
- The cluster the capacity provider association is the target of.
- default
Capacity List<ClusterProvider Strategy Capacity Provider Associations Capacity Provider Strategy> - The default capacity provider strategy to associate with the cluster.
- capacity
Providers (ClusterCapacity Provider Associations Capacity Provider | string)[] - The capacity providers to associate with the cluster.
- cluster string
- The cluster the capacity provider association is the target of.
- default
Capacity ClusterProvider Strategy Capacity Provider Associations Capacity Provider Strategy[] - The default capacity provider strategy to associate with the cluster.
- capacity_
providers Sequence[Union[ClusterCapacity Provider Associations Capacity Provider, str]] - The capacity providers to associate with the cluster.
- cluster str
- The cluster the capacity provider association is the target of.
- default_
capacity_ Sequence[Clusterprovider_ strategy Capacity Provider Associations Capacity Provider Strategy Args] - The default capacity provider strategy to associate with the cluster.
- capacity
Providers 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.
- default
Capacity List<Property Map>Provider Strategy - 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
- Fargate
Spot - FARGATE_SPOT
- Cluster
Capacity Provider Associations Capacity Provider Fargate - FARGATE
- Cluster
Capacity Provider Associations Capacity Provider Fargate Spot - FARGATE_SPOT
- Fargate
- FARGATE
- Fargate
Spot - FARGATE_SPOT
- Fargate
- FARGATE
- Fargate
Spot - FARGATE_SPOT
- FARGATE
- FARGATE
- FARGATE_SPOT
- FARGATE_SPOT
- "FARGATE"
- FARGATE
- "FARGATE_SPOT"
- FARGATE_SPOT
ClusterCapacityProviderAssociationsCapacityProviderStrategy, ClusterCapacityProviderAssociationsCapacityProviderStrategyArgs
- capacity
Provider ClusterCapacity | StringProvider Associations Capacity Provider - base Integer
- weight Integer
- capacity
Provider ClusterCapacity | stringProvider Associations Capacity Provider - base number
- weight number
- capacity
Provider "FARGATE" | "FARGATE_SPOT" | String - base Number
- weight Number
Package Details
- Repository
- AWS Native pulumi/pulumi-aws-native
- License
- Apache-2.0
We recommend new projects start with resources from the AWS provider.