2018-11-16 22:53:46 +00:00
|
|
|
---
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
|
|
|
|
#
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# This file is automatically generated by Magic Modules and manual
|
|
|
|
# changes will be clobbered when the file is regenerated.
|
|
|
|
#
|
|
|
|
# Please read more about how to change this file in
|
|
|
|
# .github/CONTRIBUTING.md.
|
|
|
|
#
|
|
|
|
# ----------------------------------------------------------------------------
|
|
|
|
layout: "google"
|
|
|
|
page_title: "Google: google_dns_managed_zone"
|
|
|
|
sidebar_current: "docs-google-dns-managed-zone"
|
|
|
|
description: |-
|
|
|
|
A zone is a subtree of the DNS namespace under one administrative
|
|
|
|
responsibility.
|
|
|
|
---
|
|
|
|
|
|
|
|
# google\_dns\_managed\_zone
|
|
|
|
|
|
|
|
A zone is a subtree of the DNS namespace under one administrative
|
|
|
|
responsibility. A ManagedZone is a resource that represents a DNS zone
|
|
|
|
hosted by the Cloud DNS service.
|
|
|
|
|
|
|
|
|
|
|
|
To get more information about ManagedZone, see:
|
|
|
|
|
|
|
|
* [API documentation](https://cloud.google.com/dns/api/v1/managedZones)
|
|
|
|
* How-to Guides
|
|
|
|
* [Managing Zones](https://cloud.google.com/dns/zones/)
|
|
|
|
|
|
|
|
<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_basic&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 Basic
|
|
|
|
|
|
|
|
|
|
|
|
```hcl
|
|
|
|
resource "google_dns_managed_zone" "example-zone" {
|
|
|
|
name = "example-zone"
|
|
|
|
dns_name = "example-${random_id.rnd.hex}.com."
|
|
|
|
description = "Example DNS zone"
|
|
|
|
labels = {
|
|
|
|
foo = "bar"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "random_id" "rnd" {
|
|
|
|
byte_length = 4
|
|
|
|
}
|
|
|
|
```
|
2019-02-15 22:44:07 +00:00
|
|
|
## Example Usage - Dns Managed Zone Private
|
|
|
|
|
|
|
|
|
|
|
|
```hcl
|
|
|
|
resource "google_dns_managed_zone" "private-zone" {
|
|
|
|
name = "private-zone"
|
|
|
|
dns_name = "private.example.com."
|
|
|
|
description = "Example private DNS zone"
|
|
|
|
labels = {
|
|
|
|
foo = "bar"
|
|
|
|
}
|
|
|
|
|
|
|
|
visibility = "private"
|
|
|
|
|
|
|
|
private_visibility_config {
|
|
|
|
networks {
|
|
|
|
network_url = "${google_compute_network.network-1.self_link}"
|
|
|
|
}
|
|
|
|
networks {
|
|
|
|
network_url = "${google_compute_network.network-2.self_link}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
forwarding_config {
|
|
|
|
target_name_servers {
|
|
|
|
ipv4_address = "172.16.1.10"
|
|
|
|
}
|
|
|
|
target_name_servers {
|
|
|
|
ipv4_address = "172.16.1.20"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "google_compute_network" "network-1" {
|
|
|
|
name = "network-1"
|
|
|
|
auto_create_subnetworks = false
|
|
|
|
}
|
|
|
|
|
|
|
|
resource "google_compute_network" "network-2" {
|
|
|
|
name = "network-2"
|
|
|
|
auto_create_subnetworks = false
|
|
|
|
}
|
|
|
|
```
|
2018-11-16 22:53:46 +00:00
|
|
|
|
|
|
|
## Argument Reference
|
|
|
|
|
|
|
|
The following arguments are supported:
|
|
|
|
|
|
|
|
|
|
|
|
* `dns_name` -
|
|
|
|
(Required)
|
|
|
|
The DNS name of this managed zone, for instance "example.com.".
|
|
|
|
|
|
|
|
* `name` -
|
|
|
|
(Required)
|
|
|
|
User assigned name for this resource.
|
|
|
|
Must be unique within the project.
|
|
|
|
|
|
|
|
|
|
|
|
- - -
|
|
|
|
|
|
|
|
|
|
|
|
* `description` -
|
|
|
|
(Optional)
|
|
|
|
A textual description field. Defaults to 'Managed by Terraform'.
|
|
|
|
|
|
|
|
* `labels` -
|
|
|
|
(Optional)
|
|
|
|
A set of key/value label pairs to assign to this ManagedZone.
|
|
|
|
* `project` - (Optional) The ID of the project in which the resource belongs.
|
|
|
|
If it is not provided, the provider project is used.
|
|
|
|
|
|
|
|
|
|
|
|
## Attributes Reference
|
|
|
|
|
|
|
|
In addition to the arguments listed above, the following computed attributes are exported:
|
|
|
|
|
|
|
|
|
|
|
|
* `name_servers` -
|
|
|
|
Delegate your managed_zone to these virtual name servers;
|
|
|
|
defined by the server
|
|
|
|
|
|
|
|
|
2018-12-13 01:28:44 +00:00
|
|
|
## Timeouts
|
|
|
|
|
|
|
|
This resource provides the following
|
|
|
|
[Timeouts](/docs/configuration/resources.html#timeouts) configuration options:
|
|
|
|
|
|
|
|
- `create` - Default is 4 minutes.
|
|
|
|
- `update` - Default is 4 minutes.
|
|
|
|
- `delete` - Default is 4 minutes.
|
2018-11-16 22:53:46 +00:00
|
|
|
|
|
|
|
## Import
|
|
|
|
|
|
|
|
ManagedZone can be imported using any of these accepted formats:
|
|
|
|
|
|
|
|
```
|
|
|
|
$ terraform import google_dns_managed_zone.default projects/{{project}}/managedZones/{{name}}
|
|
|
|
$ terraform import google_dns_managed_zone.default {{project}}/{{name}}
|
|
|
|
$ terraform import google_dns_managed_zone.default {{name}}
|
|
|
|
```
|
2018-12-18 21:04:43 +00:00
|
|
|
|
2018-12-20 18:29:39 +00:00
|
|
|
-> If you're importing a resource with beta features, make sure to include `-provider=google-beta`
|
2018-12-18 21:04:43 +00:00
|
|
|
as an argument so that Terraform uses the correct provider to import your resource.
|