terraform has weird limitation which blocks using of dynamic values inside the for_each loop
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.
what
for_each
0.14.0
v0.32.8
why
for_each
loop