Skip to content

Commit

Permalink
Added conditional check for outlier detection applied to specific lb …
Browse files Browse the repository at this point in the history
…schemes
  • Loading branch information
btkelly committed Nov 6, 2023
1 parent 56da382 commit 1969b2b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion autogen/main.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ resource "google_compute_backend_service" "default" {
}

dynamic "outlier_detection" {
for_each = each.value.outlier_detection != null ? [1] : []
for_each = each.value.outlier_detection != null && ( var.load_balancing_scheme == "INTERNAL_SELF_MANAGED" || var.load_balancing_scheme == "EXTERNAL_MANAGED" ) ? [1] : []
content {
consecutive_errors = each.value.outlier_detection.consecutive_errors
consecutive_gateway_failure = each.value.outlier_detection.consecutive_gateway_failure
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ resource "google_compute_backend_service" "default" {
}

dynamic "outlier_detection" {
for_each = each.value.outlier_detection != null ? [1] : []
for_each = each.value.outlier_detection != null && (var.load_balancing_scheme == "INTERNAL_SELF_MANAGED" || var.load_balancing_scheme == "EXTERNAL_MANAGED") ? [1] : []
content {
consecutive_errors = each.value.outlier_detection.consecutive_errors
consecutive_gateway_failure = each.value.outlier_detection.consecutive_gateway_failure
Expand Down
2 changes: 1 addition & 1 deletion modules/dynamic_backends/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ resource "google_compute_backend_service" "default" {
}

dynamic "outlier_detection" {
for_each = each.value.outlier_detection != null ? [1] : []
for_each = each.value.outlier_detection != null && (var.load_balancing_scheme == "INTERNAL_SELF_MANAGED" || var.load_balancing_scheme == "EXTERNAL_MANAGED") ? [1] : []
content {
consecutive_errors = each.value.outlier_detection.consecutive_errors
consecutive_gateway_failure = each.value.outlier_detection.consecutive_gateway_failure
Expand Down
2 changes: 1 addition & 1 deletion modules/serverless_negs/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ resource "google_compute_backend_service" "default" {
}

dynamic "outlier_detection" {
for_each = each.value.outlier_detection != null ? [1] : []
for_each = each.value.outlier_detection != null && (var.load_balancing_scheme == "INTERNAL_SELF_MANAGED" || var.load_balancing_scheme == "EXTERNAL_MANAGED") ? [1] : []
content {
consecutive_errors = each.value.outlier_detection.consecutive_errors
consecutive_gateway_failure = each.value.outlier_detection.consecutive_gateway_failure
Expand Down

0 comments on commit 1969b2b

Please sign in to comment.