Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow using dynamically generated address in LB modules NEGs #1061

Merged
merged 5 commits into from Dec 21, 2022

Conversation

ludoo
Copy link
Collaborator

@ludoo ludoo commented Dec 21, 2022

This will also need to be implemented for the GLB module before this PR is ready. Fixes #1055

Tested with this example:

resource "google_compute_address" "ilb-l7-test" {
  project      = module.project-svc-gce.project_id
  name         = "test-ilb-l7"
  subnetwork   = local.subnet_self_links["gce:ew8"]
  address_type = "INTERNAL"
  region       = "europe-west8"
}

module "ilb-l7-test-0" {
  source     = "../cloud-foundation-fabric/modules/net-ilb-l7"
  project_id = module.project-svc-gce.project_id
  region     = "europe-west8"
  name       = "test-0"
  address    = google_compute_address.ilb-l7-test.address
  backend_service_configs = {
    default = {
      project_id = module.project-svc-gce.project_id
      backends = [
        for k, v in module.gce-nginx-ew8 : { group = v.group.id }
      ]
    }
  }
  vpc_config = {
    network    = module.vpc-shared.self_link
    subnetwork = local.subnet_self_links["gce:ew8"]
  }
}

module "ilb-l7-test-1" {
  source     = "../cloud-foundation-fabric/modules/net-ilb-l7"
  project_id = module.project-svc-gce.project_id
  region     = "europe-west8"
  name       = "test-1"
  backend_service_configs = {
    default = {
      backends = [{
        balancing_mode = "RATE"
        group          = "neg-0"
        max_rate       = { per_endpoint = 1 }
      }]
    }
  }
  neg_configs = {
    neg-0 = {
      hybrid = {
        zone = "europe-west8-b"
        endpoints = {
          e-0 = {
            ip_address = google_compute_address.ilb-l7-test.address
            port       = 80
          }
        }
      }
    }
  }
  vpc_config = {
    network    = module.vpc-shared.self_link
    subnetwork = local.subnet_self_links["gce:ew8"]
  }
}

@ludoo ludoo added the incompatible change Pull request that breaks compatibility with previous version label Dec 21, 2022
@ludoo ludoo marked this pull request as ready for review December 21, 2022 15:51
@ludoo ludoo enabled auto-merge (squash) December 21, 2022 15:54
@ludoo ludoo merged commit b438e0c into master Dec 21, 2022
@ludoo ludoo deleted the ludo/issue-1055 branch December 21, 2022 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
incompatible change Pull request that breaks compatibility with previous version on:modules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hybrid neg with ip_address obtained at runtime in net-ilb-l7 module
2 participants