dns_keys output added to the dns module (#97)

* dns_keys output added to the dns module, so DNSSEC attributes like DS entry will be outputed if DNSSEC configuration is provided

* Fix confition for dns_keys data source
This commit is contained in:
Aleksandr Averbukh
2020-06-17 11:43:46 +02:00
committed by GitHub
parent 7a100d08d4
commit ddc2f9c20d
5 changed files with 20 additions and 2 deletions

View File

@@ -15,7 +15,6 @@
*/
locals {
is_static_zone = var.type == "public" || var.type == "private"
recordsets = var.recordsets == null ? {} : {
for record in var.recordsets :
join("/", [record.name, record.type]) => record
@@ -25,6 +24,9 @@ locals {
google_dns_managed_zone.public.0, null
)
)
dns_keys = try(
data.google_dns_keys.dns_keys.0, null
)
}
resource "google_dns_managed_zone" "non-public" {
@@ -120,6 +122,11 @@ resource "google_dns_managed_zone" "public" {
}
data "google_dns_keys" "dns_keys" {
count = var.dnssec_config == {} || var.type != "public" ? 0 : 1
managed_zone = google_dns_managed_zone.public.0.id
}
resource "google_dns_record_set" "cloud-static-records" {
for_each = (
var.type == "public" || var.type == "private"