-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 advanced routing rules for External HTTP(s) Load Balancers #6634
Comments
@Hmerac Can you see if below code works for you? resource "google_compute_url_map" "urlmap" {
name = "urlmap"
description = "header-based routing example"
default_service = google_compute_backend_service.default.id
host_rule {
hosts = ["*"]
path_matcher = "allpaths"
}
path_matcher {
name = "allpaths"
default_service = google_compute_backend_service.default.id
route_rules {
priority = 1
service = google_compute_backend_service.service-a.id
match_rules {
prefix_match = "/"
ignore_case = true
header_matches {
header_name = "abtest"
exact_match = "a"
}
}
}
route_rules {
priority = 2
service = google_compute_backend_service.service-b.id
match_rules {
ignore_case = true
prefix_match = "/"
header_matches {
header_name = "abtest"
exact_match = "b"
}
}
}
}
} |
I actually tried to apply the same logic with GCP provider version of v3.25.0, that's how I got the error. Did this work for you? |
@Hmerac what error do you receive if above code does not work for you? Can you share your debug log? |
@edwardmedia I cannot reproduce the same case now because we've proceeded with Istio to do the header-based routing. But, as far as I remember the only error we received was:
Which I believe is quite understandable, looking at the terraform docs for |
@Hmerac routeRules should work for External load balancers now. The doc is out of date, and we are going to update it. I am closing this issue. Please feel free to reopen it if you see the error |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks! |
Community Note
Description
We tried to use header-based routing for one of our External HTTP(s) Load Balancers by
header_matches
, but receivedAdvanced routing rules are not supported for scheme EXTERNAL, invalid
error.As Terraform documentation for compute_url_map states, advanced routing such as header-based routing is not possible for External HTTP(s) Load Balancers. Yet, on GCP documentation, it's possible with gcloud utility but not via Console. You can see it in below documentations:
New or Affected Resource(s)
The text was updated successfully, but these errors were encountered: