for_each Keys Must Be Known
for_each = toset([for s in aws_subnet.private : s.id]) fails during the first plan with "Invalid for_each argument". Why?
for_each = toset([for s in aws_subnet.private : s.id])
Choose one answer
Resources can't refer to other resources in for_each.
for_each
for_each can't iterate over a set.
toset reorders the elements, which for_each doesn't allow for computed values.
toset
The IDs are unknown until apply; keys must be known.