Skip to content

Commit

Permalink
fix: Relax assignment of backup_configuration when operating as a rep…
Browse files Browse the repository at this point in the history
…lica (#589)
  • Loading branch information
OscarVanL authored Apr 11, 2024
1 parent fa4fb92 commit 19daff8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/mysql/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ resource "google_sql_database_instance" "default" {
connector_enforcement = local.connector_enforcement

dynamic "backup_configuration" {
for_each = var.master_instance_name != null ? [] : [var.backup_configuration]
for_each = [var.backup_configuration]
content {
binary_log_enabled = local.binary_log_enabled
enabled = local.backups_enabled
enabled = local.backups_enabled && var.master_instance_name == null ? true : false
start_time = lookup(backup_configuration.value, "start_time", null)
location = lookup(backup_configuration.value, "location", null)
transaction_log_retention_days = lookup(backup_configuration.value, "transaction_log_retention_days", null)
Expand Down

0 comments on commit 19daff8

Please sign in to comment.