Skip to content

Commit 1c4a94a

Browse files
committed
fix(capacity-provider): reading capacity provider names from the variable leading to lack of dependency between ecs cluster cps and ecs cps
1 parent f67a01a commit 1c4a94a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/capacity-provider/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ resource "aws_ecs_capacity_provider" "this" {
3535
resource "aws_ecs_cluster_capacity_providers" "this" {
3636
cluster_name = var.ecs_cluster_name
3737

38-
capacity_providers = [for capacity_provider in var.capacity_providers : capacity_provider.name]
38+
capacity_providers = [for k, capacity_provider in aws_ecs_capacity_provider.this : capacity_provider.name]
3939

4040
dynamic "default_capacity_provider_strategy" {
4141
for_each = var.default_capacity_provider_strategies
4242
iterator = default_capacity_provider_strategies
4343

4444
content {
45-
capacity_provider = default_capacity_provider_strategies.value.capacity_provider
45+
capacity_provider = aws_ecs_capacity_provider.this[default_capacity_provider_strategies.value.capacity_provider].name
4646
base = default_capacity_provider_strategies.value.base
4747
weight = default_capacity_provider_strategies.value.weight
4848
}

0 commit comments

Comments
 (0)