Skip to content

Commit 15e8be8

Browse files
authored
feat: add support for server_ca_mode and custom SANs (#714) (#736)
1 parent edc7ee7 commit 15e8be8

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

modules/postgresql/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ module "pg" {
151151
| iam\_users | A list of IAM users to be created in your CloudSQL instance. iam.users.type can be CLOUD\_IAM\_USER, CLOUD\_IAM\_SERVICE\_ACCOUNT, CLOUD\_IAM\_GROUP and is required for type CLOUD\_IAM\_GROUP (IAM groups) | <pre>list(object({<br> id = string,<br> email = string,<br> type = optional(string)<br> }))</pre> | `[]` | no |
152152
| insights\_config | The insights\_config settings for the database. | <pre>object({<br> query_plans_per_minute = optional(number, 5)<br> query_string_length = optional(number, 1024)<br> record_application_tags = optional(bool, false)<br> record_client_address = optional(bool, false)<br> })</pre> | `null` | no |
153153
| instance\_type | The type of the instance. The supported values are SQL\_INSTANCE\_TYPE\_UNSPECIFIED, CLOUD\_SQL\_INSTANCE, ON\_PREMISES\_INSTANCE and READ\_REPLICA\_INSTANCE. Set to READ\_REPLICA\_INSTANCE if master\_instance\_name value is provided | `string` | `"CLOUD_SQL_INSTANCE"` | no |
154-
| ip\_configuration | The ip configuration for the Cloud SQL instances. | <pre>object({<br> authorized_networks = optional(list(map(string)), [])<br> ipv4_enabled = optional(bool, true)<br> private_network = optional(string)<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 |
154+
| ip\_configuration | The ip configuration for the Cloud SQL instances. | <pre>object({<br> authorized_networks = optional(list(map(string)), [])<br> ipv4_enabled = optional(bool, true)<br> private_network = optional(string)<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> server_ca_mode = optional(string)<br> server_ca_pool = optional(string)<br> custom_subject_alternative_names = optional(list(string), [])<br> })</pre> | `{}` | no |
155155
| maintenance\_version | The current software version on the instance. This attribute can not be set during creation. Refer to available\_maintenance\_versions attribute to see what maintenance\_version are available for upgrade. When this attribute gets updated, it will cause an instance restart. Setting a maintenance\_version value that is older than the current one on the instance will be ignored | `string` | `null` | no |
156156
| maintenance\_window\_day | The day of week (1-7) for the Cloud SQL instance maintenance. | `number` | `1` | no |
157157
| maintenance\_window\_hour | The hour of day (0-23) maintenance window for the Cloud SQL instance maintenance. | `number` | `23` | no |

modules/postgresql/main.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ resource "google_sql_database_instance" "default" {
126126
ssl_mode = lookup(ip_configuration.value, "ssl_mode", null)
127127
allocated_ip_range = lookup(ip_configuration.value, "allocated_ip_range", null)
128128
enable_private_path_for_google_cloud_services = lookup(ip_configuration.value, "enable_private_path_for_google_cloud_services", false)
129+
server_ca_mode = lookup(ip_configuration.value, "server_ca_mode", null)
130+
server_ca_pool = lookup(ip_configuration.value, "server_ca_pool", null)
131+
custom_subject_alternative_names = lookup(ip_configuration.value, "custom_subject_alternative_names", [])
129132

130133
dynamic "authorized_networks" {
131134
for_each = lookup(ip_configuration.value, "authorized_networks", [])

modules/postgresql/variables.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,9 @@ variable "ip_configuration" {
330330
enable_private_path_for_google_cloud_services = optional(bool, false)
331331
psc_enabled = optional(bool, false)
332332
psc_allowed_consumer_projects = optional(list(string), [])
333+
server_ca_mode = optional(string)
334+
server_ca_pool = optional(string)
335+
custom_subject_alternative_names = optional(list(string), [])
333336
})
334337
default = {}
335338
}

modules/postgresql/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 = ">= 6.17, < 7"
30+
version = ">= 6.31, < 7"
3131
}
3232
google-beta = {
3333
source = "hashicorp/google-beta"
34-
version = ">= 6.17, < 7"
34+
version = ">= 6.31, < 7"
3535
}
3636
}
3737

0 commit comments

Comments
 (0)