Skip to content

Commit 19daff8

Browse files
authored
fix: Relax assignment of backup_configuration when operating as a replica (#589)
1 parent fa4fb92 commit 19daff8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/mysql/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ resource "google_sql_database_instance" "default" {
7070
connector_enforcement = local.connector_enforcement
7171

7272
dynamic "backup_configuration" {
73-
for_each = var.master_instance_name != null ? [] : [var.backup_configuration]
73+
for_each = [var.backup_configuration]
7474
content {
7575
binary_log_enabled = local.binary_log_enabled
76-
enabled = local.backups_enabled
76+
enabled = local.backups_enabled && var.master_instance_name == null ? true : false
7777
start_time = lookup(backup_configuration.value, "start_time", null)
7878
location = lookup(backup_configuration.value, "location", null)
7979
transaction_log_retention_days = lookup(backup_configuration.value, "transaction_log_retention_days", null)

0 commit comments

Comments
 (0)