Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/mysql/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ resource "google_sql_database_instance" "default" {

// Maintenance windows cannot be set for read replicas: https://cloud.google.com/sql/docs/mysql/instance-settings#maintenance-window-2ndgen
dynamic "maintenance_window" {
for_each = var.master_instance_name != null ? [] : ["true"]
for_each = var.master_instance_name != null && var.maintenance_window_day != 0 ? [] : ["true"]

content {
day = var.maintenance_window_day
Expand Down
4 changes: 2 additions & 2 deletions modules/mysql/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,9 @@ variable "pricing_plan" {
}

variable "maintenance_window_day" {
description = "The day of week (1-7) for the master instance maintenance."
description = "The day of week (1-7) for the master instance maintenance. 0 means 'Any' (default)"
type = number
default = 1
default = 0
}

variable "maintenance_window_hour" {
Expand Down
2 changes: 1 addition & 1 deletion modules/postgresql/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ resource "google_sql_database_instance" "default" {
}

dynamic "maintenance_window" {
for_each = local.is_secondary_instance ? [] : ["maintenance_window"]
for_each = local.is_secondary_instance && var.maintenance_window_day != 0 ? [] : ["maintenance_window"]
content {
day = var.maintenance_window_day
hour = var.maintenance_window_hour
Expand Down
4 changes: 2 additions & 2 deletions modules/postgresql/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -249,9 +249,9 @@ variable "pricing_plan" {
}

variable "maintenance_window_day" {
description = "The day of week (1-7) for the Cloud SQL instance maintenance."
description = "The day of week (1-7) for the Cloud SQL instance maintenance. 0 means 'Any' (default)"
type = number
default = 1
default = 0
}

variable "maintenance_window_hour" {
Expand Down
4 changes: 2 additions & 2 deletions modules/safer_mysql/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ variable "pricing_plan" {
}

variable "maintenance_window_day" {
description = "The day of week (1-7) for the master instance maintenance."
description = "The day of week (1-7) for the master instance maintenance. 0 means 'Any' (default)"
type = number
default = 1
default = 0
}

variable "maintenance_window_hour" {
Expand Down