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
319 stars 365 forks source link

Backends and path matching not applied #458

Open red8888 opened 1 month ago

red8888 commented 1 month ago

TL;DR

I can apply the config without error. All backends are created, but only the default backend is attached and none of my path matching rules are applied.

Expected behavior

I should have all my backends created and attached with the pathing rules.

Observed behavior

Backends are created but only the default backend is attached.

Terraform Configuration

module "test_dev" {
  source  = "GoogleCloudPlatform/lb-http/google//modules/serverless_negs"
  project = "sdfsfds"

  name = "test-dev"

  # Makes this a global application load balancer
  load_balancing_scheme = "EXTERNAL_MANAGED"

  address        = google_compute_global_address.test_dev.address
  create_address = false

  ssl              = true
  ssl_certificates = google_compute_managed_ssl_certificate.test_dev[*].self_link
  https_redirect   = true

  backends = {

    ############## Default route ##############
    default = {
      custom_request_headers = ["host: test-876876876.us-central1.run.app"]
      groups = [
        {
          group = google_compute_global_network_endpoint_group.hello_test.id
        }
      ]
      iap_config = {
        enable           = true
        oauth2_client_id = google_iap_client.testing.client_id
        oauth2_client_secret = google_iap_client.testing.secret
      }
      protocol   = "HTTPS"
      enable_cdn = false
      log_config = {
        enable      = true
        sample_rate = 1.0
      }
    }

    ############## This backend is created but not attached ##############
    testing123 = {
      path_rules = ["/testing123/*"]
      custom_request_headers = ["host: testing123-2342432.us-central1.run.app"]
      groups = [
        {
          group = google_compute_global_network_endpoint_group.testing54354.id
        }
      ]
      iap_config = {
        enable           = true
        oauth2_client_id = google_iap_client.testing.client_id
        oauth2_client_secret = google_iap_client.testing.secret
      }
      protocol   = "HTTPS"
      enable_cdn = false
      log_config = {
        enable      = true
        sample_rate = 1.0
      }
    }
  }
}

Terraform Version

Terraform v1.9.5
on darwin_arm64
+ provider registry.terraform.io/hashicorp/google v6.6.0
+ provider registry.terraform.io/hashicorp/google-beta v6.6.0
+ provider registry.terraform.io/hashicorp/null v3.2.3
+ provider registry.terraform.io/hashicorp/random v3.6.3
+ provider registry.terraform.io/hashicorp/time v0.12.1

Additional information

No response