PolicyVM

class PolicyVM : KotlinCustomResource

Manages an Azure Backup VM Backup Policy.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.recoveryservices.Vault;
import com.pulumi.azure.recoveryservices.VaultArgs;
import com.pulumi.azure.backup.PolicyVM;
import com.pulumi.azure.backup.PolicyVMArgs;
import com.pulumi.azure.backup.inputs.PolicyVMBackupArgs;
import com.pulumi.azure.backup.inputs.PolicyVMRetentionDailyArgs;
import com.pulumi.azure.backup.inputs.PolicyVMRetentionWeeklyArgs;
import com.pulumi.azure.backup.inputs.PolicyVMRetentionMonthlyArgs;
import com.pulumi.azure.backup.inputs.PolicyVMRetentionYearlyArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()
.location("West Europe")
.build());
var exampleVault = new Vault("exampleVault", VaultArgs.builder()
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.sku("Standard")
.build());
var examplePolicyVM = new PolicyVM("examplePolicyVM", PolicyVMArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.recoveryVaultName(exampleVault.name())
.timezone("UTC")
.backup(PolicyVMBackupArgs.builder()
.frequency("Daily")
.time("23:00")
.build())
.retentionDaily(PolicyVMRetentionDailyArgs.builder()
.count(10)
.build())
.retentionWeekly(PolicyVMRetentionWeeklyArgs.builder()
.count(42)
.weekdays(
"Sunday",
"Wednesday",
"Friday",
"Saturday")
.build())
.retentionMonthly(PolicyVMRetentionMonthlyArgs.builder()
.count(7)
.weekdays(
"Sunday",
"Wednesday")
.weeks(
"First",
"Last")
.build())
.retentionYearly(PolicyVMRetentionYearlyArgs.builder()
.count(77)
.weekdays("Sunday")
.weeks("Last")
.months("January")
.build())
.build());
}
}

Import

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

$ pulumi import azure:backup/policyVM:PolicyVM policy1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.RecoveryServices/vaults/example-recovery-vault/backupPolicies/policy1

Properties

Link copied to clipboard
val backup: Output<PolicyVMBackup>

Configures the Policy backup frequency, times & days as documented in the backup block below.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

Specifies the instant restore resource group name as documented in the instant_restore_resource_group block below.

Link copied to clipboard

Specifies the instant restore retention range in days. Possible values are between 1 and 5 when policy_type is V1, and 1 to 30 when policy_type is V2.

Link copied to clipboard
val name: Output<String>

Specifies the name of the Backup Policy. Changing this forces a new resource to be created.

Link copied to clipboard
val policyType: Output<String>?

Type of the Backup Policy. Possible values are V1 and V2 where V2 stands for the Enhanced Policy. Defaults to V1. Changing this forces a new resource to be created.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Specifies the name of the Recovery Services Vault to use. Changing this forces a new resource to be created.

Link copied to clipboard

The name of the resource group in which to create the policy. Changing this forces a new resource to be created.

Link copied to clipboard

Configures the policy daily retention as documented in the retention_daily block below. Required when backup frequency is Daily.

Link copied to clipboard

Configures the policy monthly retention as documented in the retention_monthly block below.

Link copied to clipboard

Configures the policy weekly retention as documented in the retention_weekly block below. Required when backup frequency is Weekly.

Link copied to clipboard

Configures the policy yearly retention as documented in the retention_yearly block below.

Link copied to clipboard
val timezone: Output<String>?

Specifies the timezone. the possible values are defined here. Defaults to UTC

Link copied to clipboard
val urn: Output<String>