Hey guys,
I’m using “for_each” syntax to generate a X stacks of resources for a particular project. In particular, I’m generating X aws_capacity_provider objects, 1 for each stack.
resource "aws_ecs_capacity_provider" "my_capacity_provider" {
for_each = local.services
name = each.key
....other stuff....
}
However, I now want to add all these generated capacity providers to a single cluster, using the following type of syntax:
data "aws_ecs_cluster" "my_ecs_cluster" {
cluster_name = local.ecs_cluster_name
capacity_providers = [PSEUDOCODE: for_each generated aws_ecs_capacity_provider, add to this list]
}
Anybody know the proper syntax for this? I’m relatively new to Terraform, so apologize if this is a straightforward problem!