Error in https tg for_each
rredpoppy opened this issue · 1 comments
rredpoppy commented
As a module user when I use https for the module I expect terraform apply
to go through without errors. Instead, I receive the following:
Error: Invalid for_each argument
on .terraform/modules/<my module>/main.tf line 15, in data "aws_lb_target_group" "lb_https_target_groups":
15: for_each = toset(var.lb_https_tgs_arns)
The "for_each" value depends on resource attributes that cannot be determined
until apply, so Terraform cannot predict how many instances will be created.
To work around this, use the -target argument to first apply only the
resources that the for_each depends on.