Skip to content

Commit 659ad2e

Browse files
fix(mysql): error 'backup retention should be > transaction log retention' on mysql replica
1 parent 3d30555 commit 659ad2e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

modules/mysql/read_replica.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ resource "google_sql_database_instance" "replicas" {
5555
content {
5656
binary_log_enabled = lookup(backup_configuration.value, "binary_log_enabled", null)
5757
transaction_log_retention_days = lookup(backup_configuration.value, "transaction_log_retention_days", null)
58+
backup_retention_settings {
59+
retained_backups = lookup(backup_configuration.value, "transaction_log_retention_days", 0) > 7 ? lookup(backup_configuration.value, "transaction_log_retention_days") + 1 : null
60+
retention_unit = "COUNT"
61+
}
5862
}
5963
}
6064

0 commit comments

Comments
 (0)