ReplicationPolicy

Manages a Azure Site Recovery replication policy within a recovery vault. Replication policies define the frequency at which recovery points are created and how long they are stored.

Example Usage

using Pulumi;
using Azure = Pulumi.Azure;

class MyStack : Stack
{
    public MyStack()
    {
        var secondary = new Azure.Core.ResourceGroup("secondary", new Azure.Core.ResourceGroupArgs
        {
            Location = "East US",
        });
        var vault = new Azure.RecoveryServices.Vault("vault", new Azure.RecoveryServices.VaultArgs
        {
            Location = secondary.Location,
            ResourceGroupName = secondary.Name,
            Sku = "Standard",
        });
        var policy = new Azure.SiteRecovery.ReplicationPolicy("policy", new Azure.SiteRecovery.ReplicationPolicyArgs
        {
            ResourceGroupName = secondary.Name,
            RecoveryVaultName = vault.Name,
            RecoveryPointRetentionInMinutes = 24 * 60,
            ApplicationConsistentSnapshotFrequencyInMinutes = 4 * 60,
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/core"
    "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/recoveryservices"
    "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/siterecovery"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        secondary, err := core.NewResourceGroup(ctx, "secondary", &core.ResourceGroupArgs{
            Location: pulumi.String("East US"),
        })
        if err != nil {
            return err
        }
        vault, err := recoveryservices.NewVault(ctx, "vault", &recoveryservices.VaultArgs{
            Location:          secondary.Location,
            ResourceGroupName: secondary.Name,
            Sku:               pulumi.String("Standard"),
        })
        if err != nil {
            return err
        }
        _, err = siterecovery.NewReplicationPolicy(ctx, "policy", &siterecovery.ReplicationPolicyArgs{
            ResourceGroupName:                               secondary.Name,
            RecoveryVaultName:                               vault.Name,
            RecoveryPointRetentionInMinutes:                 pulumi.Int(24 * 60),
            ApplicationConsistentSnapshotFrequencyInMinutes: pulumi.Int(4 * 60),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_azure as azure

secondary = azure.core.ResourceGroup("secondary", location="East US")
vault = azure.recoveryservices.Vault("vault",
    location=secondary.location,
    resource_group_name=secondary.name,
    sku="Standard")
policy = azure.siterecovery.ReplicationPolicy("policy",
    resource_group_name=secondary.name,
    recovery_vault_name=vault.name,
    recovery_point_retention_in_minutes=24 * 60,
    application_consistent_snapshot_frequency_in_minutes=4 * 60)
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const secondary = new azure.core.ResourceGroup("secondary", {location: "East US"});
const vault = new azure.recoveryservices.Vault("vault", {
    location: secondary.location,
    resourceGroupName: secondary.name,
    sku: "Standard",
});
const policy = new azure.siterecovery.ReplicationPolicy("policy", {
    resourceGroupName: secondary.name,
    recoveryVaultName: vault.name,
    recoveryPointRetentionInMinutes: 24 * 60,
    applicationConsistentSnapshotFrequencyInMinutes: 4 * 60,
});

Create a ReplicationPolicy Resource

def ReplicationPolicy(resource_name, opts=None, application_consistent_snapshot_frequency_in_minutes=None, name=None, recovery_point_retention_in_minutes=None, recovery_vault_name=None, resource_group_name=None, __props__=None);
name string
The unique name of the resource.
args ReplicationPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args ReplicationPolicyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ReplicationPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

ReplicationPolicy Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The ReplicationPolicy resource accepts the following input properties:

ApplicationConsistentSnapshotFrequencyInMinutes int

Specifies the frequency(in minutes) at which to create application consistent recovery points.

RecoveryPointRetentionInMinutes int

The duration in minutes for which the recovery points need to be stored.

RecoveryVaultName string

The name of the vault that should be updated.

ResourceGroupName string

Name of the resource group where the vault that should be updated is located.

Name string

The name of the network mapping.

ApplicationConsistentSnapshotFrequencyInMinutes int

Specifies the frequency(in minutes) at which to create application consistent recovery points.

RecoveryPointRetentionInMinutes int

The duration in minutes for which the recovery points need to be stored.

RecoveryVaultName string

The name of the vault that should be updated.

ResourceGroupName string

Name of the resource group where the vault that should be updated is located.

Name string

The name of the network mapping.

applicationConsistentSnapshotFrequencyInMinutes number

Specifies the frequency(in minutes) at which to create application consistent recovery points.

recoveryPointRetentionInMinutes number

The duration in minutes for which the recovery points need to be stored.

recoveryVaultName string

The name of the vault that should be updated.

resourceGroupName string

Name of the resource group where the vault that should be updated is located.

name string

The name of the network mapping.

application_consistent_snapshot_frequency_in_minutes float

Specifies the frequency(in minutes) at which to create application consistent recovery points.

recovery_point_retention_in_minutes float

The duration in minutes for which the recovery points need to be stored.

recovery_vault_name str

The name of the vault that should be updated.

resource_group_name str

Name of the resource group where the vault that should be updated is located.

name str

The name of the network mapping.

Outputs

All input properties are implicitly available as output properties. Additionally, the ReplicationPolicy 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 str
The provider-assigned unique ID for this managed resource.

Look up an Existing ReplicationPolicy Resource

Get an existing ReplicationPolicy 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?: ReplicationPolicyState, opts?: CustomResourceOptions): ReplicationPolicy
static get(resource_name, id, opts=None, application_consistent_snapshot_frequency_in_minutes=None, name=None, recovery_point_retention_in_minutes=None, recovery_vault_name=None, resource_group_name=None, __props__=None);
func GetReplicationPolicy(ctx *Context, name string, id IDInput, state *ReplicationPolicyState, opts ...ResourceOption) (*ReplicationPolicy, error)
public static ReplicationPolicy Get(string name, Input<string> id, ReplicationPolicyState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

ApplicationConsistentSnapshotFrequencyInMinutes int

Specifies the frequency(in minutes) at which to create application consistent recovery points.

Name string

The name of the network mapping.

RecoveryPointRetentionInMinutes int

The duration in minutes for which the recovery points need to be stored.

RecoveryVaultName string

The name of the vault that should be updated.

ResourceGroupName string

Name of the resource group where the vault that should be updated is located.

ApplicationConsistentSnapshotFrequencyInMinutes int

Specifies the frequency(in minutes) at which to create application consistent recovery points.

Name string

The name of the network mapping.

RecoveryPointRetentionInMinutes int

The duration in minutes for which the recovery points need to be stored.

RecoveryVaultName string

The name of the vault that should be updated.

ResourceGroupName string

Name of the resource group where the vault that should be updated is located.

applicationConsistentSnapshotFrequencyInMinutes number

Specifies the frequency(in minutes) at which to create application consistent recovery points.

name string

The name of the network mapping.

recoveryPointRetentionInMinutes number

The duration in minutes for which the recovery points need to be stored.

recoveryVaultName string

The name of the vault that should be updated.

resourceGroupName string

Name of the resource group where the vault that should be updated is located.

application_consistent_snapshot_frequency_in_minutes float

Specifies the frequency(in minutes) at which to create application consistent recovery points.

name str

The name of the network mapping.

recovery_point_retention_in_minutes float

The duration in minutes for which the recovery points need to be stored.

recovery_vault_name str

The name of the vault that should be updated.

resource_group_name str

Name of the resource group where the vault that should be updated is located.

Package Details

Repository
https://github.com/pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.