fix DNS module internal zone lookup

This commit is contained in:
Ludovico Magnocavallo 2020-04-22 15:43:48 +02:00
parent ee27878212
commit 152c172b55
3 changed files with 10 additions and 6 deletions

View File

@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file.
## [Unreleased]
- fix DNS module internal zone lookup
## [1.3.0] - 2020-04-08
- add organization policy module

View File

@ -20,9 +20,11 @@ locals {
for record in var.recordsets :
join("/", [record.name, record.type]) => record
}
zone = element(concat(
google_dns_managed_zone.non-public, google_dns_managed_zone.public
), 0)
zone = try(
google_dns_managed_zone.non-public.0, try(
google_dns_managed_zone.public.0, null
)
)
}
resource "google_dns_managed_zone" "non-public" {

View File

@ -26,15 +26,15 @@ output "zone" {
output "name" {
description = "The DNS zone name."
value = local.zone.name
value = try(local.zone.name, null)
}
output "domain" {
description = "The DNS zone domain."
value = local.zone.dns_name
value = try(local.zone.dns_name, null)
}
output "name_servers" {
description = "The DNS zone name servers."
value = local.zone.name_servers
value = try(local.zone.name_servers, null)
}