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({| `null` | no | +| password\_validation\_policy\_config | The password validation policy settings for the database instance. |
enable_password_policy = bool
min_length = number
complexity = string
disallow_username_substring = bool
})
object({| `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 | diff --git a/modules/mysql/main.tf b/modules/mysql/main.tf index a408118b..df17b938 100644 --- a/modules/mysql/main.tf +++ b/modules/mysql/main.tf @@ -125,6 +125,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 42a6eb99..a3e540ae 100644 --- a/modules/mysql/variables.tf +++ b/modules/mysql/variables.tf @@ -337,9 +337,10 @@ 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 }
enable_password_policy = bool
min_length = optional(number)
complexity = optional(string)
disallow_username_substring = optional(bool)
reuse_interval = optional(number)
})