I can’t seem to figure out how to create additional stacks that reuse a single module in the same environment.
For example (this works as expected):
app/stacks/ecs/main.tf
module “ecs” “this” {
cluster_name = var.cluster_name
vpc_id = var.vpc_id
}
app/stacks/ecs/tfvars/dev.tfvars
cluster_name = “dev ecs cluster”
vpc_id = <%= output(‘vpc.vpc_id’) %>
I would like to have something like this:
app/stacks/ecs/tfvars/dev/ecs-1.tfvars
app/stacks/ecs/tfvars/dev/ecs-2.tfvars
This way I keep the terraform DRY and only define one instance of the module.
I don’t want to do:
app/stacks/ecs-1/tfvars/dev.tfvars
app/stacks/ecs-2/tfvars/dev.tfvars
Is this possible?