azurerm_backup_policy_vm_workload

Manages an Azure VM Workload Backup Policy within a Recovery Services vault.

Example Usage

resource "azurerm_resource_group" "example" {
  name     = "example-bpvmw"
  location = "West Europe"
}

resource "azurerm_recovery_services_vault" "example" {
  name                = "example-rsv"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  sku                 = "Standard"
  soft_delete_enabled = false
}

resource "azurerm_backup_policy_vm_workload" "example" {
  name                = "example-bpvmw"
  resource_group_name = azurerm_resource_group.example.name
  recovery_vault_name = azurerm_recovery_services_vault.example.name

  workload_type = "SQLDataBase"

  settings {
    time_zone           = "UTC"
    compression_enabled = false
  }

  protection_policy {
    policy_type = "Full"

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

    retention_daily {
      count = 8
    }
  }

  protection_policy {
    policy_type = "Log"

    backup {
      frequency_in_minutes = 15
    }

    simple_retention {
      count = 8
    }
  }
}

Argument Reference

The following arguments are supported:


The protection_policy block supports the following:


The simple_retention block supports the following:


The settings block supports the following:


The backup block supports the following:


The retention_daily block supports the following:


The retention_weekly block supports the following:


The retention_monthly block supports the following:


The retention_yearly block supports the following:

Attributes Reference

In addition to the Arguments listed above - the following Attributes are exported:

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

Import

Azure VM Workload Backup Policies can be imported using the resource id, e.g.

terraform import azurerm_backup_policy_vm_workload.policy1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.RecoveryServices/vaults/vault1/backupPolicies/policy1