Azure Recovery Services Protection Container
This page shows how to write Terraform and Azure Resource Manager for Recovery Services Protection Container and write them securely.
azurerm_site_recovery_protection_container (Terraform)
The Protection Container in Recovery Services can be configured in Terraform with the resource name azurerm_site_recovery_protection_container
. The following sections describe 10 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "azurerm_site_recovery_protection_container" "primary" {
name = "primary-protection-container"
resource_group_name = var.secondary_resource_group_name
recovery_vault_name = var.vault_name
recovery_fabric_name = azurerm_site_recovery_fabric.primary.name
}
resource "azurerm_site_recovery_protection_container" "primary" {
count = signum(var.create ? 1 : 0)
name = "primary-protection-container"
resource_group_name = var.resource_group_name
recovery_vault_name = azurerm_recovery_services_vault.vault.*.name[0]
recovery_fabric_name = azurerm_site_recovery_fabric.primary.*.name[0]
resource "azurerm_site_recovery_protection_container" "primary" {
count = signum(var.create ? 1 : 0)
name = "primary-protection-container"
resource_group_name = var.resource_group_name
recovery_vault_name = azurerm_recovery_services_vault.vault.*.name[0]
recovery_fabric_name = azurerm_site_recovery_fabric.primary.*.name[0]
resource "azurerm_site_recovery_protection_container" "this" {
name = var.name
recovery_fabric_name = var.recovery_fabric_name
recovery_vault_name = var.recovery_vault_name
resource_group_name = var.resource_group_name
resource "azurerm_site_recovery_protection_container" "this" {
name = var.name
recovery_fabric_name = var.recovery_fabric_name
recovery_vault_name = var.recovery_vault_name
resource_group_name = var.resource_group_name
resource "azurerm_site_recovery_protection_container" "protection_container" {
for_each = try(var.settings.protection_containers, {})
name = each.value.name
resource_group_name = var.resource_group_name
recovery_vault_name = azurerm_recovery_services_vault.asr.name
resource "azurerm_site_recovery_protection_container" "protection_container" {
depends_on = [azurerm_recovery_services_vault.asr, azurerm_site_recovery_fabric.recovery_fabric]
# depends_on = [time_sleep.delay_create]
for_each = try(var.settings.protection_containers, {})
name = each.value.name
resource "azurerm_site_recovery_protection_container" "protection_container" {
for_each = try(var.settings.protection_containers, {})
name = each.value.name
resource_group_name = var.resource_group_name
recovery_vault_name = azurerm_recovery_services_vault.asr.name
resource "azurerm_site_recovery_protection_container" "protection_container" {
depends_on = [azurerm_recovery_services_vault.asr, azurerm_site_recovery_fabric.recovery_fabric]
# depends_on = [time_sleep.delay_create]
for_each = try(var.settings.protection_containers, {})
name = each.value.name
resource "azurerm_site_recovery_protection_container" "protection_container" {
for_each = try(var.settings.protection_containers, {})
name = each.value.name
resource_group_name = var.resource_group_name
recovery_vault_name = azurerm_recovery_services_vault.asr.name
Parameters
-
id
optional computed - string -
name
required - string -
recovery_fabric_name
required - string -
recovery_vault_name
required - string -
resource_group_name
required - string -
timeouts
single block
Explanation in Terraform Registry
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.
Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers (Azure Resource Manager)
The vaults/replicationFabrics/replicationProtectionContainers in Microsoft.RecoveryServices can be configured in Azure Resource Manager with the resource name Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers
. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Frequently asked questions
What is Azure Recovery Services Protection Container?
Azure Recovery Services Protection Container is a resource for Recovery Services of Microsoft Azure. Settings can be wrote in Terraform.
Where can I find the example code for the Azure Recovery Services Protection Container?
For Terraform, the adamdost-msft/azure-cloud-ops, rohrerb/terraform-eiac and tmeadon/clippings source code examples are useful. See the Terraform Example section for further details.