Module recoveryservices

@pulumi/azure > recoveryservices

This provider is a derived work of the Terraform Provider distributed under MPL 2.0. If you encounter a bug or missing feature, first check the pulumi/pulumi-azure repo; however, if that doesn’t turn up anything, please consult the source terraform-providers/terraform-provider-azurerm repo.

class ProtectedVM

extends CustomResource

Manages an Recovery Protected VM.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const exampleResourceGroup = new azure.core.ResourceGroup("example", {
    location: "West US",
    name: "tfex-recovery_vault",
});
const exampleVault = new azure.recoveryservices.Vault("example", {
    location: exampleResourceGroup.location,
    name: "tfex-recovery-vault",
    resourceGroupName: exampleResourceGroup.name,
    sku: "Standard",
});
const exampleProtectionPolicyVM = new azure.recoveryservices.ProtectionPolicyVM("example", {
    backup: {
        frequency: "Daily",
        time: "23:00",
    },
    name: "tfex-recovery-vault-policy",
    recoveryVaultName: exampleVault.name,
    resourceGroupName: exampleResourceGroup.name,
});
const vm1 = new azure.recoveryservices.ProtectedVM("vm1", {
    backupPolicyId: exampleProtectionPolicyVM.id,
    recoveryVaultName: exampleVault.name,
    resourceGroupName: exampleResourceGroup.name,
    sourceVmId: azurerm_virtual_machine_example.id,
});

This content is derived from https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/website/docs/r/recovery_services_protected_vm.html.markdown.

constructor

new ProtectedVM(name: string, args: ProtectedVMArgs, opts?: pulumi.CustomResourceOptions)

Create a ProtectedVM resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ProtectedVMState, opts?: pulumi.CustomResourceOptions): ProtectedVM

Get an existing ProtectedVM resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

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.

property backupPolicyId

public backupPolicyId: pulumi.Output<string>;

Specifies the id of the backup policy to use. Changing this forces a new resource to be created.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property recoveryVaultName

public recoveryVaultName: pulumi.Output<string>;

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

property resourceGroupName

public resourceGroupName: pulumi.Output<string>;

The name of the resource group in which to create the Recovery Services Protected VM. Changing this forces a new resource to be created.

property sourceVmId

public sourceVmId: pulumi.Output<string>;

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

property tags

public tags: pulumi.Output<{[key: string]: any}>;

A mapping of tags to assign to the resource.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class ProtectionPolicyVM

extends CustomResource

Manages an Recovery Services VM Protection Policy.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const exampleResourceGroup = new azure.core.ResourceGroup("example", {
    location: "West US",
    name: "tfex-recovery_vault",
});
const exampleVault = new azure.recoveryservices.Vault("example", {
    location: exampleResourceGroup.location,
    name: "tfex-recovery-vault",
    resourceGroupName: exampleResourceGroup.name,
    sku: "Standard",
});
const test = new azure.recoveryservices.ProtectionPolicyVM("test", {
    backup: {
        frequency: "Daily",
        time: "23:00",
    },
    name: "tfex-recovery-vault-policy",
    recoveryVaultName: exampleVault.name,
    resourceGroupName: exampleResourceGroup.name,
    retentionDaily: {
        count: 10,
    },
    retentionMonthly: {
        count: 7,
        weekdays: [
            "Sunday",
            "Wednesday",
        ],
        weeks: [
            "First",
            "Last",
        ],
    },
    retentionWeekly: {
        count: 42,
        weekdays: [
            "Sunday",
            "Wednesday",
            "Friday",
            "Saturday",
        ],
    },
    retentionYearly: {
        count: 77,
        months: ["January"],
        weekdays: ["Sunday"],
        weeks: ["Last"],
    },
    timezone: "UTC",
});

This content is derived from https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/website/docs/r/recovery_services_protection_policy_vm.html.markdown.

constructor

new ProtectionPolicyVM(name: string, args: ProtectionPolicyVMArgs, opts?: pulumi.CustomResourceOptions)

Create a ProtectionPolicyVM resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: ProtectionPolicyVMState, opts?: pulumi.CustomResourceOptions): ProtectionPolicyVM

Get an existing ProtectionPolicyVM resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of ProtectionPolicyVM. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property backup

public backup: pulumi.Output<{
    frequency: string;
    time: string;
    weekdays: string[];
}>;

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

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property name

public name: pulumi.Output<string>;

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

property recoveryVaultName

public recoveryVaultName: pulumi.Output<string>;

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

property resourceGroupName

public resourceGroupName: pulumi.Output<string>;

The name of the resource group in which to create the Recovery Services Protected VM. Changing this forces a new resource to be created.

property retentionDaily

public retentionDaily: pulumi.Output<{
    count: number;
} | undefined>;

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

property retentionMonthly

public retentionMonthly: pulumi.Output<{
    count: number;
    weekdays: string[];
    weeks: string[];
} | undefined>;

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

property retentionWeekly

public retentionWeekly: pulumi.Output<{
    count: number;
    weekdays: string[];
} | undefined>;

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

property retentionYearly

public retentionYearly: pulumi.Output<{
    count: number;
    months: string[];
    weekdays: string[];
    weeks: string[];
} | undefined>;

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

