terraform plan for below part of code is giving error for gcp.
rrdatas = [element(
google_compute_instance.web.*.network_interface.0.access_config.0.nat_ip,
count.index,
)]
The error is:
./terraform1.0 plan
╷
│ Error: Reference to "count" in non-counted context
│
│ on main.tf line 73, in resource "google_dns_record_set" "a":
│ 73: count.index,
│
│ The "count" object can only be used in "module", "resource", and "data" blocks, and only when the "count"
│ argument is set.
Blockquote
Please suggest how to fix that