Skip to content

Commit

Permalink
Add point in time recovery variable
Browse files Browse the repository at this point in the history
  • Loading branch information
dspeck1 committed Sep 12, 2024
1 parent 257b5a8 commit bfa1ed5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
4 changes: 3 additions & 1 deletion environment/deployments/science-platform/cloudsql/main.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Butler Registry DP02
module "db_butler_registry_dp02" {
source = "../../../../modules/cloudsql/postgres-private"
authorized_networks = [
Expand Down Expand Up @@ -26,7 +27,7 @@ module "db_butler_registry_dp02" {
enabled = var.butler_registry_dp02_backups_enabled
start_time = var.butler_registry_dp02_backups_start_time
location = "us-central1"
point_in_time_recovery_enabled = true
point_in_time_recovery_enabled = var.butler_registry_dp02_backups_point_in_time_recovery_enabled
}
}

Expand Down Expand Up @@ -77,6 +78,7 @@ data "google_compute_network" "network" {
project = var.project_id
}

# Science Platform Database
module "db_science_platform" {
source = "../../../../modules/cloudsql/postgres-sql"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ variable "butler_registry_dp02_backups_start_time" {
default = "09:00"
}

variable "butler_registry_dp02_backups_point_in_time_recovery_enabled" {
type = bool
description = "Enable Point in Time Recovery for backups"
default = true
}

// Science Platform Database variables

Expand Down
13 changes: 7 additions & 6 deletions environment/deployments/science-platform/env/dev-cloudsql.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@ butler_registry_dp02_database_flags = [
{ name = "max_connections", value = "400" },
{ name = "password_encryption", value = "scram-sha-256" }
]
butler_registry_dp02_ipv4_enabled = true
butler_registry_dp02_db_maintenance_window_day = 1
butler_registry_dp02_db_maintenance_window_hour = 23
butler_registry_dp02_db_maintenance_window_update_track = "stable"
butler_registry_dp02_backups_enabled = false
butler_registry_dp02_ipv4_enabled = true
butler_registry_dp02_db_maintenance_window_day = 1
butler_registry_dp02_db_maintenance_window_hour = 23
butler_registry_dp02_db_maintenance_window_update_track = "stable"
butler_registry_dp02_backups_enabled = false
butler_registry_dp02_backups_point_in_time_recovery_enabled = false

# Science Platform Database

science_platform_maintenance_window_day = 1
science_platform_db_maintenance_window_hour = 22
science_platform_db_maintenance_window_hour = 22
science_platform_db_maintenance_window_update_track = "canary"
science_platform_backups_enabled = true

Expand Down

0 comments on commit bfa1ed5

Please sign in to comment.