From 7437a02c43976d2d0562701669c8c30cdff1e929 Mon Sep 17 00:00:00 2001 From: Dave Cunningham Date: Thu, 30 Apr 2015 01:32:34 -0400 Subject: [PATCH] Support Google Cloud DNS, Fix #1148 --- r/dns_managed_zone.markdown | 42 ++++++++++++++++++++++++ r/dns_record_set.markdown | 64 +++++++++++++++++++++++++++++++++++++ 2 files changed, 106 insertions(+) create mode 100644 r/dns_managed_zone.markdown create mode 100644 r/dns_record_set.markdown diff --git a/r/dns_managed_zone.markdown b/r/dns_managed_zone.markdown new file mode 100644 index 00000000..f3e650a2 --- /dev/null +++ b/r/dns_managed_zone.markdown @@ -0,0 +1,42 @@ +--- +layout: "google" +page_title: "Google: google_dns_managed_zone" +sidebar_current: "docs-google-resource-dns-managed-zone" +description: |- + Manages a zone within Google Cloud DNS. +--- + +# google\_dns\_managed_zone + +Manages a zone within Google Cloud DNS. + +## Example Usage + +``` +resource "google_dns_managed_zone" "prod" { + name = "prod-zone" + dns_name = "prod.mydomain.com." + description = "Production DNS zone" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `name` - (Required) A unique name for the resource, required by GCE. + Changing this forces a new resource to be created. + +* `dns_name` - (Required) The DNS name of this zone, e.g. "terraform.io". + +* `description` - (Optional) A textual description field. + +## Attributes Reference + +The following attributes are exported: + +* `name` - The name of the resource. +* `dns_name` - The DNS name of this zone. +* `name_servers` - The list of nameservers that will be authoritative for this + domain. Use NS records to redirect from your DNS provider to these names, +thus making Google Cloud DNS authoritative for this zone. diff --git a/r/dns_record_set.markdown b/r/dns_record_set.markdown new file mode 100644 index 00000000..79ad2eb3 --- /dev/null +++ b/r/dns_record_set.markdown @@ -0,0 +1,64 @@ +--- +layout: "google" +page_title: "Google: google_dns_record_set" +sidebar_current: "docs-google-dns-record-set" +description: |- + Manages a set of DNS records within Google Cloud DNS. +--- + +# google\_dns\_record\_set + +Manages a set of DNS records within Google Cloud DNS. + +## Example Usage + +This example is the common case of binding a DNS name to the ephemeral IP of a new instance: + +``` +resource "google_compute_instance" "frontend" { + name = "frontend" + machine_type = "g1-small" + zone = "us-central1-b" + + disk { + image = "debian-7-wheezy-v20140814" + } + + network_interface { + network = "default" + access_config { + } + } +} +resource "google_dns_managed_zone" "prod" { + name = "prod-zone" + dns_name = "prod.mydomain.com." +} + +resource "google_dns_record_set" "frontend" { + managed_zone = "${google_dns_managed_zone.prod.name}" + name = "frontend.${google_dns_managed_zone.prod.dns_name}" + type = "A" + ttl = 300 + rrdatas = ["${google_compute_instance.frontend.network_interface.0.access_config.0.nat_ip}"] +} +``` + +## Argument Reference + +The following arguments are supported: + +* `managed_zone` - (Required) The name of the zone in which this record set will reside. + +* `name` - (Required) The DNS name this record set will apply to. + +* `type` - (Required) The DNS record set type. + +* `ttl` - (Required) The time-to-live of this record set (seconds). + +* `rrdatas` - (Required) The string data for the records in this record set + whose meaning depends on the DNS type. + +## Attributes Reference + +All arguments are available as attributes.