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.
Discussion 0
Join free to post in the discussion.
Related questions
- What terraform plan doesCloud Engineer
- What a Terraform output doesCloud Engineer
- What OpenTofu isCloud Engineer
- Why remote state needs lockingCloud Engineer
- Renaming a resource without recreating itCloud Engineer
- Avoiding downtime on forced replacementCloud Engineer
- Detecting drift from console changesCloud Engineer
- count vs for_each in TerraformCloud Engineer