Manages a Azure Site Recovery protection container. Protection containers serve as containers for replicated VMs and belong to a single region / recovery fabric. Protection containers can contain more than one replicated VM. To replicate a VM, a container must exist in both the source and target Azure regions.
resource "azurerm_resource_group" "primary" {
name = "tfex-network-mapping-primary"
location = "West US"
}
resource "azurerm_resource_group" "secondary" {
name = "tfex-network-mapping-secondary"
location = "East US"
}
resource "azurerm_recovery_services_vault" "vault" {
name = "example-recovery-vault"
location = azurerm_resource_group.secondary.location
resource_group_name = azurerm_resource_group.secondary.name
sku = "Standard"
}
resource "azurerm_site_recovery_fabric" "fabric" {
name = "primary-fabric"
resource_group_name = azurerm_resource_group.secondary.name
recovery_vault_name = azurerm_recovery_services_vault.vault.name
location = azurerm_resource_group.primary.location
}
resource "azurerm_site_recovery_protection_container" "protection-container" {
name = "protection-container"
resource_group_name = azurerm_resource_group.secondary.name
recovery_vault_name = azurerm_recovery_services_vault.vault.name
recovery_fabric_name = azurerm_site_recovery_fabric.fabric.name
}
The following arguments are supported:
name
- (Required) The name of the protection container. Changing this forces a new resource to be created.
resource_group_name
- (Required) Name of the resource group where the vault that should be updated is located. Changing this forces a new resource to be created.
recovery_vault_name
- (Required) The name of the vault that should be updated. Changing this forces a new resource to be created.
recovery_fabric_name
- (Required) Name of fabric that should contain this protection container. Changing this forces a new resource to be created.
In addition to the arguments above, the following attributes are exported:
id
- The ID of the Site Recovery Protection Container.The timeouts
block allows you to specify timeouts for certain actions:
create
- (Defaults to 30 minutes) Used when creating the Site Recovery Protection Container.read
- (Defaults to 5 minutes) Used when retrieving the Site Recovery Protection Container.delete
- (Defaults to 30 minutes) Used when deleting the Site Recovery Protection Container.Site Recovery Protection Containers can be imported using the resource id
, e.g.
terraform import azurerm_site_recovery_protection_container.mycontainer /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resource-group-name/providers/Microsoft.RecoveryServices/vaults/recovery-vault-name/replicationFabrics/fabric-name/replicationProtectionContainers/protection-container-name