From 88b78917153e420a7d525c6b4485dd52d171815d Mon Sep 17 00:00:00 2001 From: anluuhoai Date: Wed, 25 Dec 2024 11:28:15 +0700 Subject: [PATCH 1/4] feat: Add reuse_interval to password validation policy configuration --- modules/mysql/main.tf | 1 + modules/mysql/variables.tf | 1 + 2 files changed, 2 insertions(+) diff --git a/modules/mysql/main.tf b/modules/mysql/main.tf index 1816747d..9f3001e0 100644 --- a/modules/mysql/main.tf +++ b/modules/mysql/main.tf @@ -124,6 +124,7 @@ resource "google_sql_database_instance" "default" { min_length = lookup(password_validation_policy.value, "min_length", null) complexity = lookup(password_validation_policy.value, "complexity", null) disallow_username_substring = lookup(password_validation_policy.value, "disallow_username_substring", null) + reuse_interval = lookup(password_validation_policy.value, "reuse_interval", null) } } dynamic "ip_configuration" { diff --git a/modules/mysql/variables.tf b/modules/mysql/variables.tf index ab7f7525..26c89bda 100644 --- a/modules/mysql/variables.tf +++ b/modules/mysql/variables.tf @@ -336,6 +336,7 @@ variable "password_validation_policy_config" { min_length = number complexity = string disallow_username_substring = bool + reuse_interval = number }) default = null } From b086574d5041da630fcc7b828871fff82b3fbba2 Mon Sep 17 00:00:00 2001 From: anluuhoai Date: Fri, 7 Feb 2025 03:21:31 +0700 Subject: [PATCH 2/4] update optional variable --- modules/mysql/variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/mysql/variables.tf b/modules/mysql/variables.tf index 26c89bda..517faa78 100644 --- a/modules/mysql/variables.tf +++ b/modules/mysql/variables.tf @@ -336,7 +336,7 @@ variable "password_validation_policy_config" { min_length = number complexity = string disallow_username_substring = bool - reuse_interval = number + reuse_interval = optional(number) }) default = null } From de6f66744b2c6e418f16d0a7ed057f48a0fc6724 Mon Sep 17 00:00:00 2001 From: anluuhoai Date: Fri, 7 Feb 2025 03:29:27 +0700 Subject: [PATCH 3/4] optional update --- modules/mysql/variables.tf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/mysql/variables.tf b/modules/mysql/variables.tf index 517faa78..04b5802a 100644 --- a/modules/mysql/variables.tf +++ b/modules/mysql/variables.tf @@ -333,9 +333,9 @@ variable "password_validation_policy_config" { description = "The password validation policy settings for the database instance." type = object({ enable_password_policy = bool - min_length = number - complexity = string - disallow_username_substring = bool + min_length = optional(number) + complexity = optional(string) + disallow_username_substring = optional(bool) reuse_interval = optional(number) }) default = null From 1d1ba06be03529b6c532d87fb677b29dfea07d37 Mon Sep 17 00:00:00 2001 From: anluuhoai Date: Mon, 10 Feb 2025 13:00:28 +0700 Subject: [PATCH 4/4] readme --- modules/mysql/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/mysql/README.md b/modules/mysql/README.md index 87c6aeaa..a102abfa 100644 --- a/modules/mysql/README.md +++ b/modules/mysql/README.md @@ -85,7 +85,7 @@ module "mysql-db" { | master\_instance\_name | The name of the existing instance that will act as the master in the replication setup. | `string` | `null` | no | | module\_depends\_on | List of modules or resources this module depends on. | `list(any)` | `[]` | no | | name | The name of the Cloud SQL resources | `string` | n/a | yes | -| password\_validation\_policy\_config | The password validation policy settings for the database instance. |
object({
enable_password_policy = bool
min_length = number
complexity = string
disallow_username_substring = bool
})
| `null` | no | +| password\_validation\_policy\_config | The password validation policy settings for the database instance. |
object({
enable_password_policy = bool
min_length = optional(number)
complexity = optional(string)
disallow_username_substring = optional(bool)
reuse_interval = optional(number)
})
| `null` | no | | pricing\_plan | The pricing plan for the master instance. | `string` | `"PER_USE"` | no | | project\_id | The project ID to manage the Cloud SQL resources | `string` | n/a | yes | | random\_instance\_name | Sets random suffix at the end of the Cloud SQL resource name | `bool` | `false` | no |