From 064d86511f4c71375ba1d84893a296dcfbc41cd8 Mon Sep 17 00:00:00 2001 From: Miren Esnaola Date: Wed, 14 Jun 2023 19:15:48 +0200 Subject: [PATCH] enable_logging variable was not being used --- modules/dns/README.md | 2 +- modules/dns/main.tf | 8 ++++++-- modules/dns/variables.tf | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/dns/README.md b/modules/dns/README.md index e6d46a54..d542fd88 100644 --- a/modules/dns/README.md +++ b/modules/dns/README.md @@ -129,7 +129,7 @@ module "public-dns" { | [client_networks](variables.tf#L21) | List of VPC self links that can see this zone. | list(string) | | [] | | [description](variables.tf#L28) | Domain description. | string | | "Terraform managed." | | [dnssec_config](variables.tf#L34) | DNSSEC configuration for this zone. | object({…}) | | {…} | -| [enable_logging](variables.tf#L59) | Enable query logging for this zone. Only valid for public zones. | bool | | false | +| [enable_logging](variables.tf#L59) | Enable query logging for this zone. | bool | | false | | [forwarders](variables.tf#L66) | Map of {IPV4_ADDRESS => FORWARDING_PATH} for 'forwarding' zone types. Path can be 'default', 'private', or null for provider default. | map(string) | | {} | | [peer_network](variables.tf#L77) | Peering network self link, only valid for 'peering' zone types. | string | | null | | [recordsets](variables.tf#L88) | Map of DNS recordsets in \"type name\" => {ttl, [records]} format. | map(object({…})) | | {} | diff --git a/modules/dns/main.tf b/modules/dns/main.tf index edf342ef..8c3b56fd 100644 --- a/modules/dns/main.tf +++ b/modules/dns/main.tf @@ -131,7 +131,9 @@ resource "google_dns_managed_zone" "non-public" { } } } - + cloud_logging_config { + enable_logging = var.enable_logging + } } data "google_dns_managed_zone" "public" { @@ -171,7 +173,9 @@ resource "google_dns_managed_zone" "public" { } } } - + cloud_logging_config { + enable_logging = var.enable_logging + } } data "google_dns_keys" "dns_keys" { diff --git a/modules/dns/variables.tf b/modules/dns/variables.tf index df80976e..5e62489a 100644 --- a/modules/dns/variables.tf +++ b/modules/dns/variables.tf @@ -57,7 +57,7 @@ variable "domain" { } variable "enable_logging" { - description = "Enable query logging for this zone. Only valid for public zones." + description = "Enable query logging for this zone." type = bool default = false nullable = false