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

We recommend using Azure Native.

Azure v6.10.0 published on Tuesday, Nov 19, 2024 by Pulumi

azure.siterecovery.HyperVReplicationPolicy

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure v6.10.0 published on Tuesday, Nov 19, 2024 by Pulumi

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

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = new azure.core.ResourceGroup("example", {
        name: "example-rg",
        location: "East US",
    });
    const vault = new azure.recoveryservices.Vault("vault", {
        name: "example-recovery-vault",
        location: example.location,
        resourceGroupName: example.name,
        sku: "Standard",
    });
    const policy = new azure.siterecovery.HyperVReplicationPolicy("policy", {
        name: "policy",
        recoveryVaultId: vault.id,
        recoveryPointRetentionInHours: 2,
        applicationConsistentSnapshotFrequencyInHours: 1,
        replicationIntervalInSeconds: 300,
    });
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.core.ResourceGroup("example",
        name="example-rg",
        location="East US")
    vault = azure.recoveryservices.Vault("vault",
        name="example-recovery-vault",
        location=example.location,
        resource_group_name=example.name,
        sku="Standard")
    policy = azure.siterecovery.HyperVReplicationPolicy("policy",
        name="policy",
        recovery_vault_id=vault.id,
        recovery_point_retention_in_hours=2,
        application_consistent_snapshot_frequency_in_hours=1,
        replication_interval_in_seconds=300)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
    	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/recoveryservices"
    	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/siterecovery"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
    			Name:     pulumi.String("example-rg"),
    			Location: pulumi.String("East US"),
    		})
    		if err != nil {
    			return err
    		}
    		vault, err := recoveryservices.NewVault(ctx, "vault", &recoveryservices.VaultArgs{
    			Name:              pulumi.String("example-recovery-vault"),
    			Location:          example.Location,
    			ResourceGroupName: example.Name,
    			Sku:               pulumi.String("Standard"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = siterecovery.NewHyperVReplicationPolicy(ctx, "policy", &siterecovery.HyperVReplicationPolicyArgs{
    			Name:                          pulumi.String("policy"),
    			RecoveryVaultId:               vault.ID(),
    			RecoveryPointRetentionInHours: pulumi.Int(2),
    			ApplicationConsistentSnapshotFrequencyInHours: pulumi.Int(1),
    			ReplicationIntervalInSeconds:                  pulumi.Int(300),
    		})
    		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 example = new Azure.Core.ResourceGroup("example", new()
        {
            Name = "example-rg",
            Location = "East US",
        });
    
        var vault = new Azure.RecoveryServices.Vault("vault", new()
        {
            Name = "example-recovery-vault",
            Location = example.Location,
            ResourceGroupName = example.Name,
            Sku = "Standard",
        });
    
        var policy = new Azure.SiteRecovery.HyperVReplicationPolicy("policy", new()
        {
            Name = "policy",
            RecoveryVaultId = vault.Id,
            RecoveryPointRetentionInHours = 2,
            ApplicationConsistentSnapshotFrequencyInHours = 1,
            ReplicationIntervalInSeconds = 300,
        });
    
    });
    
    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.siterecovery.HyperVReplicationPolicy;
    import com.pulumi.azure.siterecovery.HyperVReplicationPolicyArgs;
    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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
                .name("example-rg")
                .location("East US")
                .build());
    
            var vault = new Vault("vault", VaultArgs.builder()
                .name("example-recovery-vault")
                .location(example.location())
                .resourceGroupName(example.name())
                .sku("Standard")
                .build());
    
            var policy = new HyperVReplicationPolicy("policy", HyperVReplicationPolicyArgs.builder()
                .name("policy")
                .recoveryVaultId(vault.id())
                .recoveryPointRetentionInHours(2)
                .applicationConsistentSnapshotFrequencyInHours(1)
                .replicationIntervalInSeconds(300)
                .build());
    
        }
    }
    
    resources:
      example:
        type: azure:core:ResourceGroup
        properties:
          name: example-rg
          location: East US
      vault:
        type: azure:recoveryservices:Vault
        properties:
          name: example-recovery-vault
          location: ${example.location}
          resourceGroupName: ${example.name}
          sku: Standard
      policy:
        type: azure:siterecovery:HyperVReplicationPolicy
        properties:
          name: policy
          recoveryVaultId: ${vault.id}
          recoveryPointRetentionInHours: 2
          applicationConsistentSnapshotFrequencyInHours: 1
          replicationIntervalInSeconds: 300
    

    Create HyperVReplicationPolicy Resource

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

    Constructor syntax

    new HyperVReplicationPolicy(name: string, args: HyperVReplicationPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def HyperVReplicationPolicy(resource_name: str,
                                args: HyperVReplicationPolicyArgs,
                                opts: Optional[ResourceOptions] = None)
    
    @overload
    def HyperVReplicationPolicy(resource_name: str,
                                opts: Optional[ResourceOptions] = None,
                                application_consistent_snapshot_frequency_in_hours: Optional[int] = None,
                                recovery_point_retention_in_hours: Optional[int] = None,
                                recovery_vault_id: Optional[str] = None,
                                replication_interval_in_seconds: Optional[int] = None,
                                name: Optional[str] = None)
    func NewHyperVReplicationPolicy(ctx *Context, name string, args HyperVReplicationPolicyArgs, opts ...ResourceOption) (*HyperVReplicationPolicy, error)
    public HyperVReplicationPolicy(string name, HyperVReplicationPolicyArgs args, CustomResourceOptions? opts = null)
    public HyperVReplicationPolicy(String name, HyperVReplicationPolicyArgs args)
    public HyperVReplicationPolicy(String name, HyperVReplicationPolicyArgs args, CustomResourceOptions options)
    
    type: azure:siterecovery:HyperVReplicationPolicy
    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 HyperVReplicationPolicyArgs
    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 HyperVReplicationPolicyArgs
    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 HyperVReplicationPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args HyperVReplicationPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args HyperVReplicationPolicyArgs
    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 hyperVReplicationPolicyResource = new Azure.SiteRecovery.HyperVReplicationPolicy("hyperVReplicationPolicyResource", new()
    {
        ApplicationConsistentSnapshotFrequencyInHours = 0,
        RecoveryPointRetentionInHours = 0,
        RecoveryVaultId = "string",
        ReplicationIntervalInSeconds = 0,
        Name = "string",
    });
    
    example, err := siterecovery.NewHyperVReplicationPolicy(ctx, "hyperVReplicationPolicyResource", &siterecovery.HyperVReplicationPolicyArgs{
    	ApplicationConsistentSnapshotFrequencyInHours: pulumi.Int(0),
    	RecoveryPointRetentionInHours:                 pulumi.Int(0),
    	RecoveryVaultId:                               pulumi.String("string"),
    	ReplicationIntervalInSeconds:                  pulumi.Int(0),
    	Name:                                          pulumi.String("string"),
    })
    
    var hyperVReplicationPolicyResource = new HyperVReplicationPolicy("hyperVReplicationPolicyResource", HyperVReplicationPolicyArgs.builder()
        .applicationConsistentSnapshotFrequencyInHours(0)
        .recoveryPointRetentionInHours(0)
        .recoveryVaultId("string")
        .replicationIntervalInSeconds(0)
        .name("string")
        .build());
    
    hyper_v_replication_policy_resource = azure.siterecovery.HyperVReplicationPolicy("hyperVReplicationPolicyResource",
        application_consistent_snapshot_frequency_in_hours=0,
        recovery_point_retention_in_hours=0,
        recovery_vault_id="string",
        replication_interval_in_seconds=0,
        name="string")
    
    const hyperVReplicationPolicyResource = new azure.siterecovery.HyperVReplicationPolicy("hyperVReplicationPolicyResource", {
        applicationConsistentSnapshotFrequencyInHours: 0,
        recoveryPointRetentionInHours: 0,
        recoveryVaultId: "string",
        replicationIntervalInSeconds: 0,
        name: "string",
    });
    
    type: azure:siterecovery:HyperVReplicationPolicy
    properties:
        applicationConsistentSnapshotFrequencyInHours: 0
        name: string
        recoveryPointRetentionInHours: 0
        recoveryVaultId: string
        replicationIntervalInSeconds: 0
    

    HyperVReplicationPolicy 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 HyperVReplicationPolicy resource accepts the following input properties:

    ApplicationConsistentSnapshotFrequencyInHours int
    Specifies the frequency at which to create application consistent recovery points.
    RecoveryPointRetentionInHours int
    The duration in hours for which the recovery points need to be stored.
    RecoveryVaultId string
    The id of the vault that should be updated. Changing this forces a new resource to be created.
    ReplicationIntervalInSeconds int
    Specifies how frequently data should be synchronized between source and target locations. Possible values are 30 and 300.
    Name string
    The name of the replication policy. Changing this forces a new resource to be created.
    ApplicationConsistentSnapshotFrequencyInHours int
    Specifies the frequency at which to create application consistent recovery points.
    RecoveryPointRetentionInHours int
    The duration in hours for which the recovery points need to be stored.
    RecoveryVaultId string
    The id of the vault that should be updated. Changing this forces a new resource to be created.
    ReplicationIntervalInSeconds int
    Specifies how frequently data should be synchronized between source and target locations. Possible values are 30 and 300.
    Name string
    The name of the replication policy. Changing this forces a new resource to be created.
    applicationConsistentSnapshotFrequencyInHours Integer
    Specifies the frequency at which to create application consistent recovery points.
    recoveryPointRetentionInHours Integer
    The duration in hours for which the recovery points need to be stored.
    recoveryVaultId String
    The id of the vault that should be updated. Changing this forces a new resource to be created.
    replicationIntervalInSeconds Integer
    Specifies how frequently data should be synchronized between source and target locations. Possible values are 30 and 300.
    name String
    The name of the replication policy. Changing this forces a new resource to be created.
    applicationConsistentSnapshotFrequencyInHours number
    Specifies the frequency at which to create application consistent recovery points.
    recoveryPointRetentionInHours number
    The duration in hours for which the recovery points need to be stored.
    recoveryVaultId string
    The id of the vault that should be updated. Changing this forces a new resource to be created.
    replicationIntervalInSeconds number
    Specifies how frequently data should be synchronized between source and target locations. Possible values are 30 and 300.
    name string
    The name of the replication policy. Changing this forces a new resource to be created.
    application_consistent_snapshot_frequency_in_hours int
    Specifies the frequency at which to create application consistent recovery points.
    recovery_point_retention_in_hours int
    The duration in hours for which the recovery points need to be stored.
    recovery_vault_id str
    The id of the vault that should be updated. Changing this forces a new resource to be created.
    replication_interval_in_seconds int
    Specifies how frequently data should be synchronized between source and target locations. Possible values are 30 and 300.
    name str
    The name of the replication policy. Changing this forces a new resource to be created.
    applicationConsistentSnapshotFrequencyInHours Number
    Specifies the frequency at which to create application consistent recovery points.
    recoveryPointRetentionInHours Number
    The duration in hours for which the recovery points need to be stored.
    recoveryVaultId String
    The id of the vault that should be updated. Changing this forces a new resource to be created.
    replicationIntervalInSeconds Number
    Specifies how frequently data should be synchronized between source and target locations. Possible values are 30 and 300.
    name String
    The name of the replication policy. Changing this forces a new resource to be created.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the HyperVReplicationPolicy 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 HyperVReplicationPolicy Resource

    Get an existing HyperVReplicationPolicy 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?: HyperVReplicationPolicyState, opts?: CustomResourceOptions): HyperVReplicationPolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            application_consistent_snapshot_frequency_in_hours: Optional[int] = None,
            name: Optional[str] = None,
            recovery_point_retention_in_hours: Optional[int] = None,
            recovery_vault_id: Optional[str] = None,
            replication_interval_in_seconds: Optional[int] = None) -> HyperVReplicationPolicy
    func GetHyperVReplicationPolicy(ctx *Context, name string, id IDInput, state *HyperVReplicationPolicyState, opts ...ResourceOption) (*HyperVReplicationPolicy, error)
    public static HyperVReplicationPolicy Get(string name, Input<string> id, HyperVReplicationPolicyState? state, CustomResourceOptions? opts = null)
    public static HyperVReplicationPolicy get(String name, Output<String> id, HyperVReplicationPolicyState 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.
    The following state arguments are supported:
    ApplicationConsistentSnapshotFrequencyInHours int
    Specifies the frequency at which to create application consistent recovery points.
    Name string
    The name of the replication policy. Changing this forces a new resource to be created.
    RecoveryPointRetentionInHours int
    The duration in hours for which the recovery points need to be stored.
    RecoveryVaultId string
    The id of the vault that should be updated. Changing this forces a new resource to be created.
    ReplicationIntervalInSeconds int
    Specifies how frequently data should be synchronized between source and target locations. Possible values are 30 and 300.
    ApplicationConsistentSnapshotFrequencyInHours int
    Specifies the frequency at which to create application consistent recovery points.
    Name string
    The name of the replication policy. Changing this forces a new resource to be created.
    RecoveryPointRetentionInHours int
    The duration in hours for which the recovery points need to be stored.
    RecoveryVaultId string
    The id of the vault that should be updated. Changing this forces a new resource to be created.
    ReplicationIntervalInSeconds int
    Specifies how frequently data should be synchronized between source and target locations. Possible values are 30 and 300.
    applicationConsistentSnapshotFrequencyInHours Integer
    Specifies the frequency at which to create application consistent recovery points.
    name String
    The name of the replication policy. Changing this forces a new resource to be created.
    recoveryPointRetentionInHours Integer
    The duration in hours for which the recovery points need to be stored.
    recoveryVaultId String
    The id of the vault that should be updated. Changing this forces a new resource to be created.
    replicationIntervalInSeconds Integer
    Specifies how frequently data should be synchronized between source and target locations. Possible values are 30 and 300.
    applicationConsistentSnapshotFrequencyInHours number
    Specifies the frequency at which to create application consistent recovery points.
    name string
    The name of the replication policy. Changing this forces a new resource to be created.
    recoveryPointRetentionInHours number
    The duration in hours for which the recovery points need to be stored.
    recoveryVaultId string
    The id of the vault that should be updated. Changing this forces a new resource to be created.
    replicationIntervalInSeconds number
    Specifies how frequently data should be synchronized between source and target locations. Possible values are 30 and 300.
    application_consistent_snapshot_frequency_in_hours int
    Specifies the frequency at which to create application consistent recovery points.
    name str
    The name of the replication policy. Changing this forces a new resource to be created.
    recovery_point_retention_in_hours int
    The duration in hours for which the recovery points need to be stored.
    recovery_vault_id str
    The id of the vault that should be updated. Changing this forces a new resource to be created.
    replication_interval_in_seconds int
    Specifies how frequently data should be synchronized between source and target locations. Possible values are 30 and 300.
    applicationConsistentSnapshotFrequencyInHours Number
    Specifies the frequency at which to create application consistent recovery points.
    name String
    The name of the replication policy. Changing this forces a new resource to be created.
    recoveryPointRetentionInHours Number
    The duration in hours for which the recovery points need to be stored.
    recoveryVaultId String
    The id of the vault that should be updated. Changing this forces a new resource to be created.
    replicationIntervalInSeconds Number
    Specifies how frequently data should be synchronized between source and target locations. Possible values are 30 and 300.

    Import

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

    $ pulumi import azure:siterecovery/hyperVReplicationPolicy:HyperVReplicationPolicy 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.

    Azure v6.10.0 published on Tuesday, Nov 19, 2024 by Pulumi