Fix health check autocreation and id output in passthrough LB modules (#1928)

* fix health check autocreation and id output

* fix health check exclusion
This commit is contained in:
Ludovico Magnocavallo 2023-12-14 00:39:55 +01:00 committed by GitHub
parent ca3c86cb5c
commit 537237edd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 19 additions and 13 deletions

View File

@ -290,7 +290,7 @@ module "nlb" {
| [group_self_links](outputs.tf#L53) | Optional unmanaged instance group self links. | |
| [groups](outputs.tf#L60) | Optional unmanaged instance group resources. | |
| [health_check](outputs.tf#L65) | Auto-created health-check resource. | |
| [health_check_self_id](outputs.tf#L70) | Auto-created health-check self id. | |
| [health_check_id](outputs.tf#L70) | Auto-created health-check id. | |
| [health_check_self_link](outputs.tf#L75) | Auto-created health-check self link. | |
| [id](outputs.tf#L80) | Fully qualified forwarding rule ids. | |
<!-- END TFDOC -->

View File

@ -17,7 +17,9 @@
# tfdoc:file:description Health check resource.
locals {
hc = var.health_check_config
hc = (
var.health_check != null ? null : var.health_check_config
)
hc_grpc = try(local.hc.grpc, null) != null
hc_http = try(local.hc.http, null) != null
hc_http2 = try(local.hc.http2, null) != null

View File

@ -67,8 +67,8 @@ output "health_check" {
value = try(google_compute_region_health_check.default.0, null)
}
output "health_check_self_id" {
description = "Auto-created health-check self id."
output "health_check_id" {
description = "Auto-created health-check id."
value = try(google_compute_region_health_check.default.0.id, null)
}

View File

@ -331,7 +331,7 @@ module "ilb" {
| [group_self_links](outputs.tf#L56) | Optional unmanaged instance group self links. | |
| [groups](outputs.tf#L63) | Optional unmanaged instance group resources. | |
| [health_check](outputs.tf#L68) | Auto-created health-check resource. | |
| [health_check_self_id](outputs.tf#L73) | Auto-created health-check self id. | |
| [health_check_id](outputs.tf#L73) | Auto-created health-check id. | |
| [health_check_self_link](outputs.tf#L78) | Auto-created health-check self link. | |
| [id](outputs.tf#L83) | Fully qualified forwarding rule ids. | |
<!-- END TFDOC -->

View File

@ -17,7 +17,9 @@
# tfdoc:file:description Health check resource.
locals {
hc = var.health_check_config
hc = (
var.health_check != null ? null : var.health_check_config
)
hc_grpc = try(local.hc.grpc, null) != null
hc_http = try(local.hc.http, null) != null
hc_http2 = try(local.hc.http2, null) != null

View File

@ -70,8 +70,8 @@ output "health_check" {
value = try(google_compute_health_check.default.0, null)
}
output "health_check_self_id" {
description = "Auto-created health-check self id."
output "health_check_id" {
description = "Auto-created health-check id."
value = try(google_compute_health_check.default.0.id, null)
}

View File

@ -90,7 +90,7 @@ module "int-tcp-proxy" {
subnetwork = var.subnet.self_link
}
}
# tftest modules=1 resources=4
# tftest modules=1 resources=3
```
### Instance Groups
@ -315,7 +315,7 @@ module "int-tcp-proxy" {
| [group_self_links](outputs.tf#L37) | Optional unmanaged instance group self links. | |
| [groups](outputs.tf#L44) | Optional unmanaged instance group resources. | |
| [health_check](outputs.tf#L49) | Auto-created health-check resource. | |
| [health_check_self_id](outputs.tf#L54) | Auto-created health-check self id. | |
| [health_check_id](outputs.tf#L54) | Auto-created health-check id. | |
| [health_check_self_link](outputs.tf#L59) | Auto-created health-check self link. | |
| [id](outputs.tf#L64) | Fully qualified forwarding rule id. | |
| [neg_ids](outputs.tf#L69) | Autogenerated network endpoint group ids. | |

View File

@ -17,7 +17,9 @@
# tfdoc:file:description Health check resource.
locals {
hc = var.health_check_config
hc = (
var.health_check != null ? null : var.health_check_config
)
hc_grpc = try(local.hc.grpc, null) != null
hc_http = try(local.hc.http, null) != null
hc_http2 = try(local.hc.http2, null) != null

View File

@ -51,8 +51,8 @@ output "health_check" {
value = try(google_compute_region_health_check.default.0, null)
}
output "health_check_self_id" {
description = "Auto-created health-check self id."
output "health_check_id" {
description = "Auto-created health-check id."
value = try(google_compute_region_health_check.default.0.id, null)
}