Skip to content

Commit c7ab6ec

Browse files
authored
feat!: Allow passing ssl_mode for MySQL Module (#575)
1 parent bd18ee6 commit c7ab6ec

File tree

6 files changed

+7
-4
lines changed

6 files changed

+7
-4
lines changed

modules/mysql/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Note: CloudSQL provides [disk autoresize](https://cloud.google.com/sql/docs/mysq
3737
| iam\_users | A list of IAM users to be created in your CloudSQL instance | <pre>list(object({<br> id = string,<br> email = string<br> }))</pre> | `[]` | no |
3838
| insights\_config | The insights\_config settings for the database. | <pre>object({<br> query_plans_per_minute = number<br> query_string_length = number<br> record_application_tags = bool<br> record_client_address = bool<br> })</pre> | `null` | no |
3939
| instance\_type | Users can upgrade a read replica instance to a stand-alone Cloud SQL instance with the help of instance\_type. To promote, users have to set the instance\_type property as CLOUD\_SQL\_INSTANCE and remove/unset master\_instance\_name and replica\_configuration from instance configuration. This operation might cause your instance to restart. | `string` | `null` | no |
40-
| ip\_configuration | The ip\_configuration settings subblock | <pre>object({<br> authorized_networks = optional(list(map(string)), [])<br> ipv4_enabled = optional(bool, true)<br> private_network = optional(string)<br> require_ssl = optional(bool)<br> allocated_ip_range = optional(string)<br> enable_private_path_for_google_cloud_services = optional(bool, false)<br> psc_enabled = optional(bool, false)<br> psc_allowed_consumer_projects = optional(list(string), [])<br> })</pre> | `{}` | no |
40+
| ip\_configuration | The ip\_configuration settings subblock | <pre>object({<br> authorized_networks = optional(list(map(string)), [])<br> ipv4_enabled = optional(bool, true)<br> private_network = optional(string)<br> require_ssl = optional(bool)<br> ssl_mode = optional(string)<br> allocated_ip_range = optional(string)<br> enable_private_path_for_google_cloud_services = optional(bool, false)<br> psc_enabled = optional(bool, false)<br> psc_allowed_consumer_projects = optional(list(string), [])<br> })</pre> | `{}` | no |
4141
| maintenance\_window\_day | The day of week (1-7) for the master instance maintenance. | `number` | `1` | no |
4242
| maintenance\_window\_hour | The hour of day (0-23) maintenance window for the master instance maintenance. | `number` | `23` | no |
4343
| maintenance\_window\_update\_track | The update track of maintenance window for the master instance maintenance. Can be either `canary` or `stable`. | `string` | `"canary"` | no |

modules/mysql/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ resource "google_sql_database_instance" "default" {
128128
ipv4_enabled = lookup(ip_configuration.value, "ipv4_enabled", null)
129129
private_network = lookup(ip_configuration.value, "private_network", null)
130130
require_ssl = lookup(ip_configuration.value, "require_ssl", null)
131+
ssl_mode = lookup(ip_configuration.value, "ssl_mode", null)
131132
allocated_ip_range = lookup(ip_configuration.value, "allocated_ip_range", null)
132133
enable_private_path_for_google_cloud_services = lookup(ip_configuration.value, "enable_private_path_for_google_cloud_services", false)
133134

modules/mysql/variables.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ variable "ip_configuration" {
230230
ipv4_enabled = optional(bool, true)
231231
private_network = optional(string)
232232
require_ssl = optional(bool)
233+
ssl_mode = optional(string)
233234
allocated_ip_range = optional(string)
234235
enable_private_path_for_google_cloud_services = optional(bool, false)
235236
psc_enabled = optional(bool, false)

modules/mysql/versions.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ terraform {
2727
}
2828
google = {
2929
source = "hashicorp/google"
30-
version = ">= 4.80.0, < 6"
30+
version = ">= 5.7, < 6"
3131
}
3232
google-beta = {
3333
source = "hashicorp/google-beta"
34-
version = ">= 4.80.0, < 6"
34+
version = ">= 5.7, < 6"
3535
}
3636
}
3737

modules/safer_mysql/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ module "safer_mysql" {
5656
# public IP to be mediated by Cloud SQL.
5757
authorized_networks = []
5858
require_ssl = true
59+
ssl_mode = "TRUSTED_CLIENT_CERTIFICATE_REQUIRED"
5960
private_network = var.vpc_network
6061
allocated_ip_range = var.allocated_ip_range
6162
}

modules/safer_mysql/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ terraform {
2020

2121
google = {
2222
source = "hashicorp/google"
23-
version = ">= 4.74.0, < 6"
23+
version = ">= 5.7, < 6"
2424
}
2525
}
2626

0 commit comments

Comments
 (0)