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

Feature Request: Support for Multiple Forwarding Rules in net-lb-app-int Module #2561

Open
Nadav23AnT opened this issue Sep 11, 2024 · 0 comments

Comments

@Nadav23AnT
Copy link

Nadav23AnT commented Sep 11, 2024

Feature Request

I am using the net-lb-app-int module from the Cloud Foundation Fabric repository to configure an internal load balancer for my GCP setup. I need to configure multiple forwarding rules (one for HTTP and one for HTTPS), but the module currently does not support defining multiple forwarding rules for the same load balancer.

The current limitation can be seen in the net-lb-app-int module. However, as shown in the attached screenshot from my GCP environment, I need to configure two different frontend rules: one for HTTP (port 80) and one for HTTPS (port 443). The module should be able to handle this use case.

Current Situation:

  • Only one forwarding rule can be configured at a time.
  • Need to configure two forwarding rules (HTTP and HTTPS) for the same load balancer.

Proposed Solution:

  • Extend the net-lb-app-int module to support multiple forwarding rules (e.g., adding a list input for forwarding_rules to allow for multiple protocol and port combinations).
  • Example:
    forwarding_rules = [
      {
        protocol = "HTTP"
        port     = 80
      },
      {
        protocol = "HTTPS"
        port     = 443
      }
    ]
    
    

Example manual configuration:
Screenshot 2024-09-11 112515

using resources:

resource "google_compute_forwarding_rule" "INTERNAL_FWD_RULE_HTTP" {
  name                  = "frontend-80"
  depends_on            = [google_compute_subnetwork.proxy_subnet]
  ip_protocol = "TCP"
  load_balancing_scheme = "INTERNAL_MANAGED"
  target                = google_compute_region_target_http_proxy.default.self_link
  ip_address            = google_compute_address.internal_with_subnet_and_address.address
  network               = google_compute_network.default.id
  subnetwork            = google_compute_subnetwork.default.id
  port_range            = "80"
}
resource "google_compute_forwarding_rule" "INTERNAL_FWD_RULE_HTTPS" {
  name                  = "frontend-443"
  depends_on            = [google_compute_subnetwork.proxy_subnet]
  ip_protocol = "TCP"
  load_balancing_scheme = "INTERNAL_MANAGED"
  target                = google_compute_region_target_https_proxy.default.self_link
  ip_address            = google_compute_address.internal_with_subnet_and_address.address
  network               = google_compute_network.default.id
  subnetwork            = google_compute_subnetwork.default.id
  port_range            = "443"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant