Skip to content

Commit

Permalink
fix: remove output variable apphub_service_uri from postgresql/mysql …
Browse files Browse the repository at this point in the history
…as it is not supported
  • Loading branch information
q2w committed Dec 9, 2024
1 parent f01ab48 commit ef29e4b
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 48 deletions.
3 changes: 1 addition & 2 deletions modules/mysql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ module "mysql-db" {
| deny\_maintenance\_period | The Deny Maintenance Period fields to prevent automatic maintenance from occurring during a 90-day time period. List accepts only one value. See [more details](https://cloud.google.com/sql/docs/mysql/maintenance) | <pre>list(object({<br> end_date = string<br> start_date = string<br> time = string<br> }))</pre> | `[]` | no |
| disk\_autoresize | Configuration to increase storage size | `bool` | `true` | no |
| disk\_autoresize\_limit | The maximum size to which storage can be auto increased. | `number` | `0` | no |
| disk\_size | The disk size for the master instance | `number` | `10` | no |
| disk\_size | The disk size (in GB) for the master instance | `number` | `10` | no |
| disk\_type | The disk type for the master instance. | `string` | `"PD_SSD"` | no |
| edition | The edition of the instance, can be ENTERPRISE or ENTERPRISE\_PLUS. | `string` | `null` | no |
| enable\_default\_db | Enable or disable the creation of the default database | `bool` | `true` | no |
Expand Down Expand Up @@ -110,7 +110,6 @@ 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
19 changes: 13 additions & 6 deletions modules/mysql/metadata.display.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ spec:
availability_type:
name: availability_type
title: Availability Type
invisible: false
level: 1
enumValueLabels:
- label: REGIONAL
value: REGIONAL
Expand All @@ -52,6 +52,7 @@ spec:
backup_configuration:
name: backup_configuration
title: Backup Configuration
level: 1
altDefaults:
- type: ALTERNATE_TYPE_DC
value:
Expand Down Expand Up @@ -97,7 +98,7 @@ spec:
db_name:
name: db_name
title: Db Name
invisible: false
level: 1
delete_timeout:
name: delete_timeout
title: Delete Timeout
Expand Down Expand Up @@ -125,13 +126,15 @@ spec:
disk_size:
name: disk_size
title: Disk Size
level: 1
disk_type:
name: disk_type
title: Disk Type
level: 1
edition:
name: edition
title: Edition
invisible: false
level: 1
enumValueLabels:
- label: ENTERPRISE_PLUS
value: ENTERPRISE_PLUS
Expand All @@ -143,11 +146,11 @@ spec:
enable_default_db:
name: enable_default_db
title: Enable Default Db
invisible: false
level: 1
enable_default_user:
name: enable_default_user
title: Enable Default User
invisible: false
level: 1
enable_google_ml_integration:
name: enable_google_ml_integration
title: Enable Google Ml Integration
Expand Down Expand Up @@ -219,7 +222,7 @@ spec:
region:
name: region
title: Region
invisible: false
level: 1
replica_database_version:
name: replica_database_version
title: Replica Database Version
Expand All @@ -232,6 +235,10 @@ spec:
tier:
name: tier
title: Tier
level: 1
altDefaults:
- type: ALTERNATE_TYPE_DC
value: db-perf-optimized-N-8
update_timeout:
name: update_timeout
title: Update Timeout
Expand Down
8 changes: 1 addition & 7 deletions modules/mysql/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ spec:
varType: number
defaultValue: 0
- name: disk_size
description: The disk size for the master instance
description: The disk size (in GB) for the master instance
varType: number
defaultValue: 10
- name: disk_type
Expand Down Expand Up @@ -408,12 +408,6 @@ 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: 0 additions & 8 deletions modules/mysql/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,3 @@ 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."
}
2 changes: 1 addition & 1 deletion modules/mysql/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ variable "disk_autoresize_limit" {
}

variable "disk_size" {
description = "The disk size for the master instance"
description = "The disk size (in GB) for the master instance"
type = number
default = 10
}
Expand Down
3 changes: 1 addition & 2 deletions modules/postgresql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ module "pg" {
| deny\_maintenance\_period | The Deny Maintenance Period fields to prevent automatic maintenance from occurring during a 90-day time period. List accepts only one value. See [more details](https://cloud.google.com/sql/docs/postgres/maintenance) | <pre>list(object({<br> end_date = string<br> start_date = string<br> time = string<br> }))</pre> | `[]` | no |
| disk\_autoresize | Configuration to increase storage size. | `bool` | `true` | no |
| disk\_autoresize\_limit | The maximum size to which storage can be auto increased. | `number` | `0` | no |
| disk\_size | The disk size for the Cloud SQL instance. | `number` | `10` | no |
| disk\_size | The disk size (in GB) for the Cloud SQL instance. | `number` | `10` | no |
| disk\_type | The disk type for the Cloud SQL instance. | `string` | `"PD_SSD"` | no |
| edition | The edition of the Cloud SQL instance, can be ENTERPRISE or ENTERPRISE\_PLUS. | `string` | `null` | no |
| enable\_default\_db | Enable or disable the creation of the default database | `bool` | `true` | no |
Expand Down Expand Up @@ -180,7 +180,6 @@ 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
16 changes: 10 additions & 6 deletions modules/postgresql/metadata.display.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,14 @@ spec:
availability_type:
name: availability_type
title: Availability Type
invisible: false
level: 1
altDefaults:
- type: ALTERNATE_TYPE_DC
value: REGIONAL
backup_configuration:
name: backup_configuration
title: Backup Configuration
level: 1
altDefaults:
- type: ALTERNATE_TYPE_DC
value:
Expand Down Expand Up @@ -103,7 +104,7 @@ spec:
db_name:
name: db_name
title: Db Name
invisible: false
level: 1
delete_timeout:
name: delete_timeout
title: Delete Timeout
Expand Down Expand Up @@ -131,13 +132,15 @@ spec:
disk_size:
name: disk_size
title: Disk Size
level: 1
disk_type:
name: disk_type
title: Disk Type
level: 1
edition:
name: edition
title: Edition
invisible: false
level: 1
enumValueLabels:
- label: ENTERPRISE_PLUS
value: ENTERPRISE_PLUS
Expand All @@ -149,11 +152,11 @@ spec:
enable_default_db:
name: enable_default_db
title: Enable Default Db
invisible: false
level: 1
enable_default_user:
name: enable_default_user
title: Enable Default User
invisible: false
level: 1
enable_google_ml_integration:
name: enable_google_ml_integration
title: Enable Google Ml Integration
Expand Down Expand Up @@ -225,7 +228,7 @@ spec:
region:
name: region
title: Region
invisible: false
level: 1
root_password:
name: root_password
title: Root Password
Expand All @@ -235,6 +238,7 @@ spec:
tier:
name: tier
title: Tier
level: 1
altDefaults:
- type: ALTERNATE_TYPE_DC
value: db-perf-optimized-N-8
Expand Down
8 changes: 1 addition & 7 deletions modules/postgresql/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ spec:
varType: number
defaultValue: 0
- name: disk_size
description: The disk size for the Cloud SQL instance.
description: The disk size (in GB) for the Cloud SQL instance.
varType: number
defaultValue: 10
- name: disk_type
Expand Down Expand Up @@ -398,12 +398,6 @@ 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: 0 additions & 8 deletions modules/postgresql/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,3 @@ 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."
}
2 changes: 1 addition & 1 deletion modules/postgresql/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ variable "disk_autoresize_limit" {
}

variable "disk_size" {
description = "The disk size for the Cloud SQL instance."
description = "The disk size (in GB) for the Cloud SQL instance."
type = number
default = 10
}
Expand Down

0 comments on commit ef29e4b

Please sign in to comment.