2015-04-30 05:32:34 +00:00
|
|
|
---
|
|
|
|
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:
|
|
|
|
|
2016-04-10 21:34:15 +00:00
|
|
|
```js
|
2015-04-30 05:32:34 +00:00
|
|
|
resource "google_compute_instance" "frontend" {
|
2016-04-10 21:34:15 +00:00
|
|
|
name = "frontend"
|
|
|
|
machine_type = "g1-small"
|
|
|
|
zone = "us-central1-b"
|
|
|
|
|
|
|
|
disk {
|
2016-08-19 00:23:15 +00:00
|
|
|
image = "debian-cloud/debian-8"
|
2016-04-10 21:34:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
network_interface {
|
|
|
|
network = "default"
|
|
|
|
access_config {}
|
|
|
|
}
|
2015-04-30 05:32:34 +00:00
|
|
|
}
|
|
|
|
resource "google_dns_managed_zone" "prod" {
|
2016-04-10 21:34:15 +00:00
|
|
|
name = "prod-zone"
|
|
|
|
dns_name = "prod.mydomain.com."
|
2015-04-30 05:32:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
resource "google_dns_record_set" "frontend" {
|
2016-04-10 21:34:15 +00:00
|
|
|
name = "frontend.${google_dns_managed_zone.prod.dns_name}"
|
|
|
|
type = "A"
|
|
|
|
ttl = 300
|
|
|
|
|
|
|
|
managed_zone = "${google_dns_managed_zone.prod.name}"
|
|
|
|
|
|
|
|
rrdatas = ["${google_compute_instance.frontend.network_interface.0.access_config.0.assigned_nat_ip}"]
|
2015-04-30 05:32:34 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Argument Reference
|
|
|
|
|
|
|
|
The following arguments are supported:
|
|
|
|
|
2016-04-10 21:34:15 +00:00
|
|
|
* `managed_zone` - (Required) The name of the zone in which this record set will
|
|
|
|
reside.
|
2015-04-30 05:32:34 +00:00
|
|
|
|
|
|
|
* `name` - (Required) The DNS name this record set will apply to.
|
|
|
|
|
2016-04-10 21:34:15 +00:00
|
|
|
* `rrdatas` - (Required) The string data for the records in this record set
|
|
|
|
whose meaning depends on the DNS type.
|
2015-04-30 05:32:34 +00:00
|
|
|
|
|
|
|
* `ttl` - (Required) The time-to-live of this record set (seconds).
|
|
|
|
|
2016-04-10 21:34:15 +00:00
|
|
|
* `type` - (Required) The DNS record set type.
|
|
|
|
|
|
|
|
- - -
|
|
|
|
|
|
|
|
* `project` - (Optional) The project in which the resource belongs. If it
|
|
|
|
is not provided, the provider project is used.
|
2015-04-30 05:32:34 +00:00
|
|
|
|
|
|
|
## Attributes Reference
|
|
|
|
|
2016-04-10 21:34:15 +00:00
|
|
|
Only the arguments listed above are exposed as attributes.
|