property tags

public tags: pulumi.Output<{[key: string]: any}>;

A mapping of tags to assign to the resource.

property timezone

public timezone: pulumi.Output<string | undefined>;

Specifies the timezone. Defaults to UTC

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

class Vault

extends CustomResource

Manage an Recovery Services Vault.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const rg = new azure.core.ResourceGroup("rg", {
    location: "West US",
    name: "tfex-recovery_vault",
});
const vault = new azure.recoveryservices.Vault("vault", {
    location: rg.location,
    name: "exampleRecoveryVault",
    resourceGroupName: rg.name,
    sku: "Standard",
});

This content is derived from https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/website/docs/r/recovery_services_vault.html.markdown.

constructor

new Vault(name: string, args: VaultArgs, opts?: pulumi.CustomResourceOptions)

Create a Vault resource with the given unique name, arguments, and options.

  • name The unique name of the resource.
  • args The arguments to use to populate this resource's properties.
  • opts A bag of options that control this resource's behavior.

method get

public static get(name: string, id: pulumi.Input<pulumi.ID>, state?: VaultState, opts?: pulumi.CustomResourceOptions): Vault

Get an existing Vault resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

method getProvider

getProvider(moduleMember: string): ProviderResource | undefined

method isInstance

public static isInstance(obj: any): boolean

Returns true if the given object is an instance of Vault. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.

property id

id: Output<ID>;

id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be missing (undefined) during planning phases.

property location

public location: pulumi.Output<string>;

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

property name

public name: pulumi.Output<string>;

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

property resourceGroupName

public resourceGroupName: pulumi.Output<string>;

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

property sku

public sku: pulumi.Output<string>;

Sets the vault’s SKU. Possible values include: Standard, RS0.

property tags

public tags: pulumi.Output<{[key: string]: any}>;

A mapping of tags to assign to the resource.

property urn

urn: Output<URN>;

urn is the stable logical URN used to distinctly address a resource, both before and after deployments.

function getVMProtectionPolicy

getVMProtectionPolicy(args: GetVMProtectionPolicyArgs, opts?: pulumi.InvokeOptions): Promise<GetVMProtectionPolicyResult> & GetVMProtectionPolicyResult

Use this data source to access information about an existing Recovery Services VM Protection Policy.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const policy = pulumi.output(azure.recoveryservices.getVMProtectionPolicy({
    name: "policy",
    recoveryVaultName: "recoveryVault",
    resourceGroupName: "resourceGroup",
}));

This content is derived from https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/website/docs/d/recovery_services_protection_policy_vm.html.markdown.

function getVault

getVault(args: GetVaultArgs, opts?: pulumi.InvokeOptions): Promise<GetVaultResult> & GetVaultResult

Use this data source to access information about an existing Recovery Services Vault.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const vault = pulumi.output(azure.recoveryservices.getVault({
    name: "tfex-recovery_vault",
    resourceGroupName: "tfex-resource_group",
}));

This content is derived from https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/website/docs/d/recovery_services_vault.html.markdown.

interface GetVMProtectionPolicyArgs

A collection of arguments for invoking getVMProtectionPolicy.

property name

name: string;

Specifies the name of the Recovery Services VM Protection Policy.

property recoveryVaultName

recoveryVaultName: string;

Specifies the name of the Recovery Services Vault.

property resourceGroupName

resourceGroupName: string;

The name of the resource group in which the Recovery Services VM Protection Policy resides.

interface GetVMProtectionPolicyResult

A collection of values returned by getVMProtectionPolicy.

property id

id: string;

id is the provider-assigned unique ID for this managed resource.

property name

name: string;

property recoveryVaultName

recoveryVaultName: string;

property resourceGroupName

resourceGroupName: string;

property tags

tags: {[key: string]: any};

A mapping of tags assigned to the resource.

interface GetVaultArgs

A collection of arguments for invoking getVault.

property name

name: string;

Specifies the name of the Recovery Services Vault.

property resourceGroupName

resourceGroupName: string;

The name of the resource group in which the Recovery Services Vault resides.

interface GetVaultResult

A collection of values returned by getVault.

property id

id: string;

id is the provider-assigned unique ID for this managed resource.

property location

location: string;

The Azure location where the resource resides.

property name

name: string;

property resourceGroupName

resourceGroupName: string;

property sku

sku: string;

The vault’s current SKU.

property tags

tags: {[key: string]: any};

A mapping of tags assigned to the resource.

interface ProtectedVMArgs

The set of arguments for constructing a ProtectedVM resource.

property backupPolicyId

backupPolicyId: pulumi.Input<string>;

Specifies the id of the backup policy to use. Changing this forces a new resource to be created.

property recoveryVaultName

recoveryVaultName: pulumi.Input<string>;

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

property resourceGroupName

resourceGroupName: pulumi.Input<string>;

The name of the resource group in which to create the Recovery Services Protected VM. Changing this forces a new resource to be created.

property sourceVmId

sourceVmId: pulumi.Input<string>;

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

property tags

tags?: pulumi.Input<{[key: string]: any}>;

