Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added tiering policy for backup vm policy #2089

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add tiering policy for recovery vault backup
kevindelmont committed Dec 16, 2024
commit dd11e6327eef6bd3cc9f8e5c16c5bb44ec9acdf0
5 changes: 5 additions & 0 deletions examples/recovery_vault/101-simple-asrv/configuration.tfvars
Original file line number Diff line number Diff line change
@@ -60,6 +60,11 @@ recovery_vaults = {
weeks = ["Last"]
months = ["January"]
}
tiering_policy = {
mode = "TierAfter"
duration = 3
duration_type = "Weeks"
}
}
}

11 changes: 11 additions & 0 deletions modules/recovery_vault/backup_policies_vm.tf
Original file line number Diff line number Diff line change
@@ -60,4 +60,15 @@ resource "azurerm_backup_policy_vm" "vm" {
months = each.value.retention_yearly.months
}
}

dynamic "tiering_policy" {
for_each = lookup(each.value, "tiering_policy", null) == null ? [] : [1]
content {
archived_restore_point {
mode = lookup(each.value.tiering_policy, "mode", null)
duration = try(each.value.tiering_policy.duration, null)
duration_type = try(each.value.tiering_policy.type, null)
}
}
}
}