From ddfa9b740e678681be3a514c5b5e1f384b0f4f2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Talha=20Alt=C4=B1nel?= Date: Thu, 1 Aug 2024 13:30:40 +0100 Subject: [PATCH 1/3] fix ports bug --- modules/v2/main.tf | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/v2/main.tf b/modules/v2/main.tf index 6a83bcd7..b65fdca8 100644 --- a/modules/v2/main.tf +++ b/modules/v2/main.tf @@ -69,9 +69,12 @@ resource "google_cloud_run_v2_service" "main" { working_dir = containers.value.working_dir depends_on = containers.value.depends_on_container - ports { - name = containers.value.ports["name"] - container_port = containers.value.ports["container_port"] + dynamic "ports" { + for_each = containers.value.ports != null ? [containers.value.ports] : [] + content { + name = ports.value["name"] + container_port = ports.value["container_port"] + } } resources { From c984940fc33bb133831f7a186ab8a0f1bcd1c581 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Talha=20Alt=C4=B1nel?= Date: Thu, 1 Aug 2024 13:32:05 +0100 Subject: [PATCH 2/3] fix broken liveness_probe variable --- modules/v2/variables.tf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/v2/variables.tf b/modules/v2/variables.tf index 112e1df3..d42a7747 100644 --- a/modules/v2/variables.tf +++ b/modules/v2/variables.tf @@ -293,6 +293,9 @@ variable "containers" { value = string })), null) }), null) + tcp_socket = optional(object({ + port = optional(number) + }), null) grpc = optional(object({ port = optional(number) service = optional(string) From 719a1f26fd7c66066eee5c4b8096a5e2f76cb704 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Talha=20Alt=C4=B1nel?= Date: Thu, 1 Aug 2024 13:42:41 +0100 Subject: [PATCH 3/3] fix incorrect default http_headers type --- modules/v2/variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/v2/variables.tf b/modules/v2/variables.tf index d42a7747..ace920d7 100644 --- a/modules/v2/variables.tf +++ b/modules/v2/variables.tf @@ -291,7 +291,7 @@ variable "containers" { http_headers = optional(list(object({ name = string value = string - })), null) + })), []) }), null) tcp_socket = optional(object({ port = optional(number)