azurermBackupPolicyVmWorkload
Manages an Azure VM Workload Backup Policy within a Recovery Services vault.
Example Usage
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
this,
"example",
{
location: "West Europe",
name: "example-bpvmw",
}
);
const azurermRecoveryServicesVaultExample =
new azurerm.recoveryServicesVault.RecoveryServicesVault(this, "example_1", {
location: azurermResourceGroupExample.location,
name: "example-rsv",
resource_group_name: azurermResourceGroupExample.name,
sku: "Standard",
soft_delete_enabled: false,
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermRecoveryServicesVaultExample.overrideLogicalId("example");
const azurermBackupPolicyVmWorkloadExample =
new azurerm.backupPolicyVmWorkload.BackupPolicyVmWorkload(this, "example_2", {
name: "example-bpvmw",
protection_policy: [
{
backup: [
{
frequency: "Daily",
time: "15:00",
},
],
policy_type: "Full",
retention_daily: [
{
count: 8,
},
],
},
{
backup: [
{
frequency_in_minutes: 15,
},
],
policy_type: "Log",
simple_retention: [
{
count: 8,
},
],
},
],
recovery_vault_name: azurermRecoveryServicesVaultExample.name,
resource_group_name: azurermResourceGroupExample.name,
settings: [
{
compression_enabled: false,
time_zone: "UTC",
},
],
workload_type: "SQLDataBase",
});
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermBackupPolicyVmWorkloadExample.overrideLogicalId("example");
Argument Reference
The following arguments are supported:
-
name
- (Required) The name of the VM Workload Backup Policy. Changing this forces a new resource to be created. -
resourceGroupName
- (Required) The name of the resource group in which to create the VM Workload Backup Policy. Changing this forces a new resource to be created. -
recoveryVaultName
- (Required) The name of the Recovery Services Vault to use. Changing this forces a new resource to be created. -
protectionPolicy
- (Required) One or moreprotectionPolicy
blocks as defined below. -
settings
- (Required) Asettings
block as defined below. -
workloadType
- (Required) The VM Workload type for the Backup Policy. Possible values aresqlDataBase
andsapHanaDatabase
. Changing this forces a new resource to be created.
The protectionPolicy
block supports the following:
-
policyType
- (Required) The type of the VM Workload Backup Policy. Possible values aredifferential
,full
,incremental
andlog
. -
backup
- (Required) Abackup
block as defined below. -
retentionDaily
- (Optional) AretentionDaily
block as defined below. -
retentionWeekly
- (Optional) AretentionWeekly
block as defined below. -
retentionMonthly
- (Optional) AretentionMonthly
block as defined below. -
retentionYearly
- (Optional) AretentionYearly
block as defined below. -
simpleRetention
- (Optional) AsimpleRetention
block as defined below.
The simpleRetention
block supports the following:
count
- (Required) The count that is used to count retention duration with duration typedays
. Possible values are between7
and35
.
The settings
block supports the following:
-
timeZone
- (Required) The timezone for the VM Workload Backup Policy. The possible values are defined here. -
compressionEnabled
- (Optional) The compression setting for the VM Workload Backup Policy. Defaults tofalse
.
The backup
block supports the following:
-
frequency
- (Optional) The backup frequency for the VM Workload Backup Policy. Possible values aredaily
andweekly
. -
frequencyInMinutes
- (Optional) The backup frequency in minutes for the VM Workload Backup Policy. Possible values are15
,30
,60
,120
,240
,480
,720
and1440
. -
time
- (Optional) The time of day to perform the backup in 24hour format. -
weekdays
- (Optional) The days of the week to perform backups on. Possible values aresunday
,monday
,tuesday
,wednesday
,thursday
,friday
orsaturday
. This is used whenfrequency
isweekly
.
The retentionDaily
block supports the following:
count
- (Required) The number of daily backups to keep. Possible values are between7
and9999
.
The retentionWeekly
block supports the following:
-
count
- (Required) The number of weekly backups to keep. Possible values are between1
and5163
. -
weekdays
- (Required) The weekday backups to retain. Possible values aresunday
,monday
,tuesday
,wednesday
,thursday
,friday
orsaturday
.
The retentionMonthly
block supports the following:
-
count
- (Required) The number of monthly backups to keep. Must be between1
and1188
. -
formatType
- (Required) The retention schedule format type for monthly retention policy. Possible values aredaily
andweekly
. -
monthdays
- (Optional) The monthday backups to retain. Possible values are between0
and28
. -
weekdays
- (Optional) The weekday backups to retain. Possible values aresunday
,monday
,tuesday
,wednesday
,thursday
,friday
orsaturday
. -
weeks
- (Optional) The weeks of the month to retain backups of. Possible values arefirst
,second
,third
,fourth
andlast
.
The retentionYearly
block supports the following:
-
count
- (Required) The number of yearly backups to keep. Possible values are between1
and99
-
formatType
- (Required) The retention schedule format type for yearly retention policy. Possible values aredaily
andweekly
. -
months
- (Required) The months of the year to retain backups of. Possible values arejanuary
,february
,march
,april
,may
,june
,july
,august
,september
,october
,november
anddecember
. -
monthdays
- (Optional) The monthday backups to retain. Possible values are between0
and28
. -
weekdays
- (Optional) The weekday backups to retain. Possible values aresunday
,monday
,tuesday
,wednesday
,thursday
,friday
orsaturday
. -
weeks
- (Optional) The weeks of the month to retain backups of. Possible values arefirst
,second
,third
,fourth
,last
.
Attributes Reference
The following attributes are exported:
id
- The ID of the Azure VM Workload Backup Policy.
Timeouts
The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 30 minutes) Used when creating the VM Workload Backup Policy.update
- (Defaults to 30 minutes) Used when updating the VM Workload Backup Policy.read
- (Defaults to 5 minutes) Used when retrieving the VM Workload Backup Policy.delete
- (Defaults to 30 minutes) Used when deleting the VM Workload Backup Policy.
Import
Azure VM Workload Backup Policies can be imported using the resourceId
, e.g.