Skip to content

Commit de13aa9

Browse files
authored
fix!: remove output variable apphub_service_uri from postgersql/mysql module as it is not supported (#676)
1 parent f01ab48 commit de13aa9

File tree

11 files changed

+43
-48
lines changed

11 files changed

+43
-48
lines changed

docs/upgrading_to_sql_db_24.0.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Upgrading to v24.0
2+
3+
The v24.0 release contains backwards-incompatible changes.
4+
5+
## Replace uses of apphub_service_uri
6+
7+
This release removes apphub_service_uri output. You can replace use of `apphub_service_uri` by forming the desired output as below,
8+
9+
```
10+
{
11+
service_uri = "//cloudsql.googleapis.com/projects${element(split("/projects", module.mysql.instance_self_link), 1)}"
12+
service_id = substr(format("%s-%s", <instance-name>, md5(module.mysql.instance_self_link)), 0, 63)
13+
}
14+
```

modules/mysql/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ module "mysql-db" {
6565
| 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 |
6666
| disk\_autoresize | Configuration to increase storage size | `bool` | `true` | no |
6767
| disk\_autoresize\_limit | The maximum size to which storage can be auto increased. | `number` | `0` | no |
68-
| disk\_size | The disk size for the master instance | `number` | `10` | no |
68+
| disk\_size | The disk size (in GB) for the master instance | `number` | `10` | no |
6969
| disk\_type | The disk type for the master instance. | `string` | `"PD_SSD"` | no |
7070
| edition | The edition of the instance, can be ENTERPRISE or ENTERPRISE\_PLUS. | `string` | `null` | no |
7171
| enable\_default\_db | Enable or disable the creation of the default database | `bool` | `true` | no |
@@ -110,7 +110,6 @@ module "mysql-db" {
110110
| Name | Description |
111111
|------|-------------|
112112
| additional\_users | List of maps of additional users and passwords |
113-
| apphub\_service\_uri | Service URI in CAIS style to be used by Apphub. |
114113
| env\_vars | Exported environment variables |
115114
| generated\_user\_password | The auto generated default user password if not input password was provided |
116115
| iam\_users | The list of the IAM users with access to the CloudSQL instance |

modules/mysql/metadata.display.yaml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ spec:
4040
availability_type:
4141
name: availability_type
4242
title: Availability Type
43-
invisible: false
43+
level: 1
4444
enumValueLabels:
4545
- label: REGIONAL
4646
value: REGIONAL
@@ -52,6 +52,7 @@ spec:
5252
backup_configuration:
5353
name: backup_configuration
5454
title: Backup Configuration
55+
level: 1
5556
altDefaults:
5657
- type: ALTERNATE_TYPE_DC
5758
value:
@@ -97,7 +98,7 @@ spec:
9798
db_name:
9899
name: db_name
99100
title: Db Name
100-
invisible: false
101+
level: 1
101102
delete_timeout:
102103
name: delete_timeout
103104
title: Delete Timeout
@@ -125,13 +126,15 @@ spec:
125126
disk_size:
126127
name: disk_size
127128
title: Disk Size
129+
level: 1
128130
disk_type:
129131
name: disk_type
130132
title: Disk Type
133+
level: 1
131134
edition:
132135
name: edition
133136
title: Edition
134-
invisible: false
137+
level: 1
135138
enumValueLabels:
136139
- label: ENTERPRISE_PLUS
137140
value: ENTERPRISE_PLUS
@@ -143,11 +146,11 @@ spec:
143146
enable_default_db:
144147
name: enable_default_db
145148
title: Enable Default Db
146-
invisible: false
149+
level: 1
147150
enable_default_user:
148151
name: enable_default_user
149152
title: Enable Default User
150-
invisible: false
153+
level: 1
151154
enable_google_ml_integration:
152155
name: enable_google_ml_integration
153156
title: Enable Google Ml Integration
@@ -219,7 +222,7 @@ spec:
219222
region:
220223
name: region
221224
title: Region
222-
invisible: false
225+
level: 1
223226
replica_database_version:
224227
name: replica_database_version
225228
title: Replica Database Version
@@ -232,6 +235,10 @@ spec:
232235
tier:
233236
name: tier
234237
title: Tier
238+
level: 1
239+
altDefaults:
240+
- type: ALTERNATE_TYPE_DC
241+
value: db-perf-optimized-N-8
235242
update_timeout:
236243
name: update_timeout
237244
title: Update Timeout

modules/mysql/metadata.yaml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ spec:
211211
varType: number
212212
defaultValue: 0
213213
- name: disk_size
214-
description: The disk size for the master instance
214+
description: The disk size (in GB) for the master instance
215215
varType: number
216216
defaultValue: 10
217217
- name: disk_type
@@ -408,12 +408,6 @@ spec:
408408
type:
409409
- tuple
410410
- []
411-
- name: apphub_service_uri
412-
description: Service URI in CAIS style to be used by Apphub.
413-
type:
414-
- object
415-
- service_id: string
416-
service_uri: string
417411
- name: env_vars
418412
description: Exported environment variables
419413
type:

modules/mysql/outputs.tf

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,3 @@ output "env_vars" {
154154
"CLOUD_SQL_DATABASE_NAME" : local.database_name
155155
}
156156
}
157-
158-
output "apphub_service_uri" {
159-
value = {
160-
service_uri = "//cloudsql.googleapis.com/projects${element(split("/projects", google_sql_database_instance.default.self_link), 1)}"
161-
service_id = substr(format("%s-%s", var.name, md5(var.project_id)), 0, 63)
162-
}
163-
description = "Service URI in CAIS style to be used by Apphub."
164-
}

modules/mysql/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ variable "disk_autoresize_limit" {
227227
}
228228

229229
variable "disk_size" {
230-
description = "The disk size for the master instance"
230+
description = "The disk size (in GB) for the master instance"
231231
type = number
232232
default = 10
233233
}

modules/postgresql/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ module "pg" {
137137
| 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 |
138138
| disk\_autoresize | Configuration to increase storage size. | `bool` | `true` | no |
139139
| disk\_autoresize\_limit | The maximum size to which storage can be auto increased. | `number` | `0` | no |
140-
| disk\_size | The disk size for the Cloud SQL instance. | `number` | `10` | no |
140+
| disk\_size | The disk size (in GB) for the Cloud SQL instance. | `number` | `10` | no |
141141
| disk\_type | The disk type for the Cloud SQL instance. | `string` | `"PD_SSD"` | no |
142142
| edition | The edition of the Cloud SQL instance, can be ENTERPRISE or ENTERPRISE\_PLUS. | `string` | `null` | no |
143143
| enable\_default\_db | Enable or disable the creation of the default database | `bool` | `true` | no |
@@ -180,7 +180,6 @@ module "pg" {
180180
| Name | Description |
181181
|------|-------------|
182182
| additional\_users | List of maps of additional users and passwords |
183-
| apphub\_service\_uri | Service URI in CAIS style to be used by Apphub. |
184183
| dns\_name | DNS name of the instance endpoint |
185184
| env\_vars | Exported environment variables |
186185
| generated\_user\_password | The auto generated default user password if not input password was provided |

modules/postgresql/metadata.display.yaml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,14 @@ spec:
4040
availability_type:
4141
name: availability_type
4242
title: Availability Type
43-
invisible: false
43+
level: 1
4444
altDefaults:
4545
- type: ALTERNATE_TYPE_DC
4646
value: REGIONAL
4747
backup_configuration:
4848
name: backup_configuration
4949
title: Backup Configuration
50+
level: 1
5051
altDefaults:
5152
- type: ALTERNATE_TYPE_DC
5253
value:
@@ -103,7 +104,7 @@ spec:
103104
db_name:
104105
name: db_name
105106
title: Db Name
106-
invisible: false
107+
level: 1
107108
delete_timeout:
108109
name: delete_timeout
109110
title: Delete Timeout
@@ -131,13 +132,15 @@ spec:
131132
disk_size:
132133
name: disk_size
133134
title: Disk Size
135+
level: 1
134136
disk_type:
135137
name: disk_type
136138
title: Disk Type
139+
level: 1
137140
edition:
138141
name: edition
139142
title: Edition
140-
invisible: false
143+
level: 1
141144
enumValueLabels:
142145
- label: ENTERPRISE_PLUS
143146
value: ENTERPRISE_PLUS
@@ -149,11 +152,11 @@ spec:
149152
enable_default_db:
150153
name: enable_default_db
151154
title: Enable Default Db
152-
invisible: false
155+
level: 1
153156
enable_default_user:
154157
name: enable_default_user
155158
title: Enable Default User
156-
invisible: false
159+
level: 1
157160
enable_google_ml_integration:
158161
name: enable_google_ml_integration
159162
title: Enable Google Ml Integration
@@ -225,7 +228,7 @@ spec:
225228
region:
226229
name: region
227230
title: Region
228-
invisible: false
231+
level: 1
229232
root_password:
230233
name: root_password
231234
title: Root Password
@@ -235,6 +238,7 @@ spec:
235238
tier:
236239
name: tier
237240
title: Tier
241+
level: 1
238242
altDefaults:
239243
- type: ALTERNATE_TYPE_DC
240244
value: db-perf-optimized-N-8

modules/postgresql/metadata.yaml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ spec:
190190
varType: number
191191
defaultValue: 0
192192
- name: disk_size
193-
description: The disk size for the Cloud SQL instance.
193+
description: The disk size (in GB) for the Cloud SQL instance.
194194
varType: number
195195
defaultValue: 10
196196
- name: disk_type
@@ -398,12 +398,6 @@ spec:
398398
type:
399399
- tuple
400400
- []
401-
- name: apphub_service_uri
402-
description: Service URI in CAIS style to be used by Apphub.
403-
type:
404-
- object
405-
- service_id: string
406-
service_uri: string
407401
- name: dns_name
408402
description: DNS name of the instance endpoint
409403
type: string

modules/postgresql/outputs.tf

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,3 @@ output "env_vars" {
152152
"CLOUD_SQL_DATABASE_NAME" : local.database_name
153153
}
154154
}
155-
156-
output "apphub_service_uri" {
157-
value = {
158-
service_uri = "//cloudsql.googleapis.com/projects${element(split("/projects", google_sql_database_instance.default.self_link), 1)}"
159-
service_id = substr(format("%s-%s", var.name, md5(var.project_id)), 0, 63)
160-
}
161-
description = "Service URI in CAIS style to be used by Apphub."
162-
}

modules/postgresql/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ variable "disk_autoresize_limit" {
213213
}
214214

215215
variable "disk_size" {
216-
description = "The disk size for the Cloud SQL instance."
216+
description = "The disk size (in GB) for the Cloud SQL instance."
217217
type = number
218218
default = 10
219219
}

0 commit comments

Comments
 (0)