Cluster Capacity Providers
Manages the capacity providers of an ECS Cluster. More information about capacity providers can be found in the ECS User Guide.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.ecs.Cluster("example", {name: "my-cluster"});
const exampleClusterCapacityProviders = new aws.ecs.ClusterCapacityProviders("example", {
clusterName: example.name,
capacityProviders: ["FARGATE"],
defaultCapacityProviderStrategies: [{
base: 1,
weight: 100,
capacityProvider: "FARGATE",
}],
});
Content copied to clipboard
import pulumi
import pulumi_aws as aws
example = aws.ecs.Cluster("example", name="my-cluster")
example_cluster_capacity_providers = aws.ecs.ClusterCapacityProviders("example",
cluster_name=example.name,
capacity_providers=["FARGATE"],
default_capacity_provider_strategies=[{
"base": 1,
"weight": 100,
"capacity_provider": "FARGATE",
}])
Content copied to clipboard
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Ecs.Cluster("example", new()
{
Name = "my-cluster",
});
var exampleClusterCapacityProviders = new Aws.Ecs.ClusterCapacityProviders("example", new()
{
ClusterName = example.Name,
CapacityProviders = new[]
{
"FARGATE",
},
DefaultCapacityProviderStrategies = new[]
{
new Aws.Ecs.Inputs.ClusterCapacityProvidersDefaultCapacityProviderStrategyArgs
{
Base = 1,
Weight = 100,
CapacityProvider = "FARGATE",
},
},
});
});
Content copied to clipboard
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 {
example, err := ecs.NewCluster(ctx, "example", &ecs.ClusterArgs{
Name: pulumi.String("my-cluster"),
})
if err != nil {
return err
}
_, err = ecs.NewClusterCapacityProviders(ctx, "example", &ecs.ClusterCapacityProvidersArgs{
ClusterName: example.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
})
}
Content copied to clipboard
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.ClusterArgs;
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 example = new Cluster("example", ClusterArgs.builder()
.name("my-cluster")
.build());
var exampleClusterCapacityProviders = new ClusterCapacityProviders("exampleClusterCapacityProviders", ClusterCapacityProvidersArgs.builder()
.clusterName(example.name())
.capacityProviders("FARGATE")
.defaultCapacityProviderStrategies(ClusterCapacityProvidersDefaultCapacityProviderStrategyArgs.builder()
.base(1)
.weight(100)
.capacityProvider("FARGATE")
.build())
.build());
}
}
Content copied to clipboard
resources:
example:
type: aws:ecs:Cluster
properties:
name: my-cluster
exampleClusterCapacityProviders:
type: aws:ecs:ClusterCapacityProviders
name: example
properties:
clusterName: ${example.name}
capacityProviders:
- FARGATE
defaultCapacityProviderStrategies:
- base: 1
weight: 100
capacityProvider: FARGATE
Content copied to clipboard
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
Content copied to clipboard
Properties
Link copied to clipboard
Set of names of one or more capacity providers to associate with the cluster. Valid values also include FARGATE
and FARGATE_SPOT
.
Link copied to clipboard
Name of the ECS cluster to manage capacity providers for.
Link copied to clipboard
val defaultCapacityProviderStrategies: Output<List<ClusterCapacityProvidersDefaultCapacityProviderStrategy>>?
Set of capacity provider strategies to use by default for the cluster. Detailed below.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard