Try AWS Native preview for resources not in the classic version.
aws.ecs.ClusterCapacityProviders
Explore with Pulumi AI
Try AWS Native preview for resources not in the classic version.
Manages the capacity providers of an ECS Cluster.
More information about capacity providers can be found in the ECS User Guide.
Example Usage
using System.Collections.Generic;
using System.Linq;
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/v6/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 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:
- Cluster
Name string Name of the ECS cluster to manage capacity providers for.
- Capacity
Providers List<string> Set of names of one or more capacity providers to associate with the cluster. Valid values also include
FARGATE
andFARGATE_SPOT
.- Default
Capacity List<ClusterProvider Strategies Capacity Providers Default Capacity Provider Strategy> Set of capacity provider strategies to use by default for the cluster. Detailed below.
- Cluster
Name string Name of the ECS cluster to manage capacity providers for.
- Capacity
Providers []string Set of names of one or more capacity providers to associate with the cluster. Valid values also include
FARGATE
andFARGATE_SPOT
.- Default
Capacity []ClusterProvider Strategies Capacity Providers Default Capacity Provider Strategy Args Set of capacity provider strategies to use by default for the cluster. Detailed below.
- cluster
Name String Name of the ECS cluster to manage capacity providers for.
- capacity
Providers List<String> Set of names of one or more capacity providers to associate with the cluster. Valid values also include
FARGATE
andFARGATE_SPOT
.- default
Capacity List<ClusterProvider Strategies Capacity Providers Default Capacity Provider Strategy> Set of capacity provider strategies to use by default for the cluster. Detailed below.
- cluster
Name string Name of the ECS cluster to manage capacity providers for.
- capacity
Providers string[] Set of names of one or more capacity providers to associate with the cluster. Valid values also include
FARGATE
andFARGATE_SPOT
.- default
Capacity ClusterProvider Strategies Capacity Providers Default Capacity Provider Strategy[] 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
andFARGATE_SPOT
.- default_
capacity_ Sequence[Clusterprovider_ strategies Capacity Providers Default Capacity Provider Strategy Args] Set of capacity provider strategies to use by default for the cluster. Detailed below.
- cluster
Name String Name of the ECS cluster to manage capacity providers for.
- capacity
Providers List<String> Set of names of one or more capacity providers to associate with the cluster. Valid values also include
FARGATE
andFARGATE_SPOT
.- default
Capacity List<Property Map>Provider Strategies 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 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.
- Capacity
Providers List<string> Set of names of one or more capacity providers to associate with the cluster. Valid values also include
FARGATE
andFARGATE_SPOT
.- Cluster
Name string Name of the ECS cluster to manage capacity providers for.
- Default
Capacity List<ClusterProvider Strategies Capacity Providers Default Capacity Provider Strategy> Set of capacity provider strategies to use by default for the cluster. Detailed below.
- Capacity
Providers []string Set of names of one or more capacity providers to associate with the cluster. Valid values also include
FARGATE
andFARGATE_SPOT
.- Cluster
Name string Name of the ECS cluster to manage capacity providers for.
- Default
Capacity []ClusterProvider Strategies Capacity Providers Default Capacity Provider Strategy Args Set of capacity provider strategies to use by default for the cluster. Detailed below.
- capacity
Providers List<String> Set of names of one or more capacity providers to associate with the cluster. Valid values also include
FARGATE
andFARGATE_SPOT
.- cluster
Name String Name of the ECS cluster to manage capacity providers for.
- default
Capacity List<ClusterProvider Strategies Capacity Providers Default Capacity Provider Strategy> Set of capacity provider strategies to use by default for the cluster. Detailed below.
- capacity
Providers string[] Set of names of one or more capacity providers to associate with the cluster. Valid values also include
FARGATE
andFARGATE_SPOT
.- cluster
Name string Name of the ECS cluster to manage capacity providers for.
- default
Capacity ClusterProvider Strategies Capacity Providers Default Capacity Provider Strategy[] 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
andFARGATE_SPOT
.- cluster_
name str Name of the ECS cluster to manage capacity providers for.
- default_
capacity_ Sequence[Clusterprovider_ strategies Capacity Providers Default Capacity Provider Strategy Args] Set of capacity provider strategies to use by default for the cluster. Detailed below.
- capacity
Providers List<String> Set of names of one or more capacity providers to associate with the cluster. Valid values also include
FARGATE
andFARGATE_SPOT
.- cluster
Name String Name of the ECS cluster to manage capacity providers for.
- default
Capacity List<Property Map>Provider Strategies Set of capacity provider strategies to use by default for the cluster. Detailed below.
Supporting Types
ClusterCapacityProvidersDefaultCapacityProviderStrategy, ClusterCapacityProvidersDefaultCapacityProviderStrategyArgs
- Capacity
Provider 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 thebase
count of tasks has been satisfied. Defaults to0
.
- Capacity
Provider 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 thebase
count of tasks has been satisfied. Defaults to0
.
- capacity
Provider 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 thebase
count of tasks has been satisfied. Defaults to0
.
- capacity
Provider 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 thebase
count of tasks has been satisfied. Defaults to0
.
- 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 thebase
count of tasks has been satisfied. Defaults to0
.
- capacity
Provider 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 thebase
count of tasks has been satisfied. Defaults to0
.
Import
Using pulumi import
, import ECS cluster capacity providers using the cluster_name
attribute. For example:
$ pulumi import aws:ecs/clusterCapacityProviders:ClusterCapacityProviders example my-cluster
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
aws
Terraform Provider.
Try AWS Native preview for resources not in the classic version.