Skip to content

Commit

Permalink
Merge pull request #22 from Equal-Vote/21-backup
Browse files Browse the repository at this point in the history
added backup policy
  • Loading branch information
evanstucker-hates-2fa authored Sep 1, 2024
2 parents f8ebcef + eceee66 commit ef2bd8d
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions backups.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# resource "azurerm_resource_group" "equalvote" {
# name = "equalvote-resources"
# location = "West Europe"
# }

resource "azurerm_data_protection_backup_vault" "equalvote" {
name = "equalvote-backup-vault"
resource_group_name = azurerm_resource_group.equalvote.name
location = azurerm_resource_group.equalvote.location
datastore_type = "VaultStore"
redundancy = "LocallyRedundant"
}

resource "azurerm_data_protection_backup_policy_disk" "equalvote" {
name = "equalvote-backup-policy"
vault_id = azurerm_data_protection_backup_vault.equalvote.id

backup_repeating_time_intervals = ["R/2021-05-19T06:33:16+00:00/PT4H"]
default_retention_duration = "P7D"
# time_zone = "W. Europe Standard Time"

retention_rule {
name = "Daily"
duration = "P7D"
priority = 25
criteria {
absolute_criteria = "FirstOfDay"
}
}

retention_rule {
name = "Weekly"
duration = "P7D"
priority = 20
criteria {
absolute_criteria = "FirstOfWeek"
}
}
}

0 comments on commit ef2bd8d

Please sign in to comment.