Skip to content

azurermSiteRecoveryHypervReplicationPolicy

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

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
  this,
  "example",
  {
    location: "East US",
    name: "example-rg",
  }
);
const azurermRecoveryServicesVaultVault =
  new azurerm.recoveryServicesVault.RecoveryServicesVault(this, "vault", {
    location: azurermResourceGroupExample.location,
    name: "example-recovery-vault",
    resource_group_name: azurermResourceGroupExample.name,
    sku: "Standard",
  });
new azurerm.siteRecoveryHypervReplicationPolicy.SiteRecoveryHypervReplicationPolicy(
  this,
  "policy",
  {
    application_consistent_snapshot_frequency_in_hours: 1,
    name: "policy",
    recovery_point_retention_in_hours: 2,
    recovery_vault_name: azurermRecoveryServicesVaultVault.name,
    replication_interval_in_seconds: 300,
    resource_group_name: azurermResourceGroupExample.name,
  }
);

Argument Reference

The following arguments are supported:

  • name - (Required) The name of the replication policy. Changing this forces a new resource to be created.

  • resourceGroupName - (Required) Name of the resource group where the vault that should be updated is located. Changing this forces a new resource to be created.

  • recoveryVaultName - (Required) The name of the vault that should be updated. Changing this forces a new resource to be created.

  • recoveryPointRetentionInHours - (Required) The duration in hours for which the recovery points need to be stored.

  • applicationConsistentSnapshotFrequencyInHours - (Required) Specifies the frequency at which to create application consistent recovery points.

  • replicationIntervalInSeconds - (Required) Specifies how frequently data should be synchronized between source and target locations. Possible values are 30 and 300.

Attributes Reference

In addition to the arguments above, the following attributes are exported:

  • id - The ID of the Site Recovery Replication Policy.

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • create - (Defaults to 30 minutes) Used when creating the Site Recovery Replication Policy.
  • update - (Defaults to 30 minutes) Used when updating the Site Recovery Replication Policy.
  • read - (Defaults to 5 minutes) Used when retrieving the Site Recovery Replication Policy.
  • delete - (Defaults to 30 minutes) Used when deleting the Site Recovery Replication Policy.

Import

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

terraform import azurerm_site_recovery_hyperv_replication_policy.mypolicy /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resource-group-name/providers/Microsoft.RecoveryServices/vaults/recovery-vault-name/replicationPolicies/policy-name