azurerm_site_recovery_hyperv_replication_policy_association

Manages an Azure Site Recovery replication policy for HyperV within a Recovery Vault.

Example Usage

resource "azurerm_resource_group" "example" {
  name     = "example-rg"
  location = "East US"
}

resource "azurerm_recovery_services_vault" "example" {
  name                = "example-recovery-vault"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  sku                 = "Standard"
}

resource "azurerm_site_recovery_services_vault_hyperv_site" "example" {
  recovery_vault_id = azurerm_recovery_services_vault.example.id
  name              = "example-site"
}

resource "azurerm_site_recovery_hyperv_replication_policy" "example" {
  name                                               = "policy"
  recovery_vault_id                                  = azurerm_recovery_services_vault.example.id
  recovery_point_retention_in_hours                  = 2
  application_consistent_snapshot_frequency_in_hours = 1
  replication_interval_in_seconds                    = 300
}

resource "azurerm_site_recovery_hyperv_replication_policy_association" "example" {
  name           = "example-association"
  hyperv_site_id = azurerm_site_recovery_services_vault_hyperv_site.example.id
  policy_id      = azurerm_site_recovery_hyperv_replication_policy.example.id
}

Argument Reference

The following arguments are supported:

Attributes Reference

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

Timeouts

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

Import

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

terraform import  azurerm_site_recovery_hyperv_replication_policy_association.mypolicy /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resource-group-name/providers/Microsoft.RecoveryServices/vaults/recovery-vault-name/replicationFabrics/site-name/replicationProtectionContainers/container-name/replicationProtectionContainerMappings/mapping-name