diff --git a/README.md b/README.md index c66d0a89..da12da79 100644 --- a/README.md +++ b/README.md @@ -36,11 +36,11 @@ The root module has been deprecated. Please switch to using one of the submodule ### Installation Dependencies - [Terraform](https://www.terraform.io/downloads.html) >= 0.13.0 -- [terraform-provider-google](https://github.com/terraform-providers/terraform-provider-google) plugin >= v4.4.0 +- [terraform-provider-google](https://github.com/terraform-providers/terraform-provider-google) plugin >= v4.45.0 The following dependency must be available for SQL Server module: -- [Terraform Provider Beta for GCP](https://github.com/terraform-providers/terraform-provider-google-beta) plugin >= v4.22.0 +- [Terraform Provider Beta for GCP](https://github.com/terraform-providers/terraform-provider-google-beta) plugin >= v4.45.0 ### Configure a Service Account diff --git a/modules/mssql/README.md b/modules/mssql/README.md index 25770280..6fdaa6ef 100644 --- a/modules/mssql/README.md +++ b/modules/mssql/README.md @@ -2,7 +2,7 @@ The following dependency must be available for SQL Server module: -- [Terraform Provider Beta for GCP](https://github.com/terraform-providers/terraform-provider-google-beta) plugin >= 4.22.0 +- [Terraform Provider Beta for GCP](https://github.com/terraform-providers/terraform-provider-google-beta) plugin >= 4.45.0 ## Inputs @@ -23,6 +23,7 @@ The following dependency must be available for SQL Server module: | db\_name | The name of the default database to create | `string` | `"default"` | no | | delete\_timeout | The optional timeout that is applied to limit long database deletes. | `string` | `"30m"` | no | | deletion\_protection | Used to block Terraform from deleting a SQL Instance. | `bool` | `true` | no | +| deny\_maintenance\_period | The Deny Maintenance Period fields to prevent automatic maintenance from occurring during a 90-day time period. See [more details](https://cloud.google.com/sql/docs/sqlserver/maintenance) |
list(object({
end_date = string
start_date = string
time = string
}))
| `[]` | no | | disk\_autoresize | Configuration to increase storage size. | `bool` | `true` | no | | disk\_autoresize\_limit | The maximum size to which storage can be auto increased. | `number` | `0` | no | | disk\_size | The disk size for the master instance. | `number` | `10` | no | diff --git a/modules/mssql/main.tf b/modules/mssql/main.tf index 0d436021..0eea9088 100644 --- a/modules/mssql/main.tf +++ b/modules/mssql/main.tf @@ -72,6 +72,14 @@ resource "google_sql_database_instance" "default" { } } } + dynamic "deny_maintenance_period" { + for_each = var.deny_maintenance_period + content { + end_date = lookup(deny_maintenance_period.value, "end_date", null) + start_date = lookup(deny_maintenance_period.value, "start_date", null) + time = lookup(deny_maintenance_period.value, "time", null) + } + } dynamic "ip_configuration" { for_each = [local.ip_configurations[local.ip_configuration_enabled ? "enabled" : "disabled"]] content { diff --git a/modules/mssql/variables.tf b/modules/mssql/variables.tf index ceb1c0ea..46db0f21 100644 --- a/modules/mssql/variables.tf +++ b/modules/mssql/variables.tf @@ -128,6 +128,16 @@ variable "maintenance_window_update_track" { default = "canary" } +variable "deny_maintenance_period" { + description = "The Deny Maintenance Period fields to prevent automatic maintenance from occurring during a 90-day time period. See [more details](https://cloud.google.com/sql/docs/sqlserver/maintenance)" + type = list(object({ + end_date = string + start_date = string + time = string + })) + default = [] +} + variable "database_flags" { description = "The database flags for the master instance. See [more details](https://cloud.google.com/sql/docs/sqlserver/flags)" type = list(object({ diff --git a/modules/mssql/versions.tf b/modules/mssql/versions.tf index 4af131f5..c53777ab 100644 --- a/modules/mssql/versions.tf +++ b/modules/mssql/versions.tf @@ -20,11 +20,11 @@ terraform { google = { source = "hashicorp/google" - version = ">= 4.28.0, < 5.0" + version = ">= 4.45.0, < 5.0" } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.28.0, < 5.0" + version = ">= 4.45.0, < 5.0" } random = { source = "hashicorp/random" diff --git a/modules/mysql/README.md b/modules/mysql/README.md index f9ca32f5..9bff9a39 100644 --- a/modules/mysql/README.md +++ b/modules/mysql/README.md @@ -20,6 +20,7 @@ Note: CloudSQL provides [disk autoresize](https://cloud.google.com/sql/docs/mysq | db\_name | The name of the default database to create | `string` | `"default"` | no | | delete\_timeout | The optional timout that is applied to limit long database deletes. | `string` | `"10m"` | no | | deletion\_protection | Used to block Terraform from deleting a SQL Instance. | `bool` | `true` | no | +| deny\_maintenance\_period | The Deny Maintenance Period fields to prevent automatic maintenance from occurring during a 90-day time period. See [more details](https://cloud.google.com/sql/docs/mysql/maintenance) |
list(object({
end_date = string
start_date = string
time = string
}))
| `[]` | no | | disk\_autoresize | Configuration to increase storage size | `bool` | `true` | no | | disk\_autoresize\_limit | The maximum size to which storage can be auto increased. | `number` | `0` | no | | disk\_size | The disk size for the master instance | `number` | `10` | no | diff --git a/modules/mysql/main.tf b/modules/mysql/main.tf index 967af67d..c968937a 100644 --- a/modules/mysql/main.tf +++ b/modules/mysql/main.tf @@ -81,6 +81,14 @@ resource "google_sql_database_instance" "default" { record_client_address = lookup(insights_config.value, "record_client_address", false) } } + dynamic "deny_maintenance_period" { + for_each = var.deny_maintenance_period + content { + end_date = lookup(deny_maintenance_period.value, "end_date", null) + start_date = lookup(deny_maintenance_period.value, "start_date", null) + time = lookup(deny_maintenance_period.value, "time", null) + } + } dynamic "ip_configuration" { for_each = [local.ip_configurations[local.ip_configuration_enabled ? "enabled" : "disabled"]] content { diff --git a/modules/mysql/variables.tf b/modules/mysql/variables.tf index 7df8530b..584a20eb 100644 --- a/modules/mysql/variables.tf +++ b/modules/mysql/variables.tf @@ -149,6 +149,16 @@ variable "user_labels" { description = "The key/value labels for the master instances." } +variable "deny_maintenance_period" { + description = "The Deny Maintenance Period fields to prevent automatic maintenance from occurring during a 90-day time period. See [more details](https://cloud.google.com/sql/docs/mysql/maintenance)" + type = list(object({ + end_date = string + start_date = string + time = string + })) + default = [] +} + variable "backup_configuration" { description = "The backup_configuration settings subblock for the database setings" type = object({ diff --git a/modules/mysql/versions.tf b/modules/mysql/versions.tf index ce213aeb..6d9d67f7 100644 --- a/modules/mysql/versions.tf +++ b/modules/mysql/versions.tf @@ -27,11 +27,11 @@ terraform { } google = { source = "hashicorp/google" - version = ">= 4.28.0, < 5.0" + version = ">= 4.45.0, < 5.0" } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.4.0, < 5.0" + version = ">= 4.45.0, < 5.0" } } diff --git a/modules/postgresql/README.md b/modules/postgresql/README.md index a06f99b8..a82c1a27 100644 --- a/modules/postgresql/README.md +++ b/modules/postgresql/README.md @@ -21,6 +21,7 @@ Note: CloudSQL provides [disk autoresize](https://cloud.google.com/sql/docs/mysq | db\_name | The name of the default database to create | `string` | `"default"` | no | | delete\_timeout | The optional timout that is applied to limit long database deletes. | `string` | `"15m"` | no | | deletion\_protection | Used to block Terraform from deleting a SQL Instance. | `bool` | `true` | no | +| deny\_maintenance\_period | The Deny Maintenance Period fields to prevent automatic maintenance from occurring during a 90-day time period. See [more details](https://cloud.google.com/sql/docs/postgres/maintenance) |
list(object({
end_date = string
start_date = string
time = string
}))
| `[]` | no | | disk\_autoresize | Configuration to increase storage size. | `bool` | `true` | no | | disk\_autoresize\_limit | The maximum size to which storage can be auto increased. | `number` | `0` | no | | disk\_size | The disk size for the master instance. | `number` | `10` | no | diff --git a/modules/postgresql/main.tf b/modules/postgresql/main.tf index 654d3ff8..ffce958c 100644 --- a/modules/postgresql/main.tf +++ b/modules/postgresql/main.tf @@ -77,6 +77,14 @@ resource "google_sql_database_instance" "default" { } } } + dynamic "deny_maintenance_period" { + for_each = var.deny_maintenance_period + content { + end_date = lookup(deny_maintenance_period.value, "end_date", null) + start_date = lookup(deny_maintenance_period.value, "start_date", null) + time = lookup(deny_maintenance_period.value, "time", null) + } + } dynamic "ip_configuration" { for_each = [local.ip_configurations[local.ip_configuration_enabled ? "enabled" : "disabled"]] content { diff --git a/modules/postgresql/variables.tf b/modules/postgresql/variables.tf index b327663a..d8c88202 100644 --- a/modules/postgresql/variables.tf +++ b/modules/postgresql/variables.tf @@ -146,6 +146,16 @@ variable "user_labels" { default = {} } +variable "deny_maintenance_period" { + description = "The Deny Maintenance Period fields to prevent automatic maintenance from occurring during a 90-day time period. See [more details](https://cloud.google.com/sql/docs/postgres/maintenance)" + type = list(object({ + end_date = string + start_date = string + time = string + })) + default = [] +} + variable "backup_configuration" { description = "The backup_configuration settings subblock for the database setings" type = object({ diff --git a/modules/postgresql/versions.tf b/modules/postgresql/versions.tf index de90f14f..7ddfe12d 100644 --- a/modules/postgresql/versions.tf +++ b/modules/postgresql/versions.tf @@ -27,11 +27,11 @@ terraform { } google = { source = "hashicorp/google" - version = ">= 4.33.0, < 5.0" + version = ">= 4.45.0, < 5.0" } google-beta = { source = "hashicorp/google-beta" - version = ">= 4.33.0, < 5.0" + version = ">= 4.45.0, < 5.0" } } diff --git a/modules/safer_mysql/README.md b/modules/safer_mysql/README.md index aefc1221..0a1894ef 100644 --- a/modules/safer_mysql/README.md +++ b/modules/safer_mysql/README.md @@ -179,6 +179,7 @@ mysql -S $HOME/mysql_sockets/myproject:region:instance -u user -p | db\_name | The name of the default database to create | `string` | `"default"` | no | | delete\_timeout | The optional timout that is applied to limit long database deletes. | `string` | `"15m"` | no | | deletion\_protection | Used to block Terraform from deleting a SQL Instance. | `bool` | `true` | no | +| deny\_maintenance\_period | The Deny Maintenance Period fields to prevent automatic maintenance from occurring during a 90-day time period. See [more details](https://cloud.google.com/sql/docs/mysql/maintenance) |
list(object({
end_date = string
start_date = string
time = string
}))
| `[]` | no | | disk\_autoresize | Configuration to increase storage size | `bool` | `true` | no | | disk\_autoresize\_limit | The maximum size to which storage can be auto increased. | `number` | `0` | no | | disk\_size | The disk size for the master instance | `number` | `10` | no | diff --git a/modules/safer_mysql/main.tf b/modules/safer_mysql/main.tf index b96104ed..3c6eccbc 100644 --- a/modules/safer_mysql/main.tf +++ b/modules/safer_mysql/main.tf @@ -36,6 +36,7 @@ module "safer_mysql" { maintenance_window_hour = var.maintenance_window_hour maintenance_window_update_track = var.maintenance_window_update_track database_flags = var.database_flags + deny_maintenance_period = var.deny_maintenance_period encryption_key_name = var.encryption_key_name deletion_protection = var.deletion_protection diff --git a/modules/safer_mysql/variables.tf b/modules/safer_mysql/variables.tf index 125677f6..5879bba4 100644 --- a/modules/safer_mysql/variables.tf +++ b/modules/safer_mysql/variables.tf @@ -138,6 +138,16 @@ variable "maintenance_window_update_track" { default = "stable" } +variable "deny_maintenance_period" { + description = "The Deny Maintenance Period fields to prevent automatic maintenance from occurring during a 90-day time period. See [more details](https://cloud.google.com/sql/docs/mysql/maintenance)" + type = list(object({ + end_date = string + start_date = string + time = string + })) + default = [] +} + variable "database_flags" { description = "The database flags for the master instance. See [more details](https://cloud.google.com/sql/docs/mysql/flags)" type = list(object({ diff --git a/modules/safer_mysql/versions.tf b/modules/safer_mysql/versions.tf index 5c392e47..667f7535 100644 --- a/modules/safer_mysql/versions.tf +++ b/modules/safer_mysql/versions.tf @@ -20,7 +20,7 @@ terraform { google = { source = "hashicorp/google" - version = ">= 4.28.0, < 5.0" + version = ">= 4.45.0, < 5.0" } }