Manages a Backup Vault.
resource "azurerm_resource_group" "example" {
name = "example-resources"
location = "West Europe"
}
resource "azurerm_data_protection_backup_vault" "example" {
name = "example-backup-vault"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
datastore_type = "VaultStore"
redundancy = "LocallyRedundant"
}
The following arguments are supported:
name
- (Required) Specifies the name of the Backup Vault. Changing this forces a new Backup Vault to be created.
resource_group_name
- (Required) The name of the Resource Group where the Backup Vault should exist. Changing this forces a new Backup Vault to be created.
location
- (Required) The Azure Region where the Backup Vault should exist. Changing this forces a new Backup Vault to be created.
datastore_type
- (Required) Specifies the type of the data store. Possible values are ArchiveStore
, OperationalStore
, SnapshotStore
and VaultStore
. Changing this forces a new resource to be created.
redundancy
- (Required) Specifies the backup storage redundancy. Possible values are GeoRedundant
, LocallyRedundant
and ZoneRedundant
. Changing this forces a new Backup Vault to be created.identity
- (Optional) An identity
block as defined below.
retention_duration_in_days
- (Optional) The soft delete retention duration for this Backup Vault. Possible values are between 14
and 180
. Defaults to 14
.
soft_delete
- (Optional) The state of soft delete for this Backup Vault. Possible values are AlwaysOn
, Off
and On
. Defaults to On
.tags
- (Optional) A mapping of tags which should be assigned to the Backup Vault.An identity
block supports the following:
type
- (Required) Specifies the type of Managed Service Identity that should be configured on this Backup Vault. The only possible value is SystemAssigned
.In addition to the Arguments listed above - the following Attributes are exported:
id
- The ID of the Backup Vault.
identity
- An identity
block as defined below, which contains the Identity information for this Backup Vault.
An identity
block exports the following:
principal_id
- The Principal ID for the Service Principal associated with the Identity of this Backup Vault.
tenant_id
- The Tenant ID for the Service Principal associated with the Identity of this Backup Vault.
The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 30 minutes) Used when creating the Backup Vault.read
- (Defaults to 5 minutes) Used when retrieving the Backup Vault.update
- (Defaults to 30 minutes) Used when updating the Backup Vault.delete
- (Defaults to 30 minutes) Used when deleting the Backup Vault.Backup Vaults can be imported using the resource id
, e.g.
terraform import azurerm_data_protection_backup_vault.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DataProtection/backupVaults/vault1