|
1 | 1 | # Upgrading to SQL DB 14.0.0 |
2 | 2 |
|
3 | | -The 14.0.0 release of SQL DB is a backward incompatible release. This incompatibility affects `postgresql` submodule that uses IAM authentication. |
| 3 | +The 14.0.0 release of SQL DB is a backward incompatible release. This incompatibility affects `postgresql` submodule that uses IAM authentication. It also affects `additional_users` variable in all 3 modules. |
4 | 4 |
|
5 | 5 | ## Migration Instructions |
6 | 6 |
|
@@ -113,3 +113,111 @@ done |
113 | 113 | ``` |
114 | 114 |
|
115 | 115 | After IAM bindings are moved, **terraform apply should be without any changes**. |
| 116 | + |
| 117 | +### Added `random_password` field in `additional_users` variable in postgresql module |
| 118 | +This change is in effort to align the behavior of `additional_users` variable in all the modules. Setting `random_password` field generates a random password for the user. Exactly one of `password` or `random_password` should be set. |
| 119 | + |
| 120 | +```diff |
| 121 | +module "pg" { |
| 122 | + source = "GoogleCloudPlatform/sql-db/google//modules/postgresql" |
| 123 | +- version = "~> 13.0" |
| 124 | ++ version = "~> 14.0" |
| 125 | + |
| 126 | + name = "test" |
| 127 | + database_version = "POSTGRES_14" |
| 128 | + project_id = var.project_id |
| 129 | + zone = "europe-west1-b" |
| 130 | + region = "europe-west1" |
| 131 | + tier = "db-custom-1-3840" |
| 132 | + |
| 133 | + additional_users = [ |
| 134 | + { |
| 135 | + name = "john" |
| 136 | + password = "password" |
| 137 | ++ random_password = false |
| 138 | + } |
| 139 | + ] |
| 140 | +} |
| 141 | +``` |
| 142 | + |
| 143 | +### Added `random_password` field in `additional_users` variable in mssql module |
| 144 | +This change is in effort to align the behavior of `additional_users` variable in all the modules. Setting `random_password` field generates a random password for the user. At most one of `password` or `random_password` should be set. |
| 145 | + |
| 146 | +```diff |
| 147 | +module "mssql" { |
| 148 | + source = "GoogleCloudPlatform/sql-db/google//modules/mssql" |
| 149 | +- version = "~> 13.0" |
| 150 | ++ version = "~> 14.0" |
| 151 | + |
| 152 | + name = "test" |
| 153 | + database_version = "SQLSERVER_2017_STANDARD" |
| 154 | + project_id = var.project_id |
| 155 | + zone = "europe-west1-b" |
| 156 | + region = "europe-west1" |
| 157 | + tier = "db-custom-1-3840" |
| 158 | + |
| 159 | + additional_users = [ |
| 160 | + { |
| 161 | + name = "john" |
| 162 | + password = "password" |
| 163 | ++ random_password = false |
| 164 | + } |
| 165 | + ] |
| 166 | +} |
| 167 | +``` |
| 168 | + |
| 169 | +### Changed the variable type of `additional_users` in mysql module |
| 170 | +This change is in effort to align the behavior of `additional_users` variable in all the modules. Setting `random_password` field generates a random password for the user. At most one of `password` or `random_password` should be set. `user_host` would be the host value for the additional users if the `host` field is set as `null`. You can use `type` to create IAM users. |
| 171 | + |
| 172 | +```diff |
| 173 | +module "mysql" { |
| 174 | + source = "GoogleCloudPlatform/sql-db/google//modules/mysql" |
| 175 | +- version = "~> 13.0" |
| 176 | ++ version = "~> 14.0" |
| 177 | + |
| 178 | + name = "test" |
| 179 | + database_version = "MYSQL_8_0" |
| 180 | + project_id = var.project_id |
| 181 | + zone = "europe-west1-b" |
| 182 | + region = "europe-west1" |
| 183 | + tier = "db-custom-1-3840" |
| 184 | + |
| 185 | + additional_users = [ |
| 186 | + { |
| 187 | + name = "john" |
| 188 | + password = "password" |
| 189 | ++ random_password = false |
| 190 | ++ host = null |
| 191 | ++ type = null |
| 192 | + } |
| 193 | + ] |
| 194 | +} |
| 195 | +``` |
| 196 | + |
| 197 | +### Added `random_password` field in `additional_users` variable in safer_mysql module |
| 198 | +This change is in effort to align the behavior of `additional_users` variable in all the modules. Setting `random_password` field generates a random password for the user. At most one of `password` or `random_password` should be set. |
| 199 | + |
| 200 | +```diff |
| 201 | +module "smysql" { |
| 202 | + source = "GoogleCloudPlatform/sql-db/google//modules/safer_mysql" |
| 203 | +- version = "~> 13.0" |
| 204 | ++ version = "~> 14.0" |
| 205 | + |
| 206 | + name = "test" |
| 207 | + database_version = "MYSQL_8_0" |
| 208 | + project_id = var.project_id |
| 209 | + zone = "europe-west1-b" |
| 210 | + region = "europe-west1" |
| 211 | + tier = "db-custom-1-3840" |
| 212 | + |
| 213 | + additional_users = [ |
| 214 | + { |
| 215 | + name = "john" |
| 216 | + password = "password" |
| 217 | + type = "BUILT_IN" |
| 218 | + host = "%" |
| 219 | ++ random_password = false |
| 220 | + } |
| 221 | + ] |
| 222 | +} |
| 223 | +``` |
0 commit comments