Skip to content

Commit

Permalink
Terraform: Cloud DNS Peering
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
drebes authored and modular-magician committed Apr 3, 2019
1 parent fe359ee commit 428e12e
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 5 deletions.
11 changes: 6 additions & 5 deletions google/resource_dns_managed_zone.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
50 changes: 50 additions & 0 deletions website/docs/r/dns_managed_zone.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,56 @@ resource "google_compute_network" "network-2" {
auto_create_subnetworks = false
}
```
<div class = "oics-button" style="float: right; margin: 0 0 -15px">
<a href="https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=dns_managed_zone_private_peering&cloudshell_image=gcr.io%2Fgraphite-cloud-shell-images%2Fterraform%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md" target="_blank">
<img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;">
</a>
</div>
## 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

Expand Down

0 comments on commit 428e12e

Please sign in to comment.