We recommend using Azure Native.
azure.backup.ProtectedVM
Explore with Pulumi AI
Manages Azure Backup for an Azure VM
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const exampleResourceGroup = new azure.core.ResourceGroup("example", {
name: "tfex-recovery_vault",
location: "West Europe",
});
const exampleVault = new azure.recoveryservices.Vault("example", {
name: "tfex-recovery-vault",
location: exampleResourceGroup.location,
resourceGroupName: exampleResourceGroup.name,
sku: "Standard",
});
const examplePolicyVM = new azure.backup.PolicyVM("example", {
name: "tfex-recovery-vault-policy",
resourceGroupName: exampleResourceGroup.name,
recoveryVaultName: exampleVault.name,
backup: {
frequency: "Daily",
time: "23:00",
},
retentionDaily: {
count: 10,
},
});
const example = azure.compute.getVirtualMachineOutput({
name: "example-vm",
resourceGroupName: exampleResourceGroup.name,
});
const vm1 = new azure.backup.ProtectedVM("vm1", {
resourceGroupName: exampleResourceGroup.name,
recoveryVaultName: exampleVault.name,
sourceVmId: example.apply(example => example.id),
backupPolicyId: examplePolicyVM.id,
});
import pulumi
import pulumi_azure as azure
example_resource_group = azure.core.ResourceGroup("example",
name="tfex-recovery_vault",
location="West Europe")
example_vault = azure.recoveryservices.Vault("example",
name="tfex-recovery-vault",
location=example_resource_group.location,
resource_group_name=example_resource_group.name,
sku="Standard")
example_policy_vm = azure.backup.PolicyVM("example",
name="tfex-recovery-vault-policy",
resource_group_name=example_resource_group.name,
recovery_vault_name=example_vault.name,
backup={
"frequency": "Daily",
"time": "23:00",
},
retention_daily={
"count": 10,
})
example = azure.compute.get_virtual_machine_output(name="example-vm",
resource_group_name=example_resource_group.name)
vm1 = azure.backup.ProtectedVM("vm1",
resource_group_name=example_resource_group.name,
recovery_vault_name=example_vault.name,
source_vm_id=example.id,
backup_policy_id=example_policy_vm.id)
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/backup"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/compute"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/recoveryservices"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleResourceGroup, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
Name: pulumi.String("tfex-recovery_vault"),
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
exampleVault, err := recoveryservices.NewVault(ctx, "example", &recoveryservices.VaultArgs{
Name: pulumi.String("tfex-recovery-vault"),
Location: exampleResourceGroup.Location,
ResourceGroupName: exampleResourceGroup.Name,
Sku: pulumi.String("Standard"),
})
if err != nil {
return err
}
examplePolicyVM, err := backup.NewPolicyVM(ctx, "example", &backup.PolicyVMArgs{
Name: pulumi.String("tfex-recovery-vault-policy"),
ResourceGroupName: exampleResourceGroup.Name,
RecoveryVaultName: exampleVault.Name,
Backup: &backup.PolicyVMBackupArgs{
Frequency: pulumi.String("Daily"),
Time: pulumi.String("23:00"),
},
RetentionDaily: &backup.PolicyVMRetentionDailyArgs{
Count: pulumi.Int(10),
},
})
if err != nil {
return err
}
example := compute.LookupVirtualMachineOutput(ctx, compute.GetVirtualMachineOutputArgs{
Name: pulumi.String("example-vm"),
ResourceGroupName: exampleResourceGroup.Name,
}, nil)
_, err = backup.NewProtectedVM(ctx, "vm1", &backup.ProtectedVMArgs{
ResourceGroupName: exampleResourceGroup.Name,
RecoveryVaultName: exampleVault.Name,
SourceVmId: pulumi.String(example.ApplyT(func(example compute.GetVirtualMachineResult) (*string, error) {
return &example.Id, nil
}).(pulumi.StringPtrOutput)),
BackupPolicyId: examplePolicyVM.ID(),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var exampleResourceGroup = new Azure.Core.ResourceGroup("example", new()
{
Name = "tfex-recovery_vault",
Location = "West Europe",
});
var exampleVault = new Azure.RecoveryServices.Vault("example", new()
{
Name = "tfex-recovery-vault",
Location = exampleResourceGroup.Location,
ResourceGroupName = exampleResourceGroup.Name,
Sku = "Standard",
});
var examplePolicyVM = new Azure.Backup.PolicyVM("example", new()
{
Name = "tfex-recovery-vault-policy",
ResourceGroupName = exampleResourceGroup.Name,
RecoveryVaultName = exampleVault.Name,
Backup = new Azure.Backup.Inputs.PolicyVMBackupArgs
{
Frequency = "Daily",
Time = "23:00",
},
RetentionDaily = new Azure.Backup.Inputs.PolicyVMRetentionDailyArgs
{
Count = 10,
},
});
var example = Azure.Compute.GetVirtualMachine.Invoke(new()
{
Name = "example-vm",
ResourceGroupName = exampleResourceGroup.Name,
});
var vm1 = new Azure.Backup.ProtectedVM("vm1", new()
{
ResourceGroupName = exampleResourceGroup.Name,
RecoveryVaultName = exampleVault.Name,
SourceVmId = example.Apply(getVirtualMachineResult => getVirtualMachineResult.Id),
BackupPolicyId = examplePolicyVM.Id,
});
});
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()
.name("tfex-recovery_vault")
.location("West Europe")
.build());
var exampleVault = new Vault("exampleVault", VaultArgs.builder()
.name("tfex-recovery-vault")
.location(exampleResourceGroup.location())
.resourceGroupName(exampleResourceGroup.name())
.sku("Standard")
.build());
var examplePolicyVM = new PolicyVM("examplePolicyVM", PolicyVMArgs.builder()
.name("tfex-recovery-vault-policy")
.resourceGroupName(exampleResourceGroup.name())
.recoveryVaultName(exampleVault.name())
.backup(PolicyVMBackupArgs.builder()
.frequency("Daily")
.time("23:00")
.build())
.retentionDaily(PolicyVMRetentionDailyArgs.builder()
.count(10)
.build())
.build());
final var example = 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(example.applyValue(getVirtualMachineResult -> getVirtualMachineResult).applyValue(example -> example.applyValue(getVirtualMachineResult -> getVirtualMachineResult.id())))
.backupPolicyId(examplePolicyVM.id())
.build());
}
}
resources:
exampleResourceGroup:
type: azure:core:ResourceGroup
name: example
properties:
name: tfex-recovery_vault
location: West Europe
exampleVault:
type: azure:recoveryservices:Vault
name: example
properties:
name: tfex-recovery-vault
location: ${exampleResourceGroup.location}
resourceGroupName: ${exampleResourceGroup.name}
sku: Standard
examplePolicyVM:
type: azure:backup:PolicyVM
name: example
properties:
name: tfex-recovery-vault-policy
resourceGroupName: ${exampleResourceGroup.name}
recoveryVaultName: ${exampleVault.name}
backup:
frequency: Daily
time: 23:00
retentionDaily:
count: 10
vm1:
type: azure:backup:ProtectedVM
properties:
resourceGroupName: ${exampleResourceGroup.name}
recoveryVaultName: ${exampleVault.name}
sourceVmId: ${example.id}
backupPolicyId: ${examplePolicyVM.id}
variables:
example:
fn::invoke:
Function: azure:compute:getVirtualMachine
Arguments:
name: example-vm
resourceGroupName: ${exampleResourceGroup.name}
Create ProtectedVM Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ProtectedVM(name: string, args: ProtectedVMArgs, opts?: CustomResourceOptions);
@overload
def ProtectedVM(resource_name: str,
args: ProtectedVMArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ProtectedVM(resource_name: str,
opts: Optional[ResourceOptions] = None,
recovery_vault_name: Optional[str] = None,
resource_group_name: Optional[str] = None,
backup_policy_id: Optional[str] = None,
exclude_disk_luns: Optional[Sequence[int]] = None,
include_disk_luns: Optional[Sequence[int]] = None,
protection_state: Optional[str] = None,
source_vm_id: Optional[str] = None)
func NewProtectedVM(ctx *Context, name string, args ProtectedVMArgs, opts ...ResourceOption) (*ProtectedVM, error)
public ProtectedVM(string name, ProtectedVMArgs args, CustomResourceOptions? opts = null)
public ProtectedVM(String name, ProtectedVMArgs args)
public ProtectedVM(String name, ProtectedVMArgs args, CustomResourceOptions options)
type: azure:backup:ProtectedVM
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args ProtectedVMArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ProtectedVMArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ProtectedVMArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ProtectedVMArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ProtectedVMArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var protectedVMResource = new Azure.Backup.ProtectedVM("protectedVMResource", new()
{
RecoveryVaultName = "string",
ResourceGroupName = "string",
BackupPolicyId = "string",
ExcludeDiskLuns = new[]
{
0,
},
IncludeDiskLuns = new[]
{
0,
},
ProtectionState = "string",
SourceVmId = "string",
});
example, err := backup.NewProtectedVM(ctx, "protectedVMResource", &backup.ProtectedVMArgs{
RecoveryVaultName: pulumi.String("string"),
ResourceGroupName: pulumi.String("string"),
BackupPolicyId: pulumi.String("string"),
ExcludeDiskLuns: pulumi.IntArray{
pulumi.Int(0),
},
IncludeDiskLuns: pulumi.IntArray{
pulumi.Int(0),
},
ProtectionState: pulumi.String("string"),
SourceVmId: pulumi.String("string"),
})
var protectedVMResource = new ProtectedVM("protectedVMResource", ProtectedVMArgs.builder()
.recoveryVaultName("string")
.resourceGroupName("string")
.backupPolicyId("string")
.excludeDiskLuns(0)
.includeDiskLuns(0)
.protectionState("string")
.sourceVmId("string")
.build());
protected_vm_resource = azure.backup.ProtectedVM("protectedVMResource",
recovery_vault_name="string",
resource_group_name="string",
backup_policy_id="string",
exclude_disk_luns=[0],
include_disk_luns=[0],
protection_state="string",
source_vm_id="string")
const protectedVMResource = new azure.backup.ProtectedVM("protectedVMResource", {
recoveryVaultName: "string",
resourceGroupName: "string",
backupPolicyId: "string",
excludeDiskLuns: [0],
includeDiskLuns: [0],
protectionState: "string",
sourceVmId: "string",
});
type: azure:backup:ProtectedVM
properties:
backupPolicyId: string
excludeDiskLuns:
- 0
includeDiskLuns:
- 0
protectionState: string
recoveryVaultName: string
resourceGroupName: string
sourceVmId: string
ProtectedVM Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The ProtectedVM resource accepts the following input properties:
- Recovery
Vault stringName - Specifies the name of the Recovery Services Vault to use. Changing this forces a new resource to be created.
- Resource
Group stringName - Specifies the name of the Resource Group associated with the Recovery Services Vault to use. Changing this forces a new resource to be created.
- Backup
Policy stringId - Specifies the id of the backup policy to use. Required in creation or when
protection_stopped
is not specified. - Exclude
Disk List<int>Luns - A list of Disks' Logical Unit Numbers(LUN) to be excluded for VM Protection.
- Include
Disk List<int>Luns - A list of Disks' Logical Unit Numbers(LUN) to be included for VM Protection.
- Protection
State string - Specifies Protection state of the backup. Possible values are
Invalid
,IRPending
,Protected
,ProtectionStopped
,ProtectionError
andProtectionPaused
. - Source
Vm stringId Specifies the ID of the VM to backup. Changing this forces a new resource to be created.
NOTE: After creation, the
source_vm_id
property can be removed without forcing a new resource to be created; however, setting it to a different ID will create a new resource. This allows the source vm to be deleted without having to remove the backup.
- Recovery
Vault stringName - Specifies the name of the Recovery Services Vault to use. Changing this forces a new resource to be created.
- Resource
Group stringName - Specifies the name of the Resource Group associated with the Recovery Services Vault to use. Changing this forces a new resource to be created.
- Backup
Policy stringId - Specifies the id of the backup policy to use. Required in creation or when
protection_stopped
is not specified. - Exclude
Disk []intLuns - A list of Disks' Logical Unit Numbers(LUN) to be excluded for VM Protection.
- Include
Disk []intLuns - A list of Disks' Logical Unit Numbers(LUN) to be included for VM Protection.
- Protection
State string - Specifies Protection state of the backup. Possible values are
Invalid
,IRPending
,Protected
,ProtectionStopped
,ProtectionError
andProtectionPaused
. - Source
Vm stringId Specifies the ID of the VM to backup. Changing this forces a new resource to be created.
NOTE: After creation, the
source_vm_id
property can be removed without forcing a new resource to be created; however, setting it to a different ID will create a new resource. This allows the source vm to be deleted without having to remove the backup.
- recovery
Vault StringName - Specifies the name of the Recovery Services Vault to use. Changing this forces a new resource to be created.
- resource
Group StringName - Specifies the name of the Resource Group associated with the Recovery Services Vault to use. Changing this forces a new resource to be created.
- backup
Policy StringId - Specifies the id of the backup policy to use. Required in creation or when
protection_stopped
is not specified. - exclude
Disk List<Integer>Luns - A list of Disks' Logical Unit Numbers(LUN) to be excluded for VM Protection.
- include
Disk List<Integer>Luns - A list of Disks' Logical Unit Numbers(LUN) to be included for VM Protection.
- protection
State String - Specifies Protection state of the backup. Possible values are
Invalid
,IRPending
,Protected
,ProtectionStopped
,ProtectionError
andProtectionPaused
. - source
Vm StringId Specifies the ID of the VM to backup. Changing this forces a new resource to be created.
NOTE: After creation, the
source_vm_id
property can be removed without forcing a new resource to be created; however, setting it to a different ID will create a new resource. This allows the source vm to be deleted without having to remove the backup.
- recovery
Vault stringName - Specifies the name of the Recovery Services Vault to use. Changing this forces a new resource to be created.
- resource
Group stringName - Specifies the name of the Resource Group associated with the Recovery Services Vault to use. Changing this forces a new resource to be created.
- backup
Policy stringId - Specifies the id of the backup policy to use. Required in creation or when
protection_stopped
is not specified. - exclude
Disk number[]Luns - A list of Disks' Logical Unit Numbers(LUN) to be excluded for VM Protection.
- include
Disk number[]Luns - A list of Disks' Logical Unit Numbers(LUN) to be included for VM Protection.
- protection
State string - Specifies Protection state of the backup. Possible values are
Invalid
,IRPending
,Protected
,ProtectionStopped
,ProtectionError
andProtectionPaused
. - source
Vm stringId Specifies the ID of the VM to backup. Changing this forces a new resource to be created.
NOTE: After creation, the
source_vm_id
property can be removed without forcing a new resource to be created; however, setting it to a different ID will create a new resource. This allows the source vm to be deleted without having to remove the backup.
- recovery_
vault_ strname - Specifies the name of the Recovery Services Vault to use. Changing this forces a new resource to be created.
- resource_
group_ strname - Specifies the name of the Resource Group associated with the Recovery Services Vault to use. Changing this forces a new resource to be created.
- backup_
policy_ strid - Specifies the id of the backup policy to use. Required in creation or when
protection_stopped
is not specified. - exclude_
disk_ Sequence[int]luns - A list of Disks' Logical Unit Numbers(LUN) to be excluded for VM Protection.
- include_
disk_ Sequence[int]luns - A list of Disks' Logical Unit Numbers(LUN) to be included for VM Protection.
- protection_
state str - Specifies Protection state of the backup. Possible values are
Invalid
,IRPending
,Protected
,ProtectionStopped
,ProtectionError
andProtectionPaused
. - source_
vm_ strid Specifies the ID of the VM to backup. Changing this forces a new resource to be created.
NOTE: After creation, the
source_vm_id
property can be removed without forcing a new resource to be created; however, setting it to a different ID will create a new resource. This allows the source vm to be deleted without having to remove the backup.
- recovery
Vault StringName - Specifies the name of the Recovery Services Vault to use. Changing this forces a new resource to be created.
- resource
Group StringName - Specifies the name of the Resource Group associated with the Recovery Services Vault to use. Changing this forces a new resource to be created.
- backup
Policy StringId - Specifies the id of the backup policy to use. Required in creation or when
protection_stopped
is not specified. - exclude
Disk List<Number>Luns - A list of Disks' Logical Unit Numbers(LUN) to be excluded for VM Protection.
- include
Disk List<Number>Luns - A list of Disks' Logical Unit Numbers(LUN) to be included for VM Protection.
- protection
State String - Specifies Protection state of the backup. Possible values are
Invalid
,IRPending
,Protected
,ProtectionStopped
,ProtectionError
andProtectionPaused
. - source
Vm StringId Specifies the ID of the VM to backup. Changing this forces a new resource to be created.
NOTE: After creation, the
source_vm_id
property can be removed without forcing a new resource to be created; however, setting it to a different ID will create a new resource. This allows the source vm to be deleted without having to remove the backup.
Outputs
All input properties are implicitly available as output properties. Additionally, the ProtectedVM resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing ProtectedVM Resource
Get an existing ProtectedVM resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ProtectedVMState, opts?: CustomResourceOptions): ProtectedVM
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
backup_policy_id: Optional[str] = None,
exclude_disk_luns: Optional[Sequence[int]] = None,
include_disk_luns: Optional[Sequence[int]] = None,
protection_state: Optional[str] = None,
recovery_vault_name: Optional[str] = None,
resource_group_name: Optional[str] = None,
source_vm_id: Optional[str] = None) -> ProtectedVM
func GetProtectedVM(ctx *Context, name string, id IDInput, state *ProtectedVMState, opts ...ResourceOption) (*ProtectedVM, error)
public static ProtectedVM Get(string name, Input<string> id, ProtectedVMState? state, CustomResourceOptions? opts = null)
public static ProtectedVM get(String name, Output<String> id, ProtectedVMState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Backup
Policy stringId - Specifies the id of the backup policy to use. Required in creation or when
protection_stopped
is not specified. - Exclude
Disk List<int>Luns - A list of Disks' Logical Unit Numbers(LUN) to be excluded for VM Protection.
- Include
Disk List<int>Luns - A list of Disks' Logical Unit Numbers(LUN) to be included for VM Protection.
- Protection
State string - Specifies Protection state of the backup. Possible values are
Invalid
,IRPending
,Protected
,ProtectionStopped
,ProtectionError
andProtectionPaused
. - Recovery
Vault stringName - Specifies the name of the Recovery Services Vault to use. Changing this forces a new resource to be created.
- Resource
Group stringName - Specifies the name of the Resource Group associated with the Recovery Services Vault to use. Changing this forces a new resource to be created.
- Source
Vm stringId Specifies the ID of the VM to backup. Changing this forces a new resource to be created.
NOTE: After creation, the
source_vm_id
property can be removed without forcing a new resource to be created; however, setting it to a different ID will create a new resource. This allows the source vm to be deleted without having to remove the backup.
- Backup
Policy stringId - Specifies the id of the backup policy to use. Required in creation or when
protection_stopped
is not specified. - Exclude
Disk []intLuns - A list of Disks' Logical Unit Numbers(LUN) to be excluded for VM Protection.
- Include
Disk []intLuns - A list of Disks' Logical Unit Numbers(LUN) to be included for VM Protection.
- Protection
State string - Specifies Protection state of the backup. Possible values are
Invalid
,IRPending
,Protected
,ProtectionStopped
,ProtectionError
andProtectionPaused
. - Recovery
Vault stringName - Specifies the name of the Recovery Services Vault to use. Changing this forces a new resource to be created.
- Resource
Group stringName - Specifies the name of the Resource Group associated with the Recovery Services Vault to use. Changing this forces a new resource to be created.
- Source
Vm stringId Specifies the ID of the VM to backup. Changing this forces a new resource to be created.
NOTE: After creation, the
source_vm_id
property can be removed without forcing a new resource to be created; however, setting it to a different ID will create a new resource. This allows the source vm to be deleted without having to remove the backup.
- backup
Policy StringId - Specifies the id of the backup policy to use. Required in creation or when
protection_stopped
is not specified. - exclude
Disk List<Integer>Luns - A list of Disks' Logical Unit Numbers(LUN) to be excluded for VM Protection.
- include
Disk List<Integer>Luns - A list of Disks' Logical Unit Numbers(LUN) to be included for VM Protection.
- protection
State String - Specifies Protection state of the backup. Possible values are
Invalid
,IRPending
,Protected
,ProtectionStopped
,ProtectionError
andProtectionPaused
. - recovery
Vault StringName - Specifies the name of the Recovery Services Vault to use. Changing this forces a new resource to be created.
- resource
Group StringName - Specifies the name of the Resource Group associated with the Recovery Services Vault to use. Changing this forces a new resource to be created.
- source
Vm StringId Specifies the ID of the VM to backup. Changing this forces a new resource to be created.
NOTE: After creation, the
source_vm_id
property can be removed without forcing a new resource to be created; however, setting it to a different ID will create a new resource. This allows the source vm to be deleted without having to remove the backup.
- backup
Policy stringId - Specifies the id of the backup policy to use. Required in creation or when
protection_stopped
is not specified. - exclude
Disk number[]Luns - A list of Disks' Logical Unit Numbers(LUN) to be excluded for VM Protection.
- include
Disk number[]Luns - A list of Disks' Logical Unit Numbers(LUN) to be included for VM Protection.
- protection
State string - Specifies Protection state of the backup. Possible values are
Invalid
,IRPending
,Protected
,ProtectionStopped
,ProtectionError
andProtectionPaused
. - recovery
Vault stringName - Specifies the name of the Recovery Services Vault to use. Changing this forces a new resource to be created.
- resource
Group stringName - Specifies the name of the Resource Group associated with the Recovery Services Vault to use. Changing this forces a new resource to be created.
- source
Vm stringId Specifies the ID of the VM to backup. Changing this forces a new resource to be created.
NOTE: After creation, the
source_vm_id
property can be removed without forcing a new resource to be created; however, setting it to a different ID will create a new resource. This allows the source vm to be deleted without having to remove the backup.
- backup_
policy_ strid - Specifies the id of the backup policy to use. Required in creation or when
protection_stopped
is not specified. - exclude_
disk_ Sequence[int]luns - A list of Disks' Logical Unit Numbers(LUN) to be excluded for VM Protection.
- include_
disk_ Sequence[int]luns - A list of Disks' Logical Unit Numbers(LUN) to be included for VM Protection.
- protection_
state str - Specifies Protection state of the backup. Possible values are
Invalid
,IRPending
,Protected
,ProtectionStopped
,ProtectionError
andProtectionPaused
. - recovery_
vault_ strname - Specifies the name of the Recovery Services Vault to use. Changing this forces a new resource to be created.
- resource_
group_ strname - Specifies the name of the Resource Group associated with the Recovery Services Vault to use. Changing this forces a new resource to be created.
- source_
vm_ strid Specifies the ID of the VM to backup. Changing this forces a new resource to be created.
NOTE: After creation, the
source_vm_id
property can be removed without forcing a new resource to be created; however, setting it to a different ID will create a new resource. This allows the source vm to be deleted without having to remove the backup.
- backup
Policy StringId - Specifies the id of the backup policy to use. Required in creation or when
protection_stopped
is not specified. - exclude
Disk List<Number>Luns - A list of Disks' Logical Unit Numbers(LUN) to be excluded for VM Protection.
- include
Disk List<Number>Luns - A list of Disks' Logical Unit Numbers(LUN) to be included for VM Protection.
- protection
State String - Specifies Protection state of the backup. Possible values are
Invalid
,IRPending
,Protected
,ProtectionStopped
,ProtectionError
andProtectionPaused
. - recovery
Vault StringName - Specifies the name of the Recovery Services Vault to use. Changing this forces a new resource to be created.
- resource
Group StringName - Specifies the name of the Resource Group associated with the Recovery Services Vault to use. Changing this forces a new resource to be created.
- source
Vm StringId Specifies the ID of the VM to backup. Changing this forces a new resource to be created.
NOTE: After creation, the
source_vm_id
property can be removed without forcing a new resource to be created; however, setting it to a different ID will create a new resource. This allows the source vm to be deleted without having to remove the backup.
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
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurerm
Terraform Provider.