Skip to content

Commit

Permalink
Add Apphub URI output to Cloud SQL modules
Browse files Browse the repository at this point in the history
  • Loading branch information
tjy9206 committed Oct 17, 2024
1 parent 600e0a9 commit 84498bf
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 6 deletions.
15 changes: 15 additions & 0 deletions modules/mssql/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,12 @@ spec:
type:
- tuple
- []
- name: apphub_service_uri
description: Service URI in CAIS style to be used by Apphub.
type:
- object
service_id: string
service_uri: string
- name: generated_user_password
description: The auto generated default user password if not input password was provided
type: string
Expand Down Expand Up @@ -564,3 +570,12 @@ spec:
- serviceusage.googleapis.com
- sqladmin.googleapis.com
- workflows.googleapis.com
providerVersions:
- source: hashicorp/google
version: ">= 5.12, < 7"
- source: hashicorp/google-beta
version: ">= 5.12, < 7"
- source: hashicorp/null
version: ~> 3.2
- source: hashicorp/random
version: ~> 3.4
8 changes: 8 additions & 0 deletions modules/mssql/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,11 @@ output "primary" {
description = "The `google_sql_database_instance` resource representing the primary instance"
sensitive = true
}

output "apphub_service_uri" {
value = {
service_uri = google_sql_database_instance.default.self_link
service_id = google_sql_database_instance.default.name
}
description = "Service URI in CAIS style to be used by Apphub."
}
21 changes: 18 additions & 3 deletions modules/mysql/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ spec:
connections:
- source:
source: github.com/terraform-google-modules/terraform-google-network//modules/vpc
version: "~> 9.1.0"
version: ~> 9.1.0
spec:
outputExpr: network_id
inputPath: private_network
Expand Down Expand Up @@ -339,12 +339,12 @@ spec:
connections:
- source:
source: github.com/terraform-google-modules/terraform-google-service-accounts//modules/simple-sa
version: "~> 4.3.0"
version: ~> 4.3.0
spec:
outputExpr: id
- source:
source: github.com/GoogleCloudPlatform/terraform-google-cloud-run//modules/v2
version: "~> 0.13.0"
version: ~> 0.13.0
spec:
outputExpr: service_account_id
- name: create_timeout
Expand Down Expand Up @@ -407,6 +407,12 @@ spec:
type:
- tuple
- []
- name: apphub_service_uri
description: Service URI in CAIS style to be used by Apphub.
type:
- object
- service_id: string
service_uri: string
- name: env_vars
description: Exported environment variables
type:
Expand Down Expand Up @@ -914,3 +920,12 @@ spec:
- serviceusage.googleapis.com
- sqladmin.googleapis.com
- workflows.googleapis.com
providerVersions:
- source: hashicorp/google
version: ">= 5.25, < 7"
- source: hashicorp/google-beta
version: ">= 5.25, < 7"
- source: hashicorp/null
version: ~> 3.1
- source: hashicorp/random
version: ~> 3.1
8 changes: 8 additions & 0 deletions modules/mysql/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -154,3 +154,11 @@ output "env_vars" {
"CLOUD_SQL_DATABASE_NAME" : local.database_name
}
}

output "apphub_service_uri" {
value = {
service_uri = google_sql_database_instance.default.self_link
service_id = google_sql_database_instance.default.name
}
description = "Service URI in CAIS style to be used by Apphub."
}
21 changes: 18 additions & 3 deletions modules/postgresql/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ spec:
connections:
- source:
source: github.com/terraform-google-modules/terraform-google-network//modules/vpc
version: "~> 9.1.0"
version: ~> 9.1.0
spec:
outputExpr: network_id
inputPath: private_network
Expand Down Expand Up @@ -319,12 +319,12 @@ spec:
connections:
- source:
source: github.com/terraform-google-modules/terraform-google-service-accounts//modules/simple-sa
version: "~> 4.3.0"
version: ~> 4.3.0
spec:
outputExpr: id
- source:
source: github.com/GoogleCloudPlatform/terraform-google-cloud-run//modules/v2
version: "~> 0.13.0"
version: ~> 0.13.0
spec:
outputExpr: service_account_id
- name: create_timeout
Expand Down Expand Up @@ -397,6 +397,12 @@ spec:
type:
- tuple
- []
- name: apphub_service_uri
description: Service URI in CAIS style to be used by Apphub.
type:
- object
- service_id: string
service_uri: string
- name: dns_name
description: DNS name of the instance endpoint
type: string
Expand Down Expand Up @@ -904,3 +910,12 @@ spec:
- serviceusage.googleapis.com
- sqladmin.googleapis.com
- workflows.googleapis.com
providerVersions:
- source: hashicorp/google
version: ">= 5.25, < 7"
- source: hashicorp/google-beta
version: ">= 5.25, < 7"
- source: hashicorp/null
version: ~> 3.1
- source: hashicorp/random
version: ~> 3.1
8 changes: 8 additions & 0 deletions modules/postgresql/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,11 @@ output "env_vars" {
"CLOUD_SQL_DATABASE_NAME" : local.database_name
}
}

output "apphub_service_uri" {
value = {
service_uri = google_sql_database_instance.default.self_link
service_id = google_sql_database_instance.default.name
}
description = "Service URI in CAIS style to be used by Apphub."
}

0 comments on commit 84498bf

Please sign in to comment.