Skip to content
RED SAGSkills
hard20 pts · first answer countsterraforminfrastructure-as-code

for_each keys unknown until apply

Terraform fails with the error below. What is the right fix?

Error: Invalid for_each argument
  on main.tf line 12, in resource "aws_route53_record" "this":
  for_each = toset(aws_instance.app[*].id)
The "for_each" set includes values derived from resource attributes
that cannot be determined until apply.
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions