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/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..8d4f9796 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 = "//redis.googleapis.com/${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." +}