Skip to content

Commit f75763b

Browse files
authored
feat!: removed require_ssl and change max provider to 6.X (#643)
1 parent f2c91fa commit f75763b

File tree

74 files changed

+160
-151
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+160
-151
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ The current version is 20.X. The following guides are available to assist with u
2323
- [10.X -> 11.0](./docs/upgrading_to_sql_db_11.0.0.md)
2424
- [11.X -> 12.0](./docs/upgrading_to_sql_db_12.0.0.md)
2525
- [19.X -> 20.0](./docs/upgrading_to_sql_db_20.0.0.md)
26+
- [20.X -> 21.0](./docs/upgrading_to_sql_db_21.0.0.md)
2627

2728
## Root module
2829

@@ -79,7 +80,7 @@ For MySQL :
7980
```
8081
module "sql-db" {
8182
source = "GoogleCloudPlatform/sql-db/google//modules/mysql"
82-
version = "~> 21.0"
83+
version = "~> 22.0"
8384
}
8485
```
8586

@@ -88,7 +89,7 @@ or for PostgreSQL :
8889
```
8990
module "sql-db" {
9091
source = "GoogleCloudPlatform/sql-db/google//modules/postgresql"
91-
version = "~> 20.0"
92+
version = "~> 22.0"
9293
}
9394
```
9495

@@ -97,7 +98,7 @@ or for MSSQL Server :
9798
```
9899
module "sql-db" {
99100
source = "GoogleCloudPlatform/sql-db/google//modules/mssql"
100-
version = "~> 20.0"
101+
version = "~> 22.0"
101102
}
102103
```
103104

build/int.cloudbuild.yaml

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ steps:
5555
args: ['/bin/bash', '-c', 'cft test run TestPostgreSqlCrossRegionFailover --stage teardown --verbose']
5656

5757
- id: apply mssql-failover-replica
58-
waitFor: ["init-all", "wait for api activation"]
58+
waitFor: ["init-all", "wait for api activation", "teardown postgresql-cross-region-failover"]
5959
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
6060
args: ['/bin/bash', '-c', 'cft test run TestMsSqlFailoverReplica --stage apply --verbose']
6161
- id: verify mssql-failover-replica
@@ -69,6 +69,23 @@ steps:
6969
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
7070
args: ['/bin/bash', '-c', 'cft test run TestMsSqlFailoverReplica --stage teardown --verbose']
7171

72+
- id: apply mysql-private-local
73+
waitFor: ["init-all", "wait for api activation", "teardown mssql-failover-replica"]
74+
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
75+
args: ['/bin/bash', '-c', 'cft test run TestMySqlPrivateModule --stage apply --verbose']
76+
- id: verify mysql-private-local
77+
waitFor:
78+
- apply mysql-private-local
79+
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
80+
args: ['/bin/bash', '-c', 'cft test run TestMySqlPrivateModule --stage verify --verbose']
81+
82+
# Disabling due to issue: https://github.com/hashicorp/terraform-provider-google/issues/16275
83+
- id: teardown mysql-private-local
84+
waitFor:
85+
- verify mysql-private-local
86+
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
87+
args: ['/bin/bash', '-c', 'cft test run TestMySqlPrivateModule --stage teardown --verbose']
88+
7289
- id: apply mssql-ha-local
7390
waitFor: ["init-all", "wait for api activation"]
7491
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
@@ -129,22 +146,6 @@ steps:
129146
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
130147
args: ['/bin/bash', '-c', 'cft test run TestMySqlPscModule --stage teardown --verbose']
131148

132-
- id: apply mysql-private-local
133-
waitFor: ["init-all", "wait for api activation"]
134-
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
135-
args: ['/bin/bash', '-c', 'cft test run TestMySqlPrivateModule --stage apply --verbose']
136-
- id: verify mysql-private-local
137-
waitFor:
138-
- apply mysql-private-local
139-
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
140-
args: ['/bin/bash', '-c', 'cft test run TestMySqlPrivateModule --stage verify --verbose']
141-
142-
# Disabling due to issue: https://github.com/hashicorp/terraform-provider-google/issues/16275
143-
# - id: teardown mysql-private-local
144-
# waitFor:
145-
# - verify mysql-private-local
146-
# name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
147-
# args: ['/bin/bash', '-c', 'cft test run TestMySqlPrivateModule --stage teardown --verbose']
148149

149150
- id: apply mysql-public-local
150151
waitFor: ["init-all", "wait for api activation"]
@@ -257,4 +258,4 @@ tags:
257258
substitutions:
258259
_DOCKER_IMAGE_DEVELOPER_TOOLS: 'cft/developer-tools'
259260
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '1.20'
260-
_API_ACTIVATION_SECONDS_WAIT: '900'
261+
_API_ACTIVATION_SECONDS_WAIT: '300'

docs/upgrading_to_sql_db_21.0.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Upgrading to SQL DB 21.0
2+
3+
The 21.0 release of SQL DB is a backward incompatible release.
4+
5+
# Maximum provider version
6+
This update requires upgrading the minimum Terraform version `1.3`. Minimum provider version for `private_service_access` sub-module is `5.38`
7+
8+
# Removed settings.ip_configuration.require_ssl
9+
Removed `settings.ip_configuration.require_ssl` from all the modules (`google_sql_database_instance`) in favor of `settings.ip_configuration.ssl_mode`. This field is not available in [provider version 6+](https://github.com/hashicorp/terraform-provider-google/pull/19263)

docs/upgrading_to_sql_db_22.0.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Upgrading to SQL DB 22.0
2+
3+
The 22.0 release of SQL DB is a backward incompatible release.
4+
5+
# Maximum provider version
6+
This update requires upgrading the minimum Terraform version `1.3`. Maximum provider version is relaxed to use provider version 6.X+
7+
8+
# Removed settings.ip_configuration.require_ssl
9+
Removed `settings.ip_configuration.require_ssl` from all the modules (`google_sql_database_instance`) in favor of `settings.ip_configuration.ssl_mode`. This field is not available in [provider version 6+](https://registry.terraform.io/providers/hashicorp/google/5.43.0/docs/guides/version_6_upgrade#resource-google_sql_database_instance)

examples/mssql-failover-replica/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Promote instance 2 as primary and change instance 1 as failover replica
2323
```diff
2424
module "mssql2" {
2525
source = "terraform-google-modules/sql-db/google//modules/mssql"
26-
version = "~> 21.0"
26+
version = "~> 22.0"
2727

2828
- master_instance_name = module.mssql1.instance_name
2929

@@ -36,7 +36,7 @@ module "mssql2" {
3636
```diff
3737
- module "mssql1" {
3838
- source = "terraform-google-modules/sql-db/google//modules/mssql"
39-
- version = "~> 20.0"
39+
- version = "~> 22.0"
4040
- region = local.region_1
4141
- name = "tf-mssql-public-1"
4242
- random_instance_name = true

examples/mssql-failover-replica/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ module "mssql1" {
5656

5757
module "mssql2" {
5858
source = "terraform-google-modules/sql-db/google//modules/mssql"
59-
version = "~> 21.0"
59+
version = "~> 22.0"
6060

6161
master_instance_name = module.mssql1.instance_name
6262

examples/mssql-public/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
module "mssql" {
1818
source = "terraform-google-modules/sql-db/google//modules/mssql"
19-
version = "~> 21.0"
19+
version = "~> 22.0"
2020

2121
name = var.name
2222
random_instance_name = true

examples/mysql-backup-create-service-account/main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
module "mysql" {
1818
source = "terraform-google-modules/sql-db/google//modules/mysql"
19-
version = "~> 21.0"
19+
version = "~> 22.0"
2020

2121
name = "example-mysql-public"
2222
database_version = "MYSQL_8_0"
@@ -29,7 +29,7 @@ module "mysql" {
2929
ip_configuration = {
3030
ipv4_enabled = true
3131
private_network = null
32-
require_ssl = true
32+
ssl_mode = "ALLOW_UNENCRYPTED_AND_ENCRYPTED"
3333
allocated_ip_range = null
3434
authorized_networks = []
3535
}
@@ -45,7 +45,7 @@ resource "google_storage_bucket" "backup" {
4545

4646
module "backup" {
4747
source = "terraform-google-modules/sql-db/google//modules/backup"
48-
version = "~> 21.0"
48+
version = "~> 22.0"
4949

5050
region = "us-central1"
5151
project_id = var.project_id

examples/mysql-ha/main.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
locals {
1818
read_replica_ip_configuration = {
1919
ipv4_enabled = true
20-
require_ssl = false
20+
ssl_mode = "ALLOW_UNENCRYPTED_AND_ENCRYPTED"
2121
private_network = null
2222
allocated_ip_range = null
2323
authorized_networks = [
@@ -33,7 +33,7 @@ locals {
3333

3434
module "mysql" {
3535
source = "terraform-google-modules/sql-db/google//modules/mysql"
36-
version = "~> 21.0"
36+
version = "~> 22.0"
3737

3838
name = var.mysql_ha_name
3939
random_instance_name = true
@@ -59,7 +59,7 @@ module "mysql" {
5959

6060
ip_configuration = {
6161
ipv4_enabled = true
62-
require_ssl = true
62+
ssl_mode = "ALLOW_UNENCRYPTED_AND_ENCRYPTED"
6363
private_network = null
6464
allocated_ip_range = null
6565
authorized_networks = [

examples/mysql-private/main.tf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,16 @@ module "network-safer-mysql-simple" {
3939

4040
module "private-service-access" {
4141
source = "terraform-google-modules/sql-db/google//modules/private_service_access"
42-
version = "~> 21.0"
42+
version = "~> 22.0"
4343

44-
project_id = var.project_id
45-
vpc_network = module.network-safer-mysql-simple.network_name
44+
project_id = var.project_id
45+
vpc_network = module.network-safer-mysql-simple.network_name
46+
deletion_policy = "ABANDON"
4647
}
4748

4849
module "safer-mysql-db" {
4950
source = "terraform-google-modules/sql-db/google//modules/safer_mysql"
50-
version = "~> 21.0"
51+
version = "~> 22.0"
5152

5253
name = var.db_name
5354
random_instance_name = true

0 commit comments

Comments
 (0)