Skip to content

Commit

Permalink
extract apphub uri from self_link instead of interpolating.
Browse files Browse the repository at this point in the history
  • Loading branch information
tjy9206 committed Oct 21, 2024
1 parent 45ab601 commit 4188ede
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion modules/mssql/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ output "primary" {

output "apphub_service_uri" {
value = {
service_uri = "//cloudsql.googleapis.com/projects/${var.project_id}/instances/${var.name}"
service_uri = "//cloudsql.googleapis.com/projects${element(split("/projects", google_sql_database_instance.default.self_link), 1)}"
service_id = substr(format("%s-%s", var.name, md5(var.project_id)), 0, 63)
}
description = "Service URI in CAIS style to be used by Apphub."
Expand Down
2 changes: 1 addition & 1 deletion modules/mysql/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ output "env_vars" {

output "apphub_service_uri" {
value = {
service_uri = "//cloudsql.googleapis.com/projects/${var.project_id}/instances/${var.name}"
service_uri = "//cloudsql.googleapis.com/projects${element(split("/projects", google_sql_database_instance.default.self_link), 1)}"
service_id = substr(format("%s-%s", var.name, md5(var.project_id)), 0, 63)
}
description = "Service URI in CAIS style to be used by Apphub."
Expand Down
2 changes: 1 addition & 1 deletion modules/postgresql/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ output "env_vars" {

output "apphub_service_uri" {
value = {
service_uri = "//cloudsql.googleapis.com/projects/${var.project_id}/instances/${var.name}"
service_uri = "//cloudsql.googleapis.com/projects${element(split("/projects", google_sql_database_instance.default.self_link), 1)}"
service_id = substr(format("%s-%s", var.name, md5(var.project_id)), 0, 63)
}
description = "Service URI in CAIS style to be used by Apphub."
Expand Down

0 comments on commit 4188ede

Please sign in to comment.