Skip to content

Commit

Permalink
update "ssl_certificates" conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
rodriguezsergio committed Dec 20, 2024
1 parent 5b92cc7 commit 4deff4f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion modules/net-lb-app-ext-regional/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,6 @@ resource "google_compute_region_target_https_proxy" "default" {
description = var.description
ssl_policy = var.https_proxy_config.ssl_policy
url_map = google_compute_region_url_map.default.id
ssl_certificates = length(local.proxy_ssl_certificates) > 0 ? local.proxy_ssl_certificates : null
ssl_certificates = length(local.proxy_ssl_certificates) == 0 ? null : local.proxy_ssl_certificates
certificate_manager_certificates = try(var.https_proxy_config.certificate_manager_certificates, null)
}
2 changes: 1 addition & 1 deletion modules/net-lb-app-ext/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,6 @@ resource "google_compute_target_https_proxy" "default" {
ssl_policy = var.https_proxy_config.ssl_policy
url_map = google_compute_url_map.default.id
server_tls_policy = var.https_proxy_config.mtls_policy
ssl_certificates = length(local.proxy_ssl_certificates) > 0 ? local.proxy_ssl_certificates : null
ssl_certificates = length(local.proxy_ssl_certificates) == 0 ? null : local.proxy_ssl_certificates
certificate_manager_certificates = try(var.https_proxy_config.certificate_manager_certificates, null)
}
2 changes: 1 addition & 1 deletion modules/net-lb-app-int-cross-region/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ resource "google_compute_target_https_proxy" "default" {
quic_override = var.https_proxy_config.quic_override
ssl_policy = var.https_proxy_config.ssl_policy
url_map = google_compute_url_map.default.id
ssl_certificates = length(local.proxy_ssl_certificates) > 0 ? local.proxy_ssl_certificates : null
ssl_certificates = length(local.proxy_ssl_certificates) == 0 ? null : local.proxy_ssl_certificates
certificate_manager_certificates = try(var.https_proxy_config.certificate_manager_certificates, null)
}

Expand Down
16 changes: 6 additions & 10 deletions modules/net-lb-app-int/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -108,18 +108,14 @@ resource "google_compute_region_target_http_proxy" "default" {
}

resource "google_compute_region_target_https_proxy" "default" {
count = var.protocol == "HTTPS" ? 1 : 0
project = var.project_id
region = var.region
name = var.name
description = var.description
ssl_certificates = (
length(local.proxy_ssl_certificates) == 0
? null
: local.proxy_ssl_certificates
)
count = var.protocol == "HTTPS" ? 1 : 0
project = var.project_id
region = var.region
name = var.name
description = var.description
ssl_policy = var.https_proxy_config.ssl_policy
url_map = google_compute_region_url_map.default.id
ssl_certificates = length(local.proxy_ssl_certificates) == 0 ? null : local.proxy_ssl_certificates
certificate_manager_certificates = try(var.https_proxy_config.certificate_manager_certificates, null)
}

Expand Down

0 comments on commit 4deff4f

Please sign in to comment.