From 446563e2cb58baf8e1b691454499e396dd4f0e42 Mon Sep 17 00:00:00 2001 From: Jieyu Tian Date: Wed, 16 Oct 2024 20:21:54 +0000 Subject: [PATCH 1/4] Add Apphub URI output to Redis --- metadata.yaml | 6 ++++++ outputs.tf | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/metadata.yaml b/metadata.yaml index 50c3b281..383072d2 100644 --- a/metadata.yaml +++ b/metadata.yaml @@ -150,6 +150,12 @@ spec: rdb_snapshot_period = string }) outputs: + - name: apphub_service_uri + description: Service URI in CAIS style to be used by Apphub. + type: + - object + - service_id: string + service_uri: string - name: auth_string description: AUTH String set on the instance. This field will only be populated if auth_enabled is true. type: string diff --git a/outputs.tf b/outputs.tf index e3724257..a7aae189 100644 --- a/outputs.tf +++ b/outputs.tf @@ -68,3 +68,11 @@ output "env_vars" { "REDIS_PORT" : tostring(google_redis_instance.default.port) } } + +output "apphub_service_uri" { + value = { + service_uri = "//memorystore.googleapis.com/${google_redis_instance.default.id}" + service_id = google_redis_instance.default.id + } + description = "Service URI in CAIS style to be used by Apphub." +} From 6419f43afce167946d5932e96d4aad6f2ed550fc Mon Sep 17 00:00:00 2001 From: Jieyu Tian Date: Thu, 17 Oct 2024 02:10:39 +0000 Subject: [PATCH 2/4] modify README --- README.md | 1 + outputs.tf | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1b494e5a..58fe3ead 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,7 @@ module "memorystore" { | Name | Description | |------|-------------| +| apphub\_service\_uri | Service URI in CAIS style to be used by Apphub. | | auth\_string | AUTH String set on the instance. This field will only be populated if auth\_enabled is true. | | current\_location\_id | The current zone where the Redis endpoint is placed. | | env\_vars | Exported environment variables | diff --git a/outputs.tf b/outputs.tf index a7aae189..25508173 100644 --- a/outputs.tf +++ b/outputs.tf @@ -70,7 +70,7 @@ output "env_vars" { } output "apphub_service_uri" { - value = { + value = { service_uri = "//memorystore.googleapis.com/${google_redis_instance.default.id}" service_id = google_redis_instance.default.id } From 7f6d54bc43e3f66e131f4a97f8be59ca51bfec9e Mon Sep 17 00:00:00 2001 From: Jieyu Tian Date: Fri, 18 Oct 2024 14:49:42 -0400 Subject: [PATCH 3/4] Update outputs.tf Co-authored-by: abhishek kumar tiwari --- outputs.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/outputs.tf b/outputs.tf index 25508173..99ad4e15 100644 --- a/outputs.tf +++ b/outputs.tf @@ -71,7 +71,7 @@ output "env_vars" { output "apphub_service_uri" { value = { - service_uri = "//memorystore.googleapis.com/${google_redis_instance.default.id}" + service_uri = "//redis.googleapis.com/${google_redis_instance.default.id}" service_id = google_redis_instance.default.id } description = "Service URI in CAIS style to be used by Apphub." From 37b49e3a66b547c709a481038affc5b4c5efb8f3 Mon Sep 17 00:00:00 2001 From: Jieyu Tian Date: Fri, 18 Oct 2024 14:49:47 -0400 Subject: [PATCH 4/4] Update outputs.tf Co-authored-by: abhishek kumar tiwari --- outputs.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/outputs.tf b/outputs.tf index 99ad4e15..8d4f9796 100644 --- a/outputs.tf +++ b/outputs.tf @@ -72,7 +72,7 @@ output "env_vars" { output "apphub_service_uri" { value = { service_uri = "//redis.googleapis.com/${google_redis_instance.default.id}" - service_id = google_redis_instance.default.id + service_id = substr("${var.name}-${md5("${var.region}-${var.project_id}")}", 0, 63) } description = "Service URI in CAIS style to be used by Apphub." }