Merge branch 'master' into patch-1
This commit is contained in:
commit
2ff14b29fd
|
@ -1,6 +1,6 @@
|
|||
# Google Cloud DNS Module
|
||||
|
||||
This module allows simple management of Google Cloud DNS zones and records. It supports creating public, private, forwarding, peering and service directory based zones.
|
||||
This module allows simple management of Google Cloud DNS zones and records. It supports creating public, private, forwarding, peering, service directory and reverse-managed based zones.
|
||||
|
||||
For DNSSEC configuration, refer to the [`dns_managed_zone` documentation](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/dns_managed_zone#dnssec_config).
|
||||
|
||||
|
@ -86,6 +86,20 @@ module "private-dns" {
|
|||
}
|
||||
# tftest modules=1 resources=4
|
||||
```
|
||||
|
||||
### Reverse Lookup Zone
|
||||
|
||||
```hcl
|
||||
module "private-dns" {
|
||||
source = "./fabric/modules/dns"
|
||||
project_id = "myproject"
|
||||
type = "reverse-managed"
|
||||
name = "test-example"
|
||||
domain = "0.0.10.in-addr.arpa."
|
||||
client_networks = [var.vpc.self_link]
|
||||
}
|
||||
# tftest modules=1 resources=1
|
||||
```
|
||||
<!-- BEGIN TFDOC -->
|
||||
|
||||
## Variables
|
||||
|
@ -103,7 +117,7 @@ module "private-dns" {
|
|||
| [peer_network](variables.tf#L77) | Peering network self link, only valid for 'peering' zone types. | <code>string</code> | | <code>null</code> |
|
||||
| [recordsets](variables.tf#L88) | Map of DNS recordsets in \"type name\" => {ttl, [records]} format. | <code title="map(object({ ttl = optional(number, 300) records = optional(list(string)) geo_routing = optional(list(object({ location = string records = list(string) }))) wrr_routing = optional(list(object({ weight = number records = list(string) }))) }))">map(object({…}))</code> | | <code>{}</code> |
|
||||
| [service_directory_namespace](variables.tf#L123) | Service directory namespace id (URL), only valid for 'service-directory' zone types. | <code>string</code> | | <code>null</code> |
|
||||
| [type](variables.tf#L129) | Type of zone to create, valid values are 'public', 'private', 'forwarding', 'peering', 'service-directory'. | <code>string</code> | | <code>"private"</code> |
|
||||
| [type](variables.tf#L129) | Type of zone to create, valid values are 'public', 'private', 'forwarding', 'peering', 'service-directory','reverse-managed'. | <code>string</code> | | <code>"private"</code> |
|
||||
| [zone_create](variables.tf#L139) | Create zone. When set to false, uses a data source to reference existing zone. | <code>bool</code> | | <code>true</code> |
|
||||
|
||||
## Outputs
|
||||
|
|
|
@ -66,13 +66,14 @@ locals {
|
|||
}
|
||||
|
||||
resource "google_dns_managed_zone" "non-public" {
|
||||
count = (var.zone_create && var.type != "public") ? 1 : 0
|
||||
provider = google-beta
|
||||
project = var.project_id
|
||||
name = var.name
|
||||
dns_name = var.domain
|
||||
description = var.description
|
||||
visibility = "private"
|
||||
count = (var.zone_create && var.type != "public") ? 1 : 0
|
||||
provider = google-beta
|
||||
project = var.project_id
|
||||
name = var.name
|
||||
dns_name = var.domain
|
||||
description = var.description
|
||||
visibility = "private"
|
||||
reverse_lookup = (var.type == "reverse-managed")
|
||||
|
||||
dynamic "forwarding_config" {
|
||||
for_each = (
|
||||
|
|
|
@ -127,12 +127,12 @@ variable "service_directory_namespace" {
|
|||
}
|
||||
|
||||
variable "type" {
|
||||
description = "Type of zone to create, valid values are 'public', 'private', 'forwarding', 'peering', 'service-directory'."
|
||||
description = "Type of zone to create, valid values are 'public', 'private', 'forwarding', 'peering', 'service-directory','reverse-managed'."
|
||||
type = string
|
||||
default = "private"
|
||||
validation {
|
||||
condition = contains(["public", "private", "forwarding", "peering", "service-directory"], var.type)
|
||||
error_message = "Zone must be one of 'public', 'private', 'forwarding', 'peering', 'service-directory'."
|
||||
condition = contains(["public", "private", "forwarding", "peering", "service-directory", "reverse-managed"], var.type)
|
||||
error_message = "Zone must be one of 'public', 'private', 'forwarding', 'peering', 'service-directory','reverse-managed'."
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue