Skip to main content
v4.0 upgrades minimum provider and Terraform requirements, consolidates capacity provider configuration into the module, and removes the ecs-instance-profile sub-module.

What changed

  • Minimum Terraform version raised to v1.0
  • Minimum AWS provider version raised to v4.6
  • ecs-instance-profile sub-module removed
  • container_insights variable replaced with cluster_settings
  • capacity_providers and default_capacity_provider_strategy replaced with fargate_capacity_providers and autoscaling_capacity_providers
  • aws_ecs_capacity_provider resources are now managed inside the module

Breaking changes

The ecs-instance-profile sub-module has been removed. You must migrate to the IAM instance profile provided by the terraform-aws-autoscaling module (v6.5.0+). See the examples/complete directory for a reference implementation.
The capacity_providers and default_capacity_provider_strategy variables have been removed and replaced with fargate_capacity_providers and autoscaling_capacity_providers. AutoScaling Group capacity providers are now created and managed directly by this module rather than being referenced externally.

Variable and output changes

Removed variables

  • default_capacity_provider_strategy — now embedded in fargate_capacity_providers and autoscaling_capacity_providers

Renamed variables

Added variables

  • cluster_configuration — dynamic block supporting all current attributes

Removed outputs

  • ecs_cluster_name

Renamed outputs

Added outputs

  • cluster_capacity_providers
  • autoscaling_capacity_providers

Migration guide

1

Update the module version

Change the version constraint in your module source to 4.0.0 (or ~> 4.0).
2

Rename the cluster name variable

Replace name with cluster_name.
3

Replace container_insights with cluster_settings

The container_insights boolean has been replaced by cluster_settings, which accepts a map and allows finer control. Container insights is enabled by default, so you can simply remove the variable if you were setting it to true.
4

Migrate capacity providers

Replace capacity_providers and default_capacity_provider_strategy with fargate_capacity_providers and autoscaling_capacity_providers.
For EC2 AutoScaling Group capacity providers, remove the standalone aws_ecs_capacity_provider resource and move the configuration into autoscaling_capacity_providers.
5

Migrate the ecs-instance-profile sub-module

The ecs-instance-profile sub-module has been removed. You can pin the sub-module at v3.5.0 until you are ready to migrate to the IAM instance profile provided by the terraform-aws-autoscaling module.
See the examples/complete example for a full demonstration of integrating with terraform-aws-autoscaling to replace this sub-module.
6

Move capacity provider state (optional)

If you previously managed aws_ecs_capacity_provider resources outside the module and want to bring them under module management, use terraform state mv to avoid destroying and recreating them.
This step is optional. If you skip it, Terraform will destroy the existing capacity provider and create a new one under the module’s management. This may cause brief disruption to cluster capacity.
7

Update output references

Update any references to the renamed outputs:

Complete before/after example