ProtectedVM

class ProtectedVM : KotlinCustomResource

Manages Azure Backup for an Azure VM

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.compute.ComputeFunctions;
import com.pulumi.azure.compute.inputs.GetVirtualMachineArgs;
import com.pulumi.azure.backup.ProtectedVM;
import com.pulumi.azure.backup.ProtectedVMArgs;
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())
.backup(PolicyVMBackupArgs.builder()
.frequency("Daily")
.time("23:00")
.build())
.retentionDaily(PolicyVMRetentionDailyArgs.builder()
.count(10)
.build())
.build());
final var exampleVirtualMachine = ComputeFunctions.getVirtualMachine(GetVirtualMachineArgs.builder()
.name("example-vm")
.resourceGroupName(exampleResourceGroup.name())
.build());
var vm1 = new ProtectedVM("vm1", ProtectedVMArgs.builder()
.resourceGroupName(exampleResourceGroup.name())
.recoveryVaultName(exampleVault.name())
.sourceVmId(exampleVirtualMachine.applyValue(getVirtualMachineResult -> getVirtualMachineResult).applyValue(exampleVirtualMachine -> exampleVirtualMachine.applyValue(getVirtualMachineResult -> getVirtualMachineResult.id())))
.backupPolicyId(examplePolicyVM.id())
.build());
}
}

Import

Recovery Services Protected VMs can be imported using the resource id, e.g.

$ pulumi import azure:backup/protectedVM:ProtectedVM item1 "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.RecoveryServices/vaults/example-recovery-vault/backupFabrics/Azure/protectionContainers/iaasvmcontainer;iaasvmcontainerv2;group1;vm1/protectedItems/vm;iaasvmcontainerv2;group1;vm1"

Note the ID requires quoting as there are semicolons

Properties

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

Specifies the id of the backup policy to use. Required in creation or when protection_stopped is not specified.

Link copied to clipboard
val excludeDiskLuns: Output<List<Int>>?

A list of Disks' Logical Unit Numbers(LUN) to be excluded for VM Protection.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val includeDiskLuns: Output<List<Int>>?

A list of Disks' Logical Unit Numbers(LUN) to be included for VM Protection.

Link copied to clipboard
val protectionState: Output<String>

Specifies Protection state of the backup. Possible values are Invalid, IRPending, Protected, ProtectionStopped, ProtectionError and ProtectionPaused.

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 Recovery Services Vault. Changing this forces a new resource to be created.

Link copied to clipboard
val sourceVmId: Output<String>

Specifies the ID of the VM to backup. Changing this forces a new resource to be created.

Link copied to clipboard
val urn: Output<String>