hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.29k stars 1.72k forks source link

google_compute_instance_template should be able to set public_ptr_domain_name for the underlying instance #9664

Open yacn opened 3 years ago

yacn commented 3 years ago

Community Note

Description

google_compute_instance can set the PTR domain for an instance via the public_ptr_domain_name attribute in the access_config block, but google_compute_instance_template cannot. While the public_ptr_domain_name is in the schema for google_compute_instance_template, it is marked as a Computed attribute only.

The GCE API allows for this field to be set for instance template creation requests, so the terraform provider should be able to set it as well.

New or Affected Resource(s)

Potential Terraform Configuration

It should mirror how google_compute_instance configures this attribute in its access_config block, i.e.

resource "google_compute_instance_template" "foobar" {
  // other stuff
  network_interface {
    network = "default"
    access_config {
      public_ptr_domain_name = "foobar.example.com."
    }
  }
}

References

b/359946132

yacn commented 3 years ago

FYSA: I have started work on this

rileykarson commented 3 years ago

I'm not confident this actually works, as indicated by the API request/response pair in https://github.com/GoogleCloudPlatform/magic-modules/pull/5008#issuecomment-892132674. The API should be returning the user's set values. Pessimistically labeling upstream.

dimitarq commented 2 months ago

Do you have any updates on this issue? It seems that it is not currently implemented and is missing from the provider, but can be managed via the google console or gcloud utility.

ggtisc commented 4 weeks ago

The API shows that the field "publicPtrDomainName": string is available, but terraform registry doesn't show the change and how to implement it.