Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions modules/mysql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ module "mysql-db" {
| Name | Description |
|------|-------------|
| additional\_users | List of maps of additional users and passwords |
| apphub\_service\_uri | Service URI in CAIS style to be used by Apphub. |
| env\_vars | Exported environment variables |
| generated\_user\_password | The auto generated default user password if not input password was provided |
| iam\_users | The list of the IAM users with access to the CloudSQL instance |
Expand Down
16 changes: 13 additions & 3 deletions modules/mysql/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ spec:
description: The database version to use
varType: string
required: true
- name: maintenance_version
description: The current software version on the instance. This attribute can not be set during creation. Refer to available_maintenance_versions attribute to see what maintenance_version are available for upgrade. When this attribute gets updated, it will cause an instance restart. Setting a maintenance_version value that is older than the current one on the instance will be ignored
varType: string
- name: availability_type
description: The availability type for the master instance. Can be either `REGIONAL` or `null`.
varType: string
Expand Down Expand Up @@ -308,9 +311,10 @@ spec:
varType: |-
object({
enable_password_policy = bool
min_length = number
complexity = string
disallow_username_substring = bool
min_length = optional(number)
complexity = optional(string)
disallow_username_substring = optional(bool)
reuse_interval = optional(number)
})
- name: read_replicas
description: List of read replicas to create. Encryption key is required for replica in different region. For replica in same region as master set encryption_key_name = null
Expand Down Expand Up @@ -412,6 +416,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
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 = "//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."
}
1 change: 1 addition & 0 deletions modules/postgresql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ module "pg" {
| Name | Description |
|------|-------------|
| additional\_users | List of maps of additional users and passwords |
| apphub\_service\_uri | Service URI in CAIS style to be used by Apphub. |
| dns\_name | DNS name of the instance endpoint |
| env\_vars | Exported environment variables |
| generated\_user\_password | The auto generated default user password if not input password was provided |
Expand Down
11 changes: 10 additions & 1 deletion modules/postgresql/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,12 @@ spec:
description: The edition of the Cloud SQL instance, can be ENTERPRISE or ENTERPRISE_PLUS.
varType: string
- name: database_version
description: The database version to use
description: The database version to use. Can be 9_6, 14, 15, 16, 17.
varType: string
required: true
- name: maintenance_version
description: The current software version on the instance. This attribute can not be set during creation. Refer to available_maintenance_versions attribute to see what maintenance_version are available for upgrade. When this attribute gets updated, it will cause an instance restart. Setting a maintenance_version value that is older than the current one on the instance will be ignored
varType: string
- name: availability_type
description: The availability type for the Cloud SQL instance.This is only used to set up high availability for the PostgreSQL instance. Can be either `ZONAL` or `REGIONAL`.
varType: string
Expand Down Expand Up @@ -403,6 +406,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
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 = "//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."
}