forked from GoogleCloudPlatform/magic-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add fields to support stateful cookie-based affinity (GoogleCloudPlat…
- Loading branch information
1 parent
222093b
commit 4c47545
Showing
4 changed files
with
153 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
mmv1/templates/terraform/examples/backend_service_stateful_session_affinity.tf.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
resource "google_compute_backend_service" "{{$.PrimaryResourceId}}" { | ||
provider = google-beta | ||
|
||
name = "{{index $.Vars "backend_service_name"}}" | ||
health_checks = [google_compute_health_check.health_check.id] | ||
load_balancing_scheme = "EXTERNAL_MANAGED" | ||
locality_lb_policy = "RING_HASH" | ||
session_affinity = "STRONG_COOKIE_AFFINITY" | ||
|
||
strong_session_affinity_cookie { | ||
ttl { | ||
seconds = 11 | ||
nanos = 1111 | ||
} | ||
name = "mycookie" | ||
} | ||
} | ||
|
||
resource "google_compute_health_check" "health_check" { | ||
provider = google-beta | ||
|
||
name = "{{index $.Vars "health_check_name"}}" | ||
http_health_check { | ||
port = 80 | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
...templates/terraform/examples/region_backend_service_ilb_stateful_session_affinity.tf.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
resource "google_compute_region_backend_service" "{{$.PrimaryResourceId}}" { | ||
provider = google-beta | ||
|
||
region = "us-central1" | ||
name = "{{index $.Vars "region_backend_service_name"}}" | ||
health_checks = [google_compute_health_check.health_check.id] | ||
load_balancing_scheme = "INTERNAL_MANAGED" | ||
locality_lb_policy = "RING_HASH" | ||
session_affinity = "STRONG_COOKIE_AFFINITY" | ||
protocol = "HTTP" | ||
|
||
strong_session_affinity_cookie { | ||
ttl { | ||
seconds = 11 | ||
nanos = 1111 | ||
} | ||
name = "mycookie" | ||
} | ||
} | ||
|
||
resource "google_compute_health_check" "health_check" { | ||
provider = google-beta | ||
name = "{{index $.Vars "health_check_name"}}" | ||
http_health_check { | ||
port = 80 | ||
} | ||
} |