From a02350fc8f23f4697887ed0da985b5f31d396ff8 Mon Sep 17 00:00:00 2001 From: Abhishek Tiwari Date: Mon, 9 Dec 2024 12:14:38 +0000 Subject: [PATCH] fix: remove output variable apphub_service_uri from postgresql/mysql as it is not supported --- docs/upgrading_to_sql_db_24.0.md | 14 ++++++++++++++ modules/mysql/README.md | 3 +-- modules/mysql/metadata.display.yaml | 19 +++++++++++++------ modules/mysql/metadata.yaml | 8 +------- modules/mysql/outputs.tf | 8 -------- modules/mysql/variables.tf | 2 +- modules/postgresql/README.md | 3 +-- modules/postgresql/metadata.display.yaml | 16 ++++++++++------ modules/postgresql/metadata.yaml | 8 +------- modules/postgresql/outputs.tf | 8 -------- modules/postgresql/variables.tf | 2 +- 11 files changed, 43 insertions(+), 48 deletions(-) create mode 100644 docs/upgrading_to_sql_db_24.0.md diff --git a/docs/upgrading_to_sql_db_24.0.md b/docs/upgrading_to_sql_db_24.0.md new file mode 100644 index 00000000..af15d0c5 --- /dev/null +++ b/docs/upgrading_to_sql_db_24.0.md @@ -0,0 +1,14 @@ +# Upgrading to v24.0 + +The v24.0 release contains backwards-incompatible changes. + +## Replace uses of apphub_service_uri + +This release removes apphub_service_uri output. You can replace use of `apphub_service_uri` by forming the desired output as below, + +``` +{ + service_uri = "//cloudsql.googleapis.com/projects${element(split("/projects", module.mysql.instance_self_link), 1)}" + service_id = substr(format("%s-%s", , md5(module.mysql.instance_self_link)), 0, 63) + } +``` diff --git a/modules/mysql/README.md b/modules/mysql/README.md index 782e367a..69cc902c 100644 --- a/modules/mysql/README.md +++ b/modules/mysql/README.md @@ -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) |
list(object({
end_date = string
start_date = string
time = string
}))
| `[]` | 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 | @@ -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 | diff --git a/modules/mysql/metadata.display.yaml b/modules/mysql/metadata.display.yaml index 59e8322c..b85aad58 100644 --- a/modules/mysql/metadata.display.yaml +++ b/modules/mysql/metadata.display.yaml @@ -40,7 +40,7 @@ spec: availability_type: name: availability_type title: Availability Type - invisible: false + level: 1 enumValueLabels: - label: REGIONAL value: REGIONAL @@ -52,6 +52,7 @@ spec: backup_configuration: name: backup_configuration title: Backup Configuration + level: 1 altDefaults: - type: ALTERNATE_TYPE_DC value: @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/modules/mysql/metadata.yaml b/modules/mysql/metadata.yaml index c1ec388b..325cfdd1 100644 --- a/modules/mysql/metadata.yaml +++ b/modules/mysql/metadata.yaml @@ -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 @@ -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: diff --git a/modules/mysql/outputs.tf b/modules/mysql/outputs.tf index 3f10fa8e..85f19065 100644 --- a/modules/mysql/outputs.tf +++ b/modules/mysql/outputs.tf @@ -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." -} diff --git a/modules/mysql/variables.tf b/modules/mysql/variables.tf index ba36d481..ab7f7525 100644 --- a/modules/mysql/variables.tf +++ b/modules/mysql/variables.tf @@ -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 } diff --git a/modules/postgresql/README.md b/modules/postgresql/README.md index 5ea35112..09a844c6 100644 --- a/modules/postgresql/README.md +++ b/modules/postgresql/README.md @@ -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) |
list(object({
end_date = string
start_date = string
time = string
}))
| `[]` | 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 | @@ -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 | diff --git a/modules/postgresql/metadata.display.yaml b/modules/postgresql/metadata.display.yaml index a60348d8..fb1bd644 100644 --- a/modules/postgresql/metadata.display.yaml +++ b/modules/postgresql/metadata.display.yaml @@ -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: @@ -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 @@ -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 @@ -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 @@ -225,7 +228,7 @@ spec: region: name: region title: Region - invisible: false + level: 1 root_password: name: root_password title: Root Password @@ -235,6 +238,7 @@ spec: tier: name: tier title: Tier + level: 1 altDefaults: - type: ALTERNATE_TYPE_DC value: db-perf-optimized-N-8 diff --git a/modules/postgresql/metadata.yaml b/modules/postgresql/metadata.yaml index d8ae8435..b0e38968 100644 --- a/modules/postgresql/metadata.yaml +++ b/modules/postgresql/metadata.yaml @@ -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 @@ -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 diff --git a/modules/postgresql/outputs.tf b/modules/postgresql/outputs.tf index 020570b1..4874c5af 100644 --- a/modules/postgresql/outputs.tf +++ b/modules/postgresql/outputs.tf @@ -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." -} diff --git a/modules/postgresql/variables.tf b/modules/postgresql/variables.tf index 5acf729b..23960281 100644 --- a/modules/postgresql/variables.tf +++ b/modules/postgresql/variables.tf @@ -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 }