Skip to content

Commit

Permalink
fix: Postgresql availability type shouldn't prevent backup configurat…
Browse files Browse the repository at this point in the history
…ion (#352)

fixes #351

Co-authored-by: Andrew Peabody <andrewpeabody@google.com>
Co-authored-by: Bharath KKB <bharathkrishnakb@gmail.com>
  • Loading branch information
3 people committed Nov 1, 2022
1 parent b51427e commit e796b3c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/postgresql/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ locals {
}]

// HA method using REGIONAL availability_type requires point in time recovery to be enabled
point_in_time_recovery_enabled = var.availability_type == "REGIONAL" ? true : lookup(var.backup_configuration, "point_in_time_recovery_enabled", false)
backups_enabled = var.availability_type == "REGIONAL" ? true : lookup(var.backup_configuration, "enabled", false)
point_in_time_recovery_enabled = var.availability_type == "REGIONAL" ? lookup(var.backup_configuration, "point_in_time_recovery_enabled", true) : lookup(var.backup_configuration, "point_in_time_recovery_enabled", false)
backups_enabled = var.availability_type == "REGIONAL" ? lookup(var.backup_configuration, "enabled", true) : lookup(var.backup_configuration, "enabled", false)

retained_backups = lookup(var.backup_configuration, "retained_backups", null)
retention_unit = lookup(var.backup_configuration, "retention_unit", null)
Expand Down

0 comments on commit e796b3c

Please sign in to comment.