import * as pulumi from "@pulumi/pulumi"; /** * Manages an Azure Backup Protected Virtual Machine. * * ## Example Usage * * ```typescript * 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, * }); * ``` * * ## API Providers * * * This resource uses the following Azure API Providers: * * * `Microsoft.RecoveryServices` - 2024-01-01 * * ## Import * * Backup Protected Virtual Machines can be imported using the `resource id`, e.g. * * ```sh * $ 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" * ``` */ export declare class ProtectedVM extends pulumi.CustomResource { /** * Get an existing ProtectedVM resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: ProtectedVMState, opts?: pulumi.CustomResourceOptions): ProtectedVM; /** * Returns true if the given object is an instance of ProtectedVM. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is ProtectedVM; /** * Specifies the ID of the backup policy to use. * * > **Note:** `backupPolicyId` is required during initial creation of this resource. * * > **Note:** When `protectionState` is set to `BackupsSuspended` or `ProtectionStopped`, the Azure API may not return `backupPolicyId`. To avoid a perpetual diff, use Terraform's ignoreChanges argument. */ readonly backupPolicyId: pulumi.Output; /** * A list of Disks' Logical Unit Numbers (LUN) to be excluded for VM Protection. */ readonly excludeDiskLuns: pulumi.Output; /** * A list of Disks' Logical Unit Numbers (LUN) to be included for VM Protection. */ readonly includeDiskLuns: pulumi.Output; /** * Specifies Protection state of the backup. Possible values are `Protected`, `BackupsSuspended`, and `ProtectionStopped`. * * > **Note:** `protectionState` cannot be set to `BackupsSuspended` unless the `azure.recoveryservices.Vault` has `immutability` set to `Unlocked` or `Locked`. */ readonly protectionState: pulumi.Output; /** * Specifies the name of the Recovery Services Vault to use. Changing this forces a new resource to be created. */ readonly recoveryVaultName: pulumi.Output; /** * Specifies the name of the Resource Group **associated with** the Recovery Services Vault to use. Changing this forces a new resource to be created. */ readonly resourceGroupName: pulumi.Output; /** * Specifies the ID of the virtual machine to back up. Changing this forces a new resource to be created. * * > **Note:** After creation, the `sourceVmId` 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 virtual machine to be deleted without having to remove the backup. */ readonly sourceVmId: pulumi.Output; /** * Create a ProtectedVM resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: ProtectedVMArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering ProtectedVM resources. */ export interface ProtectedVMState { /** * Specifies the ID of the backup policy to use. * * > **Note:** `backupPolicyId` is required during initial creation of this resource. * * > **Note:** When `protectionState` is set to `BackupsSuspended` or `ProtectionStopped`, the Azure API may not return `backupPolicyId`. To avoid a perpetual diff, use Terraform's ignoreChanges argument. */ backupPolicyId?: pulumi.Input; /** * A list of Disks' Logical Unit Numbers (LUN) to be excluded for VM Protection. */ excludeDiskLuns?: pulumi.Input[]>; /** * A list of Disks' Logical Unit Numbers (LUN) to be included for VM Protection. */ includeDiskLuns?: pulumi.Input[]>; /** * Specifies Protection state of the backup. Possible values are `Protected`, `BackupsSuspended`, and `ProtectionStopped`. * * > **Note:** `protectionState` cannot be set to `BackupsSuspended` unless the `azure.recoveryservices.Vault` has `immutability` set to `Unlocked` or `Locked`. */ protectionState?: pulumi.Input; /** * Specifies the name of the Recovery Services Vault to use. Changing this forces a new resource to be created. */ recoveryVaultName?: pulumi.Input; /** * Specifies the name of the Resource Group **associated with** the Recovery Services Vault to use. Changing this forces a new resource to be created. */ resourceGroupName?: pulumi.Input; /** * Specifies the ID of the virtual machine to back up. Changing this forces a new resource to be created. * * > **Note:** After creation, the `sourceVmId` 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 virtual machine to be deleted without having to remove the backup. */ sourceVmId?: pulumi.Input; } /** * The set of arguments for constructing a ProtectedVM resource. */ export interface ProtectedVMArgs { /** * Specifies the ID of the backup policy to use. * * > **Note:** `backupPolicyId` is required during initial creation of this resource. * * > **Note:** When `protectionState` is set to `BackupsSuspended` or `ProtectionStopped`, the Azure API may not return `backupPolicyId`. To avoid a perpetual diff, use Terraform's ignoreChanges argument. */ backupPolicyId?: pulumi.Input; /** * A list of Disks' Logical Unit Numbers (LUN) to be excluded for VM Protection. */ excludeDiskLuns?: pulumi.Input[]>; /** * A list of Disks' Logical Unit Numbers (LUN) to be included for VM Protection. */ includeDiskLuns?: pulumi.Input[]>; /** * Specifies Protection state of the backup. Possible values are `Protected`, `BackupsSuspended`, and `ProtectionStopped`. * * > **Note:** `protectionState` cannot be set to `BackupsSuspended` unless the `azure.recoveryservices.Vault` has `immutability` set to `Unlocked` or `Locked`. */ protectionState?: pulumi.Input; /** * Specifies the name of the Recovery Services Vault to use. Changing this forces a new resource to be created. */ recoveryVaultName: pulumi.Input; /** * Specifies the name of the Resource Group **associated with** the Recovery Services Vault to use. Changing this forces a new resource to be created. */ resourceGroupName: pulumi.Input; /** * Specifies the ID of the virtual machine to back up. Changing this forces a new resource to be created. * * > **Note:** After creation, the `sourceVmId` 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 virtual machine to be deleted without having to remove the backup. */ sourceVmId?: pulumi.Input; }