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

Dedicated resource for private DNS zone network association #13999

Open munavirch opened 1 year ago

munavirch commented 1 year ago

Community Note

Description

There is no option now to add a network after creation of a managed zone. Which limits the usage in two ways:

  1. Can only add additional networks if the managed zone itself is managed
  2. If the zone is managed, can't add additional networks outside terraform

We have both of this use case and only option we current have is to ignore lifecycle changes to the private_visibility_config

New or Affected Resource(s)

google_dns_managed_zone_network

Potential Terraform Configuration

resource "google_dns_managed_zone_network" "private_association" {
  zone      = google_dns_managed_zone.example-zone.id
  network = google_compute_network.vpc_network.id
}

References

rileykarson commented 1 year ago

@SarahFrench to investigate

SarahFrench commented 1 year ago

I figured I'd post a summary as part of triaging:

The request is for a 'binding' resource to control relationships between two resources. Currently, the API enforces that the associations between a DNS managed zone and VPC networks are stored within the API's managed zone resource in the privateVisibilityConfig.networks[] list. The provider's google_dns_managed_zone resource enforces this as it mirrors the API structure. The new binding resource could potentially use the API's patch endpoint to selectively update that field.