» azurerm_backup_policy_file_share

Manages an Azure File Share Backup Policy within a Recovery Services vault.

» Example Usage

resource "azurerm_resource_group" "rg" {
  name     = "tfex-recovery_vault"
  location = "West US"
}

resource "azurerm_recovery_services_vault" "vault" {
  name                = "tfex-recovery-vault"
  location            = azurerm_resource_group.rg.location
  resource_group_name = azurerm_resource_group.rg.name
  sku                 = "Standard"
}

resource "azurerm_backup_policy_file_share" "policy" {
  name                = "tfex-recovery-vault-policy"
  resource_group_name = azurerm_resource_group.rg.name
  recovery_vault_name = azurerm_recovery_services_vault.vault.name

  timezone = "UTC"

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

  retention_daily {
    count = 10
  }
}

» Argument Reference

The following arguments are supported:

  • name - (Required) Specifies the name of the policy. Changing this forces a new resource to be created.

  • resource_group_name - (Required) The name of the resource group in which to create the policy. Changing this forces a new resource to be created.

  • recovery_vault_name - (Required) Specifies the name of the Recovery Services Vault to use. Changing this forces a new resource to be created.

  • backup - (Required) Configures the Policy backup frequency and times as documented in the backup block below.

  • timezone - (Optional) Specifies the timezone. Defaults to UTC

  • retention_daily - (Required) Configures the policy daily retention as documented in the retention_daily block below.


The backup block supports:

  • frequency - (Required) Sets the backup frequency. Currently, only Daily is supported
  • times - (Required) The time of day to perform the backup in 24-hour format. Times must be either on the hour or half hour (e.g. 12:00, 12:30, 13:00, etc.)

The retention_daily block supports:

  • count - (Required) The number of daily backups to keep. Must be between 1 and 180 (inclusive)

» Attributes Reference

The following attributes are exported:

  • id - The ID of the Azure File Share Backup Policy.

» Timeouts

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

  • create - (Defaults to 30 minutes) Used when creating the File Share Backup Policy.
  • update - (Defaults to 30 minutes) Used when updating the File Share Backup Policy.
  • read - (Defaults to 5 minutes) Used when retrieving the File Share Backup Policy.
  • delete - (Defaults to 30 minutes) Used when deleting the File Share Backup Policy.

» Import

Azure File Share Backup Policies can be imported using the resource id, e.g.

terraform import azurerm_backup_policy_file_share.policy1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.RecoveryServices/vaults/example-recovery-vault/backupPolicies/policy1