You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
terraform's for_each doesn't work here; if we did that it would complain:
╷
│ Error: Invalid for_each argument
│
│ on main.tf line 77, in resource "cloudflare_record" "my_record":
│ 77: for_each = toset(deno_domain.example_domain.dns_records)
│ ├────────────────
│ │ deno_domain.example_domain.dns_records is a list of object, known only after apply
│
│ The "for_each" set includes values derived from resource attributes that
│ cannot be determined until apply, and so Terraform cannot determine the
│ full set of keys that will identify the instances of this resource.
│
│ When working with unknown values in for_each, it's better to use a map
│ value where the keys are defined statically in your configuration and
│ where only the values contain apply-time results.
│
│ Alternatively, you could use the -target planning option to first apply
│ only the resources that the for_each value depends on, and then apply a
│ second time to fully converge.
We would like to look for a better solution to make it easier to write.
The text was updated successfully, but these errors were encountered:
resource"cloudflare_record""deno_domain" {
count=3zone_id="<put your zone ID>"name=deno_domain.example.dns_records[count.index].nametype=upper(deno_domain.example.dns_records[count.index].type)
value=deno_domain.example.dns_records[count.index].contentproxied=falsettl=120
}
Now the provider users need to register DNS records like the following:
terraform-provider-deno/examples/resources/deno_domain/resource.tf
Lines 18 to 49 in 94ce388
terraform's
for_each
doesn't work here; if we did that it would complain:We would like to look for a better solution to make it easier to write.
The text was updated successfully, but these errors were encountered: