@@ -154,6 +154,33 @@ resource "google_compute_region_health_check" "health_check" {
154
154
}
155
155
}
156
156
```
157
+ <div class = " oics-button " style =" float : right ; margin : 0 0 -15px " >
158
+ <a href =" https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.jpy.wang%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=region_backend_service_external_weighted&cloudshell_image=gcr.io%2Fgraphite-cloud-shell-images%2Fterraform%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md " target =" _blank " >
159
+ <img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;">
160
+ </a >
161
+ </div >
162
+ ## Example Usage - Region Backend Service External Weighted
163
+
164
+
165
+ ``` hcl
166
+ resource "google_compute_region_backend_service" "default" {
167
+ region = "us-central1"
168
+ name = "region-service"
169
+ health_checks = [google_compute_region_health_check.health_check.id]
170
+ protocol = "TCP"
171
+ load_balancing_scheme = "EXTERNAL"
172
+ locality_lb_policy = "WEIGHTED_MAGLEV"
173
+ }
174
+
175
+ resource "google_compute_region_health_check" "health_check" {
176
+ name = "rbs-health-check"
177
+ region = "us-central1"
178
+
179
+ http_health_check {
180
+ port = 80
181
+ }
182
+ }
183
+ ```
157
184
<div class = " oics-button " style =" float : right ; margin : 0 0 -15px " >
158
185
<a href =" https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.jpy.wang%2Fterraform-google-modules%2Fdocs-examples.git&cloudshell_working_dir=region_backend_service_ilb_ring_hash&cloudshell_image=gcr.io%2Fgraphite-cloud-shell-images%2Fterraform%3Alatest&open_in_editor=main.tf&cloudshell_print=.%2Fmotd&cloudshell_tutorial=.%2Ftutorial.md " target =" _blank " >
159
186
<img alt="Open in Cloud Shell" src="//gstatic.com/cloudssh/images/open-btn.svg" style="max-height: 44px; margin: 32px auto; max-width: 100%;">
@@ -432,18 +459,33 @@ The following arguments are supported:
432
459
Maglev is not as stable as ring hash but has faster table lookup
433
460
build times and host selection times. For more information about
434
461
Maglev, refer to https://ai.google/research/pubs/pub44824
462
+ * ` WEIGHTED_MAGLEV ` : Per-instance weighted Load Balancing via health check
463
+ reported weights. If set, the Backend Service must
464
+ configure a non legacy HTTP-based Health Check, and
465
+ health check replies are expected to contain
466
+ non-standard HTTP response header field
467
+ X-Load-Balancing-Endpoint-Weight to specify the
468
+ per-instance weights. If set, Load Balancing is weight
469
+ based on the per-instance weights reported in the last
470
+ processed health check replies, as long as every
471
+ instance either reported a valid weight or had
472
+ UNAVAILABLE_WEIGHT. Otherwise, Load Balancing remains
473
+ equal-weight.
435
474
436
475
This field is applicable to either:
437
476
* A regional backend service with the service_protocol set to HTTP, HTTPS, or HTTP2,
438
477
and loadBalancingScheme set to INTERNAL_MANAGED.
439
478
* A global backend service with the load_balancing_scheme set to INTERNAL_SELF_MANAGED.
479
+ * A regional backend service with loadBalancingScheme set to EXTERNAL (External Network
480
+ Load Balancing). Only MAGLEV and WEIGHTED_MAGLEV values are possible for External
481
+ Network Load Balancing. The default is MAGLEV.
440
482
441
- If session_affinity is not NONE, and this field is not set to MAGLEV or RING_HASH ,
442
- session affinity settings will not take effect.
483
+ If session_affinity is not NONE, and this field is not set to MAGLEV, WEIGHTED_MAGLEV ,
484
+ or RING_HASH, session affinity settings will not take effect.
443
485
Only ROUND_ROBIN and RING_HASH are supported when the backend service is referenced
444
486
by a URL map that is bound to target gRPC proxy that has validate_for_proxyless
445
487
field set to true.
446
- Possible values are ` ROUND_ROBIN ` , ` LEAST_REQUEST ` , ` RING_HASH ` , ` RANDOM ` , ` ORIGINAL_DESTINATION ` , and ` MAGLEV ` .
488
+ Possible values are ` ROUND_ROBIN ` , ` LEAST_REQUEST ` , ` RING_HASH ` , ` RANDOM ` , ` ORIGINAL_DESTINATION ` , ` MAGLEV ` , and ` WEIGHTED_MAGLEV ` .
447
489
448
490
* ` outlier_detection ` -
449
491
(Optional)
0 commit comments