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

Add Support for Host and Path Rules in URL Maps for HTTP Load Balancer with Serverless NEG #466

Open
bruno561 opened this issue Nov 8, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@bruno561
Copy link

bruno561 commented Nov 8, 2024

TL;DR

Add support for configuring host and path rules in URL maps within the terraform-google-lb-http module, allowing users to define multiple host and path matchers when using HTTP Load Balancer with Serverless NEGs.

Terraform Resources

Terraform Resources:

  • google_compute_url_map
  • google_compute_backend_service

Detailed design

Currently, the terraform-google-lb-http module does not support host and path rules customization for URL maps. To enhance flexibility, we recommend adding variables that allow users to define both host rules and path matchers. Here’s an example design for reference:

New Variable Proposal:

host_and_path_rules: This variable could be a list of objects, each containing both host and path specifications.
Example Configuration:

variable "host_and_path_rules" {
  type = list(object({
    host        = list(string)
    path_matcher = object({
      name          = string
      default_service = string
      path_rules = list(object({
        paths   = list(string)
        service = string
      }))
    })
  }))
  default = []
}

In the module’s google_compute_url_map resource, dynamic blocks could be used to iterate through host_and_path_rules, creating the necessary host_rule and path_matcher configurations.

This enhancement will provide users with the flexibility to configure complex routing scenarios within a single load balancer, improving manageability and reducing the need for custom module modifications.

Additional information

Adding support for this feature will make it easier for users who require specific path-based routing rules alongside host rules, especially for applications using Cloud Run, App Engine, and Cloud Functions within a shared load balancer. This addition is expected to reduce the need for manual module customization, improving the usability of the module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant