Skip to content

Commit a0e8d18

Browse files
authored
chore: Update variable's order in variables.tf and update display met… (#671)
1 parent 5e39538 commit a0e8d18

File tree

6 files changed

+464
-413
lines changed

6 files changed

+464
-413
lines changed

modules/mysql/metadata.display.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ spec:
4040
availability_type:
4141
name: availability_type
4242
title: Availability Type
43+
invisible: false
44+
enumValueLabels:
45+
- label: REGIONAL
46+
value: REGIONAL
47+
- label: ZONAL
48+
value: ZONAL
4349
altDefaults:
4450
- type: ALTERNATE_TYPE_DC
4551
value: REGIONAL
@@ -77,6 +83,11 @@ spec:
7783
database_version:
7884
name: database_version
7985
title: Database Version
86+
enumValueLabels:
87+
- label: MYSQL_8_4
88+
value: MYSQL_8_4
89+
- label: MYSQL_8_0
90+
value: MYSQL_8_0
8091
db_charset:
8192
name: db_charset
8293
title: Db Charset
@@ -86,6 +97,7 @@ spec:
8697
db_name:
8798
name: db_name
8899
title: Db Name
100+
invisible: false
89101
delete_timeout:
90102
name: delete_timeout
91103
title: Delete Timeout
@@ -119,15 +131,23 @@ spec:
119131
edition:
120132
name: edition
121133
title: Edition
134+
invisible: false
135+
enumValueLabels:
136+
- label: ENTERPRISE_PLUS
137+
value: ENTERPRISE_PLUS
138+
- label: ENTERPRISE
139+
value: ENTERPRISE
122140
altDefaults:
123141
- type: ALTERNATE_TYPE_DC
124142
value: ENTERPRISE_PLUS
125143
enable_default_db:
126144
name: enable_default_db
127145
title: Enable Default Db
146+
invisible: false
128147
enable_default_user:
129148
name: enable_default_user
130149
title: Enable Default User
150+
invisible: false
131151
enable_google_ml_integration:
132152
name: enable_google_ml_integration
133153
title: Enable Google Ml Integration
@@ -170,6 +190,8 @@ spec:
170190
name:
171191
name: name
172192
title: Name
193+
regexValidation: ^[a-z][a-z0-9-]{0,95}[a-z0-9]$
194+
validation: Use lowercase letters, numbers, and hyphens. Start with a letter and end with letter/number. Must be 97 characters or fewer.
173195
password_validation_policy_config:
174196
name: password_validation_policy_config
175197
title: Password Validation Policy Config
@@ -197,6 +219,7 @@ spec:
197219
region:
198220
name: region
199221
title: Region
222+
invisible: false
200223
replica_database_version:
201224
name: replica_database_version
202225
title: Replica Database Version

modules/mysql/metadata.yaml

Lines changed: 96 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,103 @@ spec:
6666
description: The project ID to manage the Cloud SQL resources
6767
varType: string
6868
required: true
69+
- name: region
70+
description: The region of the Cloud SQL resources
71+
varType: string
72+
defaultValue: us-central1
6973
- name: name
7074
description: The name of the Cloud SQL resources
7175
varType: string
7276
required: true
77+
- name: edition
78+
description: The edition of the instance, can be ENTERPRISE or ENTERPRISE_PLUS.
79+
varType: string
80+
- name: database_version
81+
description: The database version to use
82+
varType: string
83+
required: true
84+
- name: availability_type
85+
description: The availability type for the master instance. Can be either `REGIONAL` or `null`.
86+
varType: string
87+
defaultValue: REGIONAL
88+
- name: enable_default_db
89+
description: Enable or disable the creation of the default database
90+
varType: bool
91+
defaultValue: true
92+
- name: db_name
93+
description: The name of the default database to create
94+
varType: string
95+
defaultValue: default
96+
- name: enable_default_user
97+
description: Enable or disable the creation of the default user
98+
varType: bool
99+
defaultValue: true
100+
- name: user_name
101+
description: The name of the default user
102+
varType: string
103+
defaultValue: default
104+
- name: user_host
105+
description: The host for the default user
106+
varType: string
107+
defaultValue: "%"
108+
- name: root_password
109+
description: MySQL password for the root user.
110+
varType: string
111+
- name: user_password
112+
description: The password for the default user. If not set, a random one will be generated and available in the generated_user_password output variable.
113+
varType: string
114+
defaultValue: ""
115+
- name: deletion_protection
116+
description: Used to block Terraform from deleting a SQL Instance.
117+
varType: bool
118+
defaultValue: true
119+
- name: user_deletion_policy
120+
description: "The deletion policy for the user. Setting ABANDON allows the resource to be abandoned rather than deleted. This is useful for Postgres, where users cannot be deleted from the API if they have been granted SQL roles. Possible values are: \"ABANDON\"."
121+
varType: string
122+
- name: data_cache_enabled
123+
description: Whether data cache is enabled for the instance. Defaults to false. Feature is only available for ENTERPRISE_PLUS tier and supported database_versions
124+
varType: bool
125+
defaultValue: false
126+
- name: additional_databases
127+
description: A list of databases to be created in your cluster
128+
varType: |-
129+
list(object({
130+
name = string
131+
charset = string
132+
collation = string
133+
}))
134+
defaultValue: []
135+
- name: additional_users
136+
description: A list of users to be created in your cluster. A random password would be set for the user if the `random_password` variable is set.
137+
varType: |-
138+
list(object({
139+
name = string
140+
password = string
141+
random_password = bool
142+
type = string
143+
host = string
144+
}))
145+
defaultValue: []
146+
- name: iam_users
147+
description: A list of IAM users to be created in your CloudSQL instance. iam.users.type can be CLOUD_IAM_USER, CLOUD_IAM_SERVICE_ACCOUNT, CLOUD_IAM_GROUP and is required for type CLOUD_IAM_GROUP (IAM groups)
148+
varType: |-
149+
list(object({
150+
id = string,
151+
email = string,
152+
type = optional(string)
153+
}))
154+
defaultValue: []
155+
connections:
156+
- source:
157+
source: github.com/terraform-google-modules/terraform-google-service-accounts//modules/simple-sa
158+
version: ">= 4.4"
159+
spec:
160+
outputExpr: "{\"id\": account_details.id, \"email\": account_details.email, \"type\": \"CLOUD_IAM_SERVICE_ACCOUNT\"}"
161+
- source:
162+
source: github.com/GoogleCloudPlatform/terraform-google-cloud-run//modules/v2
163+
version: ">= 0.14"
164+
spec:
165+
outputExpr: "{\"id\": service_account_id.id, \"email\": service_account_id.email, \"type\": \"CLOUD_IAM_SERVICE_ACCOUNT\"}"
73166
- name: random_instance_name
74167
description: Sets random suffix at the end of the Cloud SQL resource name
75168
varType: bool
@@ -78,14 +171,6 @@ spec:
78171
description: The read replica database version to use. This var should only be used during a database update. The update sequence 1. read-replica 2. master, setting this to an updated version will cause the replica to update, then you may update the master with the var database_version and remove this field after update is complete
79172
varType: string
80173
defaultValue: ""
81-
- name: database_version
82-
description: The database version to use
83-
varType: string
84-
required: true
85-
- name: region
86-
description: The region of the Cloud SQL resources
87-
varType: string
88-
defaultValue: us-central1
89174
- name: master_instance_name
90175
description: The name of the existing instance that will act as the master in the replication setup.
91176
varType: string
@@ -96,9 +181,6 @@ spec:
96181
description: The tier for the master instance.
97182
varType: string
98183
defaultValue: db-n1-standard-1
99-
- name: edition
100-
description: The edition of the instance, can be ENTERPRISE or ENTERPRISE_PLUS.
101-
varType: string
102184
- name: zone
103185
description: "The zone for the master instance, it should be something like: `us-central1-a`, `us-east1-c`."
104186
varType: string
@@ -112,10 +194,6 @@ spec:
112194
description: The activation policy for the master instance. Can be either `ALWAYS`, `NEVER` or `ON_DEMAND`.
113195
varType: string
114196
defaultValue: ALWAYS
115-
- name: availability_type
116-
description: The availability type for the master instance. Can be either `REGIONAL` or `null`.
117-
varType: string
118-
defaultValue: REGIONAL
119197
- name: deletion_protection_enabled
120198
description: Enables protection of an instance from accidental deletion across all surfaces (API, gcloud, Cloud Console and Terraform).
121199
varType: bool
@@ -168,10 +246,6 @@ spec:
168246
description: The key/value labels for the master instances.
169247
varType: map(string)
170248
defaultValue: {}
171-
- name: data_cache_enabled
172-
description: Whether data cache is enabled for the instance. Defaults to false. Feature is only available for ENTERPRISE_PLUS tier and supported database_versions
173-
varType: bool
174-
defaultValue: false
175249
- name: deny_maintenance_period
176250
description: 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)
177251
varType: |-
@@ -221,7 +295,7 @@ spec:
221295
connections:
222296
- source:
223297
source: github.com/terraform-google-modules/terraform-google-network//modules/vpc
224-
version: ~> 9.1
298+
version: ">= 9.1"
225299
spec:
226300
outputExpr: network_id
227301
inputPath: private_network
@@ -281,10 +355,6 @@ spec:
281355
description: The optional suffix to add to the read instance name
282356
varType: string
283357
defaultValue: ""
284-
- name: db_name
285-
description: The name of the default database to create
286-
varType: string
287-
defaultValue: default
288358
- name: db_charset
289359
description: The charset for the default database
290360
varType: string
@@ -293,60 +363,6 @@ spec:
293363
description: "The collation for the default database. Example: 'utf8_general_ci'"
294364
varType: string
295365
defaultValue: ""
296-
- name: additional_databases
297-
description: A list of databases to be created in your cluster
298-
varType: |-
299-
list(object({
300-
name = string
301-
charset = string
302-
collation = string
303-
}))
304-
defaultValue: []
305-
- name: user_name
306-
description: The name of the default user
307-
varType: string
308-
defaultValue: default
309-
- name: user_host
310-
description: The host for the default user
311-
varType: string
312-
defaultValue: "%"
313-
- name: root_password
314-
description: MySQL password for the root user.
315-
varType: string
316-
- name: user_password
317-
description: The password for the default user. If not set, a random one will be generated and available in the generated_user_password output variable.
318-
varType: string
319-
defaultValue: ""
320-
- name: additional_users
321-
description: A list of users to be created in your cluster. A random password would be set for the user if the `random_password` variable is set.
322-
varType: |-
323-
list(object({
324-
name = string
325-
password = string
326-
random_password = bool
327-
type = string
328-
host = string
329-
}))
330-
defaultValue: []
331-
- name: iam_users
332-
description: A list of IAM users to be created in your CloudSQL instance
333-
varType: |-
334-
list(object({
335-
id = string,
336-
email = string
337-
}))
338-
defaultValue: []
339-
connections:
340-
- source:
341-
source: github.com/terraform-google-modules/terraform-google-service-accounts//modules/simple-sa
342-
version: ~> 4.4
343-
spec:
344-
outputExpr: account_details
345-
- source:
346-
source: github.com/GoogleCloudPlatform/terraform-google-cloud-run//modules/v2
347-
version: ">= 0.14"
348-
spec:
349-
outputExpr: service_account_id
350366
- name: create_timeout
351367
description: The optional timout that is applied to limit long database creates.
352368
varType: string
@@ -366,22 +382,10 @@ spec:
366382
description: List of modules or resources this module depends on.
367383
varType: list(any)
368384
defaultValue: []
369-
- name: deletion_protection
370-
description: Used to block Terraform from deleting a SQL Instance.
371-
varType: bool
372-
defaultValue: true
373385
- name: read_replica_deletion_protection
374386
description: Used to block Terraform from deleting replica SQL Instances.
375387
varType: bool
376388
defaultValue: false
377-
- name: enable_default_db
378-
description: Enable or disable the creation of the default database
379-
varType: bool
380-
defaultValue: true
381-
- name: enable_default_user
382-
description: Enable or disable the creation of the default user
383-
varType: bool
384-
defaultValue: true
385389
- name: enable_random_password_special
386390
description: Enable special characters in generated random passwords.
387391
varType: bool
@@ -390,9 +394,6 @@ spec:
390394
description: Enforce that clients use the connector library
391395
varType: bool
392396
defaultValue: false
393-
- name: user_deletion_policy
394-
description: "The deletion policy for the user. Setting ABANDON allows the resource to be abandoned rather than deleted. This is useful for Postgres, where users cannot be deleted from the API if they have been granted SQL roles. Possible values are: \"ABANDON\"."
395-
varType: string
396397
- name: enable_google_ml_integration
397398
description: Enable database ML integration
398399
varType: bool
@@ -922,9 +923,9 @@ spec:
922923
- workflows.googleapis.com
923924
providerVersions:
924925
- source: hashicorp/google
925-
version: ">= 5.25, < 7"
926+
version: ">= 6.1, < 7"
926927
- source: hashicorp/google-beta
927-
version: ">= 5.25, < 7"
928+
version: ">= 6.1, < 7"
928929
- source: hashicorp/null
929930
version: ~> 3.1
930931
- source: hashicorp/random

0 commit comments

Comments
 (0)