terraform-google-modules / terraform-google-lb-http

Creates a global HTTP load balancer for Compute Engine by using forwarding rules
https://registry.terraform.io/modules/terraform-google-modules/lb-http/google
Apache License 2.0
305 stars 349 forks source link

Logs are not disabled properly #406

Open jcdelmas opened 5 months ago

jcdelmas commented 5 months ago

TL;DR

Logs are not disabled when changing log_config.enable from true to false.

Expected behavior

When I make the change below, the logs should be disabled.

module "lb-http" {
  source  = "GoogleCloudPlatform/lb-http/google//modules/serverless_negs"
  version = "10.1.0"

  backends = {
    default = {
      log_config = {
-       enable = true
+       enable = false
      }
    }
  }
}

Observed behavior

The logs are not disabled.

It should be because the log_config block is removed:

  dynamic "log_config" {
    for_each = lookup(lookup(each.value, "log_config", {}), "enable", true) ? [1] : []
    content {
      enable      = lookup(lookup(each.value, "log_config", {}), "enable", true)
      sample_rate = lookup(lookup(each.value, "log_config", {}), "sample_rate", "1.0")
    }
  }

Terraform Configuration

module "lb-http" {
  source  = "terraform-google-modules/lb-http/google//modules/serverless_negs"
  version = "10.1.0"

  name    = "default"
  project = module.project.id

  ssl                             = true
  managed_ssl_certificate_domains = ["abc123.com"]
  https_redirect                  = true

  backends = {
    default = {
      description = null
      groups = [
        {
          group = google_compute_region_network_endpoint_group.serverless_neg.id
        }
      ]
      enable_cdn = false

      iap_config = {
        enable = false
      }
      log_config = {
        enable = false
      }
    }
  }
}

Terraform Version

1.6.3

Additional information

No response

github-actions[bot] commented 3 months ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

github-actions[bot] commented 1 month ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days