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.33k stars 1.73k forks source link

Any change to contact settings forces unsupported recreate of google_clouddomains_registration resource #19385

Open andrew-j-hagner opened 1 month ago

andrew-j-hagner commented 1 month ago

Community Note

Terraform Version & Provider Version(s)

Terraform v1.7.5 on linux_arm64

Affected Resource(s)

google_clouddomains_registration

Terraform Configuration

resource "google_clouddomains_registration" my_registration {
  domain_name = "example-domain.com"
  location    = "global"
  labels = {
    labelkey = "labelvalue"
  }
  yearly_price {
    currency_code = "USD"
    units         = 12
  }
  dns_settings {
    custom_dns {
      name_servers = [
        "ns-cloud-a1.googledomains.com.", 
        "ns-cloud-a2.googledomains.com.", 
        "ns-cloud-a3.googledomains.com.", 
        "ns-cloud-a4.googledomains.com."
      ]
    }
  }
  contact_settings {
    privacy = "REDACTED_CONTACT_DATA"
    registrant_contact {
      phone_number = "+12345000000"
      email        = "user@example.com"
      postal_address {
        region_code         = "US"
        postal_code         = "95050"
        administrative_area = "CA"
        locality            = "Example City"
        address_lines       = ["1234 Example street"]
        recipients          = ["example recipient"]
      }
    }
    admin_contact {
      phone_number = "+12345000000"
      email        = "user@example.com"
      postal_address {
        region_code         = "US"
        postal_code         = "95050"
        administrative_area = "CA"
        locality            = "Example City"
        address_lines       = ["1234 Example street"]
        recipients          = ["example recipient"]
      }
    }
    technical_contact {
      phone_number = "+12345000000"
      email        = "user@example.com"
      postal_address {
        region_code         = "US"
        postal_code         = "95050"
        administrative_area = "CA"
        locality            = "Example City"
        address_lines       = ["1234 Example street"]
        recipients          = ["example recipient"]
      }
    }
  }
}

Debug Output

https://gist.github.com/andrew-j-hagner/0345779fe348c5c8a608e2c7498848f5

Expected Behavior

Contact setting changes should not trigger a re-create, as you can make these changes through the console UI and this resource doesn't actually support re-creation anyway.

Actual Behavior

Changing a contact email address triggers a re-create.

Steps to reproduce

  1. Use the exact example provided on the resource documentation page to register a new domain
  2. Change the contact email address and the plan will show the resource needs to be re-created

Important Factoids

Nothing atypical. You should be able to reproduce easily with the resource documentation example. Note the example has another issue where the nameservers show up as a re-create change as well (the last '.' character gets stripped during initial apply).

References

No response

b/366013973

ggtisc commented 1 month ago

Confirmed issue!

This always forces to add and destroy instead of update-in-place