microsoft / microsoft/AzureTRE

Custom workspace backup policies

Open
#5,016 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
235
Forks
192
Avg merge
1d 23h
Merged PRs (30d)
13

Description

Is your feature request related to a problem? Please describe.
Backup policies in the base workspace are currently hard coded and non-configurable.

Describe the solution you'd like
I'd like to have the option to define custom backup policies when deploying a workspace.

Describe alternatives you've considered
Modifying the template to add more backup policies and a drop down to select them.
A separate file defining custom backup policies that could be read by the terraform

Additional context
templates/workspaces/base/terraform/backup/backup.tf

resource "azurerm_backup_policy_vm" "vm_policy" {
  name                = local.vm_backup_policy_name
  resource_group_name = var.resource_group_name
  recovery_vault_name = azurerm_recovery_services_vault.vault.name


  timezone = "UTC"

  backup {
    frequency = "Daily"
    time      = "22:00"
  }

  retention_daily {
    count = 14
  }

  retention_weekly {
    count    = 4
    weekdays = ["Sunday"]
  }

  retention_monthly {
    count    = 12
    weekdays = ["Monday"]
    weeks    = ["First"]
  }

  retention_yearly {
    count    = 2
    months   = ["December"]
    weekdays = ["Sunday"]
    weeks    = ["Last"]
  }

  depends_on = [
    azurerm_recovery_services_vault.vault
  ]


}

resource "azurerm_backup_policy_file_share" "file_share_policy" {
  name                = local.fs_backup_policy_name
  resource_group_name = var.resource_group_name
  recovery_vault_name = azurerm_recovery_services_vault.vault.name

  timezone = "UTC"

  backup {
    frequency = "Daily"
    time      = "23:00"
  }

  retention_daily {
    count = 14
  }

  retention_weekly {
    count    = 4
    weekdays = ["Sunday"]
  }

  retention_monthly {
    count    = 12
    weekdays = ["Monday"]
    weeks    = ["First"]
  }

  retention_yearly {
    count    = 2
    months   = ["December"]
    weekdays = ["Sunday"]
    weeks    = ["Last"]
  }

  depends_on = [
    azurerm_recovery_services_vault.vault
  ]

}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with templates/workspaces/base/terraform/backup/backup.tf and review how the VM and file-share policies are currently hard coded. Trace how workspace deployment inputs reach these Terraform resources, then determine how custom policy definitions should be supplied and selected. Done means deployments can define and use custom backup policies without editing the base template.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, terraform
Domain
cloud, infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.