A mapping of tags to assign to the resource.

interface ProtectedVMState

Input properties used for looking up and filtering ProtectedVM resources.

property backupPolicyId

backupPolicyId?: pulumi.Input<string>;

Specifies the id of the backup policy to use. Changing this forces a new resource to be created.

property recoveryVaultName

recoveryVaultName?: pulumi.Input<string>;

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

property resourceGroupName

resourceGroupName?: pulumi.Input<string>;

The name of the resource group in which to create the Recovery Services Protected VM. Changing this forces a new resource to be created.

property sourceVmId

sourceVmId?: pulumi.Input<string>;

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

property tags

tags?: pulumi.Input<{[key: string]: any}>;

A mapping of tags to assign to the resource.

interface ProtectionPolicyVMArgs

The set of arguments for constructing a ProtectionPolicyVM resource.

property backup

backup: pulumi.Input<{
    frequency: pulumi.Input<string>;
    time: pulumi.Input<string>;
    weekdays: pulumi.Input<pulumi.Input<string>[]>;
}>;

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

property name

name?: pulumi.Input<string>;

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

property recoveryVaultName

recoveryVaultName: pulumi.Input<string>;

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

property resourceGroupName

resourceGroupName: pulumi.Input<string>;

The name of the resource group in which to create the Recovery Services Protected VM. Changing this forces a new resource to be created.

property retentionDaily

retentionDaily?: pulumi.Input<{
    count: pulumi.Input<number>;
}>;

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

property retentionMonthly

retentionMonthly?: pulumi.Input<{
    count: pulumi.Input<number>;
    weekdays: pulumi.Input<pulumi.Input<string>[]>;
    weeks: pulumi.Input<pulumi.Input<string>[]>;
}>;

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

property retentionWeekly

retentionWeekly?: pulumi.Input<{
    count: pulumi.Input<number>;
    weekdays: pulumi.Input<pulumi.Input<string>[]>;
}>;

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

property retentionYearly

retentionYearly?: pulumi.Input<{
    count: pulumi.Input<number>;
    months: pulumi.Input<pulumi.Input<string>[]>;
    weekdays: pulumi.Input<pulumi.Input<string>[]>;
    weeks: pulumi.Input<pulumi.Input<string>[]>;
}>;

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

property tags

tags?: pulumi.Input<{[key: string]: any}>;

A mapping of tags to assign to the resource.

property timezone

timezone?: pulumi.Input<string>;

Specifies the timezone. Defaults to UTC

interface ProtectionPolicyVMState

Input properties used for looking up and filtering ProtectionPolicyVM resources.

property backup

backup?: pulumi.Input<{
    frequency: pulumi.Input<string>;
    time: pulumi.Input<string>;
    weekdays: pulumi.Input<pulumi.Input<string>[]>;
}>;

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

property name

name?: pulumi.Input<string>;

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

property recoveryVaultName

recoveryVaultName?: pulumi.Input<string>;

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

property resourceGroupName

resourceGroupName?: pulumi.Input<string>;

The name of the resource group in which to create the Recovery Services Protected VM. Changing this forces a new resource to be created.

property retentionDaily

retentionDaily?: pulumi.Input<{
    count: pulumi.Input<number>;
}>;

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

property retentionMonthly

retentionMonthly?: pulumi.Input<{
    count: pulumi.Input<number>;
    weekdays: pulumi.Input<pulumi.Input<string>[]>;
    weeks: pulumi.Input<pulumi.Input<string>[]>;
}>;

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

property retentionWeekly

retentionWeekly?: pulumi.Input<{
    count: pulumi.Input<number>;
    weekdays: pulumi.Input<pulumi.Input<string>[]>;
}>;

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

property retentionYearly

retentionYearly?: pulumi.Input<{
    count: pulumi.Input<number>;
    months: pulumi.Input<pulumi.Input<string>[]>;
    weekdays: pulumi.Input<pulumi.Input<string>[]>;
    weeks: pulumi.Input<pulumi.Input<string>[]>;
}>;

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

property tags

tags?: pulumi.Input<{[key: string]: any}>;

A mapping of tags to assign to the resource.

property timezone

timezone?: pulumi.Input<string>;

Specifies the timezone. Defaults to UTC

interface VaultArgs

The set of arguments for constructing a Vault resource.

property location

location?: pulumi.Input<string>;

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

property name

name?: pulumi.Input<string>;

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

property resourceGroupName

resourceGroupName: pulumi.Input<string>;

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

property sku

sku: pulumi.Input<string>;

Sets the vault’s SKU. Possible values include: Standard, RS0.

property tags

tags?: pulumi.Input<{[key: string]: any}>;

A mapping of tags to assign to the resource.

interface VaultState

Input properties used for looking up and filtering Vault resources.

property location

location?: pulumi.Input<string>;

Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.

property name

name?: pulumi.Input<string>;

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

property resourceGroupName

resourceGroupName?: pulumi.Input<string>;

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

property sku

sku?: pulumi.Input<string>;

Sets the vault’s SKU. Possible values include: Standard, RS0.

property tags

tags?: pulumi.Input<{[key: string]: any}>;

A mapping of tags to assign to the resource.