I'd like to create a backup from an Azure managed disk, as this article says, but with terraform.
I can create the managed disk as:
resource "azurerm_managed_disk" "mongodb_disk" {
name = "${var.env_name}-mongodb-disk"
location = var.resource_group.location
resource_group_name = var.resource_group.name
create_option = "Empty"
storage_account_type = "Premium_LRS"
disk_size_gb = var.mongo_db_disk_size_in_gb
}
But I'm unable to find the following resources:
Could you help me with the correct terraform resources, to create the backup? Or is there an example anywhere, how to create a scheduled backup of an Azure Managed Disk?
Thanks,
EDIT: Just realised that Azure Backup Vault is not yet supported in Terraform, you can upvote the issue.
For VMs backups it's just Azure Recovery Services Vault. A workaround could be for you to use an external
terraform object that will run
either a PowerShell or Bash script (using Az Cli), to create the backup. It's not 100% IaC but better than nothing.