2015-04-30 05:32:34 +00:00
|
|
|
---
|
|
|
|
layout: "google"
|
|
|
|
page_title: "Google: google_dns_managed_zone"
|
2015-10-23 14:10:41 +00:00
|
|
|
sidebar_current: "docs-google-dns-managed-zone"
|
2015-04-30 05:32:34 +00:00
|
|
|
description: |-
|
|
|
|
Manages a zone within Google Cloud DNS.
|
|
|
|
---
|
|
|
|
|
|
|
|
# google\_dns\_managed_zone
|
|
|
|
|
2017-07-31 16:27:18 +00:00
|
|
|
Manages a zone within Google Cloud DNS. For more information see [the official documentation](https://cloud.google.com/dns/zones/) and
|
|
|
|
[API](https://cloud.google.com/dns/api/v1/managedZones).
|
2015-04-30 05:32:34 +00:00
|
|
|
|
|
|
|
## Example Usage
|
|
|
|
|
2017-04-17 10:17:54 +00:00
|
|
|
```hcl
|
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."
|
|
|
|
description = "Production DNS zone"
|
2018-09-07 22:07:27 +00:00
|
|
|
|
|
|
|
labels = {
|
|
|
|
foo = "bar"
|
|
|
|
}
|
2015-04-30 05:32:34 +00:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Argument Reference
|
|
|
|
|
|
|
|
The following arguments are supported:
|
|
|
|
|
2018-04-09 21:51:04 +00:00
|
|
|
* `dns_name` - (Required) The fully qualified DNS name of this zone, e.g. `terraform.io.`.
|
2016-04-10 21:34:15 +00:00
|
|
|
|
2015-04-30 05:32:34 +00:00
|
|
|
* `name` - (Required) A unique name for the resource, required by GCE.
|
|
|
|
Changing this forces a new resource to be created.
|
|
|
|
|
2016-04-10 21:34:15 +00:00
|
|
|
- - -
|
2015-04-30 05:32:34 +00:00
|
|
|
|
2016-03-02 20:01:54 +00:00
|
|
|
* `description` - (Optional) A textual description field. Defaults to 'Managed by Terraform'.
|
2015-04-30 05:32:34 +00:00
|
|
|
|
2018-03-12 20:59:47 +00:00
|
|
|
* `project` - (Optional) The ID of the project in which the resource belongs. If it
|
2016-04-10 21:34:15 +00:00
|
|
|
is not provided, the provider project is used.
|
|
|
|
|
2018-09-07 22:07:27 +00:00
|
|
|
* `labels` - (Optional) A set of key/value label pairs to assign to the instance.
|
|
|
|
|
2015-04-30 05:32:34 +00:00
|
|
|
## Attributes Reference
|
|
|
|
|
2016-04-10 21:34:15 +00:00
|
|
|
In addition to the arguments listed above, the following computed attributes are
|
|
|
|
exported:
|
2015-04-30 05:32:34 +00:00
|
|
|
|
|
|
|
* `name_servers` - The list of nameservers that will be authoritative for this
|
2016-04-10 21:34:15 +00:00
|
|
|
domain. Use NS records to redirect from your DNS provider to these names,
|
|
|
|
thus making Google Cloud DNS authoritative for this zone.
|
2017-06-27 14:07:47 +00:00
|
|
|
|
|
|
|
## Import
|
|
|
|
|
2018-09-07 05:17:40 +00:00
|
|
|
Managed zones can be imported using any of these accepted formats:
|
2017-06-27 14:07:47 +00:00
|
|
|
|
|
|
|
```
|
2018-09-07 04:32:13 +00:00
|
|
|
$ terraform import google_dns_managed_zone.prod projects/{{project-id}}/managedZones/{{zone}}
|
|
|
|
$ terraform import google_compute_disk.default {{project-id}}/managedZones/{{zone}}
|
|
|
|
$ terraform import google_compute_disk.default {{zone}}
|
2017-06-27 14:07:47 +00:00
|
|
|
```
|