Skip to content

Commit 1fcae8a

Browse files
authored
feat(postgres): Added point_in_time_recovery_enabled backup option for Postgres (#142)
1 parent 69e1911 commit 1fcae8a

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

examples/postgresql-ha/main.tf

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,10 @@ module "pg" {
7575
}
7676

7777
backup_configuration = {
78-
enabled = true
79-
start_time = "20:55"
80-
location = null
78+
enabled = true
79+
start_time = "20:55"
80+
location = null
81+
point_in_time_recovery_enabled = false
8182
}
8283

8384
// Read replica configurations

modules/postgresql/main.tf

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,11 @@ resource "google_sql_database_instance" "default" {
5151
dynamic "backup_configuration" {
5252
for_each = [var.backup_configuration]
5353
content {
54-
binary_log_enabled = false
55-
enabled = lookup(backup_configuration.value, "enabled", null)
56-
start_time = lookup(backup_configuration.value, "start_time", null)
57-
location = lookup(backup_configuration.value, "location", null)
54+
binary_log_enabled = false
55+
enabled = lookup(backup_configuration.value, "enabled", null)
56+
start_time = lookup(backup_configuration.value, "start_time", null)
57+
location = lookup(backup_configuration.value, "location", null)
58+
point_in_time_recovery_enabled = lookup(backup_configuration.value, "point_in_time_recovery_enabled", false)
5859
}
5960
}
6061
dynamic "ip_configuration" {

modules/postgresql/variables.tf

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,16 @@ variable "user_labels" {
125125
variable "backup_configuration" {
126126
description = "The backup_configuration settings subblock for the database setings"
127127
type = object({
128-
enabled = bool
129-
start_time = string
130-
location = string
128+
enabled = bool
129+
start_time = string
130+
location = string
131+
point_in_time_recovery_enabled = bool
131132
})
132133
default = {
133-
enabled = false
134-
start_time = null
135-
location = null
134+
enabled = false
135+
start_time = null
136+
location = null
137+
point_in_time_recovery_enabled = false
136138
}
137139
}
138140

0 commit comments

Comments
 (0)