Resource: aws_ecs_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

resource "aws_ecs_cluster" "example" {
  name = "my-cluster"
}

resource "aws_ecs_cluster_capacity_providers" "example" {
  cluster_name = aws_ecs_cluster.example.name

  capacity_providers = ["FARGATE"]

  default_capacity_provider_strategy {
    base              = 1
    weight            = 100
    capacity_provider = "FARGATE"
  }
}

Argument Reference

This resource supports the following arguments:

default_capacity_provider_strategy Configuration Block

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Import

In Terraform v1.5.0 and later, use an import block to import ECS cluster capacity providers using the cluster_name attribute. For example:

import {
  to = aws_ecs_cluster_capacity_providers.example
  id = "my-cluster"
}

Using terraform import, import ECS cluster capacity providers using the cluster_name attribute. For example:

% terraform import aws_ecs_cluster_capacity_providers.example my-cluster