From 428e12e3c6b18eed0057e3bb8b76074789106e6e Mon Sep 17 00:00:00 2001 From: Roberto Jung Drebes Date: Wed, 3 Apr 2019 21:47:44 +0000 Subject: [PATCH] Terraform: Cloud DNS Peering Signed-off-by: Modular Magician --- google/resource_dns_managed_zone.go | 11 ++-- website/docs/r/dns_managed_zone.html.markdown | 50 +++++++++++++++++++ 2 files changed, 56 insertions(+), 5 deletions(-) diff --git a/google/resource_dns_managed_zone.go b/google/resource_dns_managed_zone.go index 5094dc105c1..cca9411ba29 100644 --- a/google/resource_dns_managed_zone.go +++ b/google/resource_dns_managed_zone.go @@ -88,11 +88,12 @@ func resourceDnsManagedZone() *schema.Resource { }, }, "visibility": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - ValidateFunc: validation.StringInSlice([]string{"private", "public", ""}, false), - Default: "public", + Type: schema.TypeString, + Optional: true, + ForceNew: true, + ValidateFunc: validation.StringInSlice([]string{"private", "public", ""}, false), + DiffSuppressFunc: caseDiffSuppress, + Default: "public", }, "name_servers": { Type: schema.TypeList, diff --git a/website/docs/r/dns_managed_zone.html.markdown b/website/docs/r/dns_managed_zone.html.markdown index 43633af7cdd..67298a23d62 100644 --- a/website/docs/r/dns_managed_zone.html.markdown +++ b/website/docs/r/dns_managed_zone.html.markdown @@ -139,6 +139,56 @@ resource "google_compute_network" "network-2" { auto_create_subnetworks = false } ``` + +## Example Usage - Dns Managed Zone Private Peering + + +```hcl +resource "google_dns_managed_zone" "peering-zone" { + provider = "google-beta" + + name = "peering-zone" + dns_name = "peering.example.com." + description = "Example private DNS peering zone" + + visibility = "private" + + private_visibility_config { + networks { + network_url = "${google_compute_network.network-source.self_link}" + } + } + + peering_config { + target_network { + network_url = "${google_compute_network.network-target.self_link}" + } + } +} + +resource "google_compute_network" "network-source" { + provider = "google-beta" + + name = "network-source" + auto_create_subnetworks = false +} + +resource "google_compute_network" "network-target" { + provider = "google-beta" + + name = "network-target" + auto_create_subnetworks = false +} + +provider "google-beta" { + region = "us-central1" + zone = "us-central1-a" +} +``` ## Argument Reference