Open ghost opened 3 years ago
I've also experience some weirdness with the hostname
field in google_compute_instance
. One some instances it exists and updated fine by Terraform, while on others it does not exist and Terraform appears to ignore it entirely.
This includes terraform state show
which simply does not show the field on some instances.
It isn't currently an available field for google_compute_instance data-source
Affected Resource(s)
This issue was originally opened by @danislav as hashicorp/terraform#28145. It was migrated here as a result of the provider split. The original body of the issue is below.
Use-cases
When I need to fetch the attributes of a google compute instance with
data "google_compute_instance" "some_instance"
the hostname attribute of the instance is not fetched from google. Thedata.google_compute_instance.some_instance.hostname
is empty even if is set in GCP.Attempted Solutions
using gcloud command works:
gcloud compute instances describe some_instance --format='get(hostname)'
but would be better if the native terraform data source could query the hostnameProposal
Add hostname to the google_compute_instance data source.
b/359636965