|
| 1 | +# Upgrading to SQL DB 2.0.0 |
| 2 | + |
| 3 | +The 2.0.0 release of SQL DB is a backward incompatible release. This |
| 4 | +incompatibility affects any configuration which uses the root module. |
| 5 | + |
| 6 | +## Instructions |
| 7 | + |
| 8 | +Prior to the 1.1.0 release, the root module was the only mechanism to |
| 9 | +configure databases: |
| 10 | + |
| 11 | +```hcl |
| 12 | +module "sql_db_mysql" { |
| 13 | + source = "GoogleCloudPlatform/sql-db/google" |
| 14 | + version = "1.0.0" |
| 15 | +
|
| 16 | + database_version = "MYSQL_5_6" |
| 17 | + name = "mysql-example" |
| 18 | + project = "example-project" |
| 19 | + region = "us-central1" |
| 20 | +} |
| 21 | +
|
| 22 | +module "sql_db_postgresql" { |
| 23 | + source = "GoogleCloudPlatform/sql-db/google" |
| 24 | + version = "1.0.0" |
| 25 | +
|
| 26 | + database_version = "POSTGRES_9_6" |
| 27 | + name = "postgresql-examlpe" |
| 28 | + project = "example-project" |
| 29 | + region = "us-central1" |
| 30 | +} |
| 31 | +``` |
| 32 | + |
| 33 | +With the 1.1.0 release, submodules were added for each type of |
| 34 | +database. As of the 2.0.0 release, the root module has been removed so |
| 35 | +the submodules must be used: |
| 36 | + |
| 37 | +```diff |
| 38 | + module "sql_db_mysql" { |
| 39 | +- source = "GoogleCloudPlatform/sql-db/google" |
| 40 | ++ source = "GoogleCloudPlatform/sql-db/google//modules/mysql" |
| 41 | +- version = "1.0.0" |
| 42 | ++ version = "~> 2.0" |
| 43 | + |
| 44 | + database_version = "MYSQL_5_6" |
| 45 | + name = "mysql-example" |
| 46 | +- project = "example-project" |
| 47 | ++ project_id = "example-project" |
| 48 | + region = "us-central1" |
| 49 | ++ zone = "us-central1-a" |
| 50 | + } |
| 51 | + |
| 52 | + module "sql_db_postgresql" { |
| 53 | +- source = "GoogleCloudPlatform/sql-db/google" |
| 54 | ++ source = "GoogleCloudPlatform/sql-db/google//modules/postgresql" |
| 55 | +- version = "1.0.0" |
| 56 | ++ version = "~> 2.0" |
| 57 | + |
| 58 | + database_version = "POSTGRES_9_6" |
| 59 | + name = "postgresql-example" |
| 60 | +- project = "example-project" |
| 61 | ++ project_id = "example-project" |
| 62 | + region = "us-central1" |
| 63 | ++ zone = "us-central1-a" |
| 64 | + } |
| 65 | +``` |
0 commit comments