Skip to content

Commit

Permalink
fix: Add Apphub URI output to Redis (#245)
Browse files Browse the repository at this point in the history
Co-authored-by: abhishek kumar tiwari <[email protected]>
  • Loading branch information
tjy9206 and q2w authored Oct 23, 2024
1 parent 09f3894 commit dc74494
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
6 changes: 6 additions & 0 deletions metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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."
}

0 comments on commit dc74494

Please sign in to comment.