File tree Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ Note: CloudSQL provides [disk autoresize](https://cloud.google.com/sql/docs/mysq
2323| disk\_ autoresize | Configuration to increase storage size. | bool | ` "true" ` | no |
2424| disk\_ size | The disk size for the master instance. | string | ` "10" ` | no |
2525| disk\_ type | The disk type for the master instance. | string | ` "PD_SSD" ` | no |
26+ | enable\_ default\_ db | Enable or disable the creation of the default database | bool | ` "true" ` | no |
27+ | enable\_ default\_ user | Enable or disable the creation of the default user | bool | ` "true" ` | no |
2628| encryption\_ key\_ name | The full path to the encryption key used for the CMEK disk encryption | string | ` "null" ` | no |
2729| ip\_ configuration | The ip configuration for the master instances. | object | ` <map> ` | no |
2830| maintenance\_ window\_ day | The day of week (1-7) for the master instance maintenance. | number | ` "1" ` | no |
Original file line number Diff line number Diff line change @@ -117,6 +117,7 @@ resource "google_sql_database_instance" "default" {
117117}
118118
119119resource "google_sql_database" "default" {
120+ count = var. enable_default_db ? 1 : 0
120121 name = var. db_name
121122 project = var. project_id
122123 instance = google_sql_database_instance. default . name
@@ -145,6 +146,7 @@ resource "random_id" "user-password" {
145146}
146147
147148resource "google_sql_user" "default" {
149+ count = var. enable_default_user ? 1 : 0
148150 name = var. user_name
149151 project = var. project_id
150152 instance = google_sql_database_instance. default . name
Original file line number Diff line number Diff line change @@ -275,3 +275,15 @@ variable "read_replica_deletion_protection" {
275275 type = bool
276276 default = false
277277}
278+
279+ variable "enable_default_db" {
280+ description = " Enable or disable the creation of the default database"
281+ type = bool
282+ default = true
283+ }
284+
285+ variable "enable_default_user" {
286+ description = " Enable or disable the creation of the default user"
287+ type = bool
288+ default = true
289+ }
You can’t perform that action at this time.
0 commit comments