Skip to content

Commit

Permalink
Add conditional validation, allow sending empty capacity scaler for r…
Browse files Browse the repository at this point in the history
…egional backend service (#3033) (#9)

* fix region backend service capacity scaler

* add capacity scaler to fr example

* remove recopied handwritten test

* move constant list into expanders for tpg conversion

* change licenses

Signed-off-by: Modular Magician <[email protected]>
  • Loading branch information
modular-magician authored Jan 31, 2020
1 parent 6edf3b8 commit c112d4e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions .changelog/3033.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
```release-note:breakingchange
compute: Added conditional requirement of `google_compute_**region**_backend_service` `backend.capacity_scaler` to no longer accept the API default if not INTERNAL. Non-INTERNAL backend services must now specify `capacity_scaler` explicitly and have a total capacity greater than 0. In addition, API default of 1.0 must now be explicitly set and will be treated as nil or zero if not set in config.
```
```release-note:bug
compute: Fixed `google_compute_**region**_backend_service` so it no longer has a permadiff if `backend.capacity_scaler` is unset in config by requiring capacity scaler.
```
```release-note:bug
compute: Fixed `backend.capacity_scaler` to actually set zero (0.0) value.
```
4 changes: 2 additions & 2 deletions region_backend_service_basic/main.tf
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
resource "google_compute_region_backend_service" "default" {
name = "region-backend-service-${local.name_suffix}"
name = "tf-test-rbs-${local.name_suffix}"
region = "us-central1"
health_checks = [google_compute_health_check.default.self_link]
connection_draining_timeout_sec = 10
session_affinity = "CLIENT_IP"
}

resource "google_compute_health_check" "default" {
name = "health-check-${local.name_suffix}"
name = "tf-test-hc-${local.name_suffix}"
check_interval_sec = 1
timeout_sec = 1

Expand Down

0 comments on commit c112d4e

Please sign in to comment.