Skip to content

Commit 47910c2

Browse files
sANGINI2004Sangini Garg
andauthored
feat: add "apphub_services_uri" in outputs.tf for redis-cluster (#308)
Co-authored-by: Sangini Garg <[email protected]>
1 parent 2d58def commit 47910c2

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

modules/redis-cluster/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ Check the [example/](https://github.com/terraform-google-modules/terraform-googl
5959

6060
| Name | Description |
6161
|------|-------------|
62+
| apphub\_service\_uri | Service URI in CAIS style to be used by Apphub. |
6263
| discovery\_endpoints | Endpoints created on each given network, for Redis clients to connect to the cluster. Currently only one endpoint is supported |
6364
| id | The redis cluster instance ID |
6465
| psc\_connections | PSC connections for discovery of the cluster topology and accessing the cluster |

modules/redis-cluster/metadata.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,13 @@ spec:
156156
varType: list(string)
157157
defaultValue: []
158158
outputs:
159+
- name: apphub_service_uri
160+
description: Service URI in CAIS style to be used by Apphub.
161+
type:
162+
- object
163+
- location: string
164+
service_id: string
165+
service_uri: string
159166
- name: discovery_endpoints
160167
description: Endpoints created on each given network, for Redis clients to connect to the cluster. Currently only one endpoint is supported
161168
type:

modules/redis-cluster/outputs.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,12 @@ output "redis_cluster" {
3838
description = "The redis cluster created"
3939
value = google_redis_cluster.redis_cluster
4040
}
41+
42+
output "apphub_service_uri" {
43+
value = {
44+
service_uri = "//redis.googleapis.com/${google_redis_cluster.redis_cluster.id}"
45+
service_id = substr("${var.name}-${md5("MRC-${var.region}-${var.project_id}")}", 0, 63)
46+
location = var.region
47+
}
48+
description = "Service URI in CAIS style to be used by Apphub."
49+
}

0 commit comments

Comments
 (0)