Resource: aws_ecs_capacity_provider

Provides an ECS cluster capacity provider. More information can be found on the ECS Developer Guide.

Example Usage

resource "aws_autoscaling_group" "test" {
  # ... other configuration, including potentially other tags ...

  tag {
    key                 = "AmazonECSManaged"
    value               = true
    propagate_at_launch = true
  }
}

resource "aws_ecs_capacity_provider" "test" {
  name = "test"

  auto_scaling_group_provider {
    auto_scaling_group_arn         = aws_autoscaling_group.test.arn
    managed_termination_protection = "ENABLED"

    managed_scaling {
      maximum_scaling_step_size = 1000
      minimum_scaling_step_size = 1
      status                    = "ENABLED"
      target_capacity           = 10
    }
  }
}

Argument Reference

This resource supports the following arguments:

auto_scaling_group_provider

managed_scaling

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 Capacity Providers using the name. For example:

import {
  to = aws_ecs_capacity_provider.example
  id = "example"
}

Using terraform import, import ECS Capacity Providers using the name. For example:

% terraform import aws_ecs_capacity_provider.example example