1. Packages
  2. Azure Classic
  3. API Docs
  4. siterecovery
  5. ReplicationPolicy

We recommend using Azure Native.

Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
azure logo

We recommend using Azure Native.

Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi

    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/v4/go/azure/core"
    	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/recoveryservices"
    	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/siterecovery"
    	"github.com/pulumi/pulumi/sdk/v3/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:                 24 * 60,
    			ApplicationConsistentSnapshotFrequencyInMinutes: 4 * 60,
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Example coming soon!

    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,
    });
    
    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)
    

    Example coming soon!

    Create ReplicationPolicy Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ReplicationPolicy(name: string, args: ReplicationPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def ReplicationPolicy(resource_name: str,
                          args: ReplicationPolicyArgs,
                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def ReplicationPolicy(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          application_consistent_snapshot_frequency_in_minutes: Optional[int] = None,
                          recovery_point_retention_in_minutes: Optional[int] = None,
                          recovery_vault_name: Optional[str] = None,
                          resource_group_name: Optional[str] = None,
                          name: Optional[str] = None)
    func NewReplicationPolicy(ctx *Context, name string, args ReplicationPolicyArgs, opts ...ResourceOption) (*ReplicationPolicy, error)
    public ReplicationPolicy(string name, ReplicationPolicyArgs args, CustomResourceOptions? opts = null)
    public ReplicationPolicy(String name, ReplicationPolicyArgs args)
    public ReplicationPolicy(String name, ReplicationPolicyArgs args, CustomResourceOptions options)
    
    type: azure:siterecovery:ReplicationPolicy
    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 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.
    args ReplicationPolicyArgs
    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 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.
    name String
    The unique name of the resource.
    args ReplicationPolicyArgs
    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 replicationPolicyResource = new Azure.SiteRecovery.ReplicationPolicy("replicationPolicyResource", new()
    {
        ApplicationConsistentSnapshotFrequencyInMinutes = 0,
        RecoveryPointRetentionInMinutes = 0,
        RecoveryVaultName = "string",
        ResourceGroupName = "string",
        Name = "string",
    });
    
    example, err := siterecovery.NewReplicationPolicy(ctx, "replicationPolicyResource", &siterecovery.ReplicationPolicyArgs{
    	ApplicationConsistentSnapshotFrequencyInMinutes: pulumi.Int(0),
    	RecoveryPointRetentionInMinutes:                 pulumi.Int(0),
    	RecoveryVaultName:                               pulumi.String("string"),
    	ResourceGroupName:                               pulumi.String("string"),
    	Name:                                            pulumi.String("string"),
    })
    
    var replicationPolicyResource = new ReplicationPolicy("replicationPolicyResource", ReplicationPolicyArgs.builder()
        .applicationConsistentSnapshotFrequencyInMinutes(0)
        .recoveryPointRetentionInMinutes(0)
        .recoveryVaultName("string")
        .resourceGroupName("string")
        .name("string")
        .build());
    
    replication_policy_resource = azure.siterecovery.ReplicationPolicy("replicationPolicyResource",
        application_consistent_snapshot_frequency_in_minutes=0,
        recovery_point_retention_in_minutes=0,
        recovery_vault_name="string",
        resource_group_name="string",
        name="string")
    
    const replicationPolicyResource = new azure.siterecovery.ReplicationPolicy("replicationPolicyResource", {
        applicationConsistentSnapshotFrequencyInMinutes: 0,
        recoveryPointRetentionInMinutes: 0,
        recoveryVaultName: "string",
        resourceGroupName: "string",
        name: "string",
    });
    
    type: azure:siterecovery:ReplicationPolicy
    properties:
        applicationConsistentSnapshotFrequencyInMinutes: 0
        name: string
        recoveryPointRetentionInMinutes: 0
        recoveryVaultName: string
        resourceGroupName: string
    

    ReplicationPolicy 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 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 replication policy.
    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 replication policy.
    applicationConsistentSnapshotFrequencyInMinutes Integer
    Specifies the frequency(in minutes) at which to create application consistent recovery points.
    recoveryPointRetentionInMinutes Integer
    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 replication policy.
    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 replication policy.
    application_consistent_snapshot_frequency_in_minutes int
    Specifies the frequency(in minutes) at which to create application consistent recovery points.
    recovery_point_retention_in_minutes int
    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 replication policy.
    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 replication policy.

    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 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 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
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            application_consistent_snapshot_frequency_in_minutes: Optional[int] = None,
            name: Optional[str] = None,
            recovery_point_retention_in_minutes: Optional[int] = None,
            recovery_vault_name: Optional[str] = None,
            resource_group_name: Optional[str] = None) -> ReplicationPolicy
    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)
    public static ReplicationPolicy get(String name, Output<String> id, ReplicationPolicyState state, CustomResourceOptions options)
    resources:  _:    type: azure:siterecovery:ReplicationPolicy    get:      id: ${id}
    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.
    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 replication policy.
    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 replication policy.
    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 Integer
    Specifies the frequency(in minutes) at which to create application consistent recovery points.
    name String
    The name of the replication policy.
    recoveryPointRetentionInMinutes Integer
    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 replication policy.
    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 int
    Specifies the frequency(in minutes) at which to create application consistent recovery points.
    name str
    The name of the replication policy.
    recovery_point_retention_in_minutes int
    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.
    applicationConsistentSnapshotFrequencyInMinutes Number
    Specifies the frequency(in minutes) at which to create application consistent recovery points.
    name String
    The name of the replication policy.
    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.

    Import

    Site Recovery Replication Policies can be imported using the resource id, e.g.

     $ pulumi import azure:siterecovery/replicationPolicy:ReplicationPolicy mypolicy /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resource-group-name/providers/Microsoft.RecoveryServices/vaults/recovery-vault-name/replicationPolicies/policy-name
    

    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.
    azure logo

    We recommend using Azure Native.

    Viewing docs for Azure v4.42.0 (Older version)
    published on Monday, Mar 9, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.