terraform -v
Terraform v0.12.3
Error: Incorrect attribute value type
on gke-cluster.tf line 107, in resource "google_compute_router_nat" "egress_nat_production":
107: nat_ips = ["${google_compute_address.egress_production.*.self_link}"]
Inappropriate value for attribute "nat_ips": element 0: string required.
Hi @scippio - can you try nat_ips = "$google_compute_address.egress_production[*].self_link"?
Thanks @tysen - that's resolved the same issue I'd just run into, perfect timing! Hopefully it will resolve @scippio too.
This parameter should be fixed in documentation https://www.terraform.io/docs/providers/google/r/compute_router_nat.html
The error occurs, for me, when using the lines in the updated documentation. The easiest way to reproduce this is by copying the production-like configuration as-is (at the above-referenced documentation URL). This is with terraform v0.12.6 and provider.google v2.12.0:
Error: Incorrect attribute value type
on network-us-west2.tf line 32, in resource "google_compute_router_nat" "advanced-nat":
32: nat_ips = ["${google_compute_address.address[*].self_link}"]
Inappropriate value for attribute "nat_ips": element 0: string required.
Replacing line 32 with the string:
nat_ips = google_compute_address.address[*].self_link
works fine.
Thanks @dpkirchner - fixed in https://github.com/GoogleCloudPlatform/magic-modules/pull/2125
I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!
Most helpful comment
Hi @scippio - can you try
nat_ips = "$google_compute_address.egress_production[*].self_link"?