Add backup policy to be set as daily or weekly

Signed-off-by: Jason Rothstein <fdragon@fdragon.org>
This commit is contained in:
Jason Rothstein 2025-04-27 20:05:53 -05:00
parent 2c061156e7
commit 1df1f4595a
Signed by: jmrothst
GPG Key ID: 741BF3C536829D46
4 changed files with 20 additions and 0 deletions

View File

@ -1,5 +1,10 @@
resource "digitalocean_droplet" "this" {
backups = "true"
backup_policy {
plan = var.backup_policy_plan
weekday = var.backup_policy_weekday
hour = var.backup_policy_hour
}
image = var.image_name
ipv6 = "true"
lifecycle {

View File

@ -0,0 +1,5 @@
variable "backup_policy_hour" {
# UTC Hour : 0, 4, 8, 12, 16, 20
default = "0"
type = string
}

View File

@ -0,0 +1,5 @@
variable "backup_policy_plan" {
# daily or weekly
default = "weekly"
type = string
}

View File

@ -0,0 +1,5 @@
variable "backup_policy_weekday" {
# SUN, MON, TUE, WED, THU, FRI, SAT
default = "SUN"
type = string
}