From 0003a0b2511b26f93d7da905304d9cdc682c2edf Mon Sep 17 00:00:00 2001 From: Sarah Gibson Date: Thu, 11 Jul 2024 11:36:24 +0100 Subject: [PATCH 1/2] Enable storage backups for Azure clusters --- terraform/azure/storage.tf | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/terraform/azure/storage.tf b/terraform/azure/storage.tf index 2fc97b7ea9..c8e2e53685 100644 --- a/terraform/azure/storage.tf +++ b/terraform/azure/storage.tf @@ -40,3 +40,27 @@ resource "azurerm_storage_share" "homes" { output "azure_fileshare_url" { value = azurerm_storage_share.homes.url } + +resource "azurerm_recovery_services_vault" "homedir_recovery_vault" { + name = "homedir-recovery-vault" + location = azurerm_resource_group.jupyterhub.location + resource_group_name = azurerm_resource_group.jupyterhub.name + sku = "Standard" +} + +resource "azurerm_backup_policy_file_share" "backup_policy" { + name = "homedir-recovery-vault-policy" + resource_group_name = azurerm_resource_group.jupyterhub.name + recovery_vault_name = azurerm_recovery_services_vault.homedir_recovery_vault.name + + timezone = "UTC-07:00" + + backup { + frequency = "Daily" + time = "22:00" + } + + retention_daily { + count = 5 + } +} From 7d8d7df6d2b8259a9051c558b5998f756936b2b1 Mon Sep 17 00:00:00 2001 From: Sarah Gibson Date: Thu, 11 Jul 2024 11:43:06 +0100 Subject: [PATCH 2/2] Reference timezone by name --- terraform/azure/storage.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/azure/storage.tf b/terraform/azure/storage.tf index c8e2e53685..4bfe7f8e95 100644 --- a/terraform/azure/storage.tf +++ b/terraform/azure/storage.tf @@ -53,7 +53,7 @@ resource "azurerm_backup_policy_file_share" "backup_policy" { resource_group_name = azurerm_resource_group.jupyterhub.name recovery_vault_name = azurerm_recovery_services_vault.homedir_recovery_vault.name - timezone = "UTC-07:00" + timezone = "Mountain Standard Time" backup { frequency = "Daily"