Skip to content

Commit 5acae1e

Browse files
author
Naseem
authored
fix: Add health-check prober port for checked backends to hc-firewall (#143)
Signed-off-by: Naseem <[email protected]>
1 parent 73f200b commit 5acae1e

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

autogen/main.tf.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,10 @@ resource "google_compute_firewall" "default-hc" {
267267
target_service_accounts = length(var.target_service_accounts) > 0 ? var.target_service_accounts : null
268268

269269
dynamic "allow" {
270-
for_each = var.backends
270+
for_each = local.health_checked_backends
271271
content {
272272
protocol = "tcp"
273-
ports = [allow.value.port]
273+
ports = [allow.value["health_check"].port]
274274
}
275275
}
276276
}

main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,10 +246,10 @@ resource "google_compute_firewall" "default-hc" {
246246
target_service_accounts = length(var.target_service_accounts) > 0 ? var.target_service_accounts : null
247247

248248
dynamic "allow" {
249-
for_each = var.backends
249+
for_each = local.health_checked_backends
250250
content {
251251
protocol = "tcp"
252-
ports = [allow.value.port]
252+
ports = [allow.value["health_check"].port]
253253
}
254254
}
255255
}

modules/dynamic_backends/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,10 @@ resource "google_compute_firewall" "default-hc" {
249249
target_service_accounts = length(var.target_service_accounts) > 0 ? var.target_service_accounts : null
250250

251251
dynamic "allow" {
252-
for_each = var.backends
252+
for_each = local.health_checked_backends
253253
content {
254254
protocol = "tcp"
255-
ports = [allow.value.port]
255+
ports = [allow.value["health_check"].port]
256256
}
257257
}
258258
}

0 commit comments

Comments
 (0)