Azure Recovery Services Protection Container Mapping
This page shows how to write Terraform and Azure Resource Manager for Recovery Services Protection Container Mapping and write them securely.
azurerm_site_recovery_protection_container_mapping (Terraform)
The Protection Container Mapping in Recovery Services can be configured in Terraform with the resource name azurerm_site_recovery_protection_container_mapping. 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_mapping" "this" {
name = var.name
recovery_fabric_name = var.recovery_fabric_name
recovery_replication_policy_id = var.recovery_replication_policy_id
recovery_source_protection_container_name = var.recovery_source_protection_container_name
recovery_target_protection_container_id = var.recovery_target_protection_container_id
resource "azurerm_site_recovery_protection_container_mapping" "this" {
name = var.name
recovery_fabric_name = var.recovery_fabric_name
recovery_replication_policy_id = var.recovery_replication_policy_id
recovery_source_protection_container_name = var.recovery_source_protection_container_name
recovery_target_protection_container_id = var.recovery_target_protection_container_id
resource "azurerm_site_recovery_protection_container_mapping" "container-mapping" {
for_each = try(var.settings.protection_container_mapping, {})
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_mapping" "container-mapping" {
depends_on = [azurerm_recovery_services_vault.asr, azurerm_site_recovery_fabric.recovery_fabric]
for_each = try(var.settings.protection_container_mapping, {})
name = each.value.name
resource_group_name = var.resource_group_name
resource "azurerm_site_recovery_protection_container_mapping" "container-mapping" {
for_each = try(var.settings.protection_container_mapping, {})
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_mapping" "container-mapping" {
depends_on = [azurerm_recovery_services_vault.asr, azurerm_site_recovery_fabric.recovery_fabric]
for_each = try(var.settings.protection_container_mapping, {})
name = each.value.name
resource_group_name = var.resource_group_name
resource "azurerm_site_recovery_protection_container_mapping" "container-mapping" {
for_each = try(var.settings.protection_container_mapping, {})
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_mapping" "container-mapping" {
count = signum(var.create ? 1 : 0)
name = "container-mapping"
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_mapping" "container-mapping" {
name = "container-mapping"
resource_group_name = var.secondary_resource_group_name
recovery_vault_name = var.vault_name
recovery_fabric_name = azurerm_site_recovery_fabric.primary.name
recovery_source_protection_container_name = azurerm_site_recovery_protection_container.primary.name
resource "azurerm_site_recovery_protection_container_mapping" "container-mapping" {
count = signum(var.create ? 1 : 0)
name = "container-mapping"
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]
Parameters
-
idoptional computed - string -
namerequired - string -
recovery_fabric_namerequired - string -
recovery_replication_policy_idrequired - string -
recovery_source_protection_container_namerequired - string -
recovery_target_protection_container_idrequired - string -
recovery_vault_namerequired - string -
resource_group_namerequired - string -
timeoutssingle block
Explanation in Terraform Registry
Manages a Azure recovery vault protection container mapping. A protection container mapping decides how to translate the protection container when a VM is migrated from one region to another.
Microsoft.RecoveryServices/vaults (Azure Resource Manager)
The vaults in Microsoft.RecoveryServices can be configured in Azure Resource Manager with the resource name Microsoft.RecoveryServices/vaults. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"recoveryServicesName": {
{
"contentVersion": "1.0.0.0",
"parameters": {
"workbookDisplayName": {
"type": "string",
{
"contentVersion": "1.0.0.0",
"parameters": {
"workbookDisplayName": {
"type": "string",
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"workbookName": {
{
"contentVersion": "1.0.0.0",
"parameters": {
"workbookDisplayName": {
"type": "string",
{
"contentVersion": "1.0.0.0",
"parameters": {
"workbookDisplayName": {
"type": "string",
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"logicAppName": {
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"logicAppName": {
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"logicAppName": {
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"logicAppName": {
Parameters
apiVersionrequired - stringetagoptional - stringOptional ETag.
identityoptionaltyperequired - stringThe type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user-assigned identities. The type 'None' will remove any identities.
userAssignedIdentitiesoptional - undefinedThe list of user-assigned identities associated with the resource. The user-assigned identity dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
locationrequired - stringResource location.
namerequired - stringThe name of the recovery services vault.
propertiesrequiredencryptionoptionalinfrastructureEncryptionoptional - stringEnabling/Disabling the Double Encryption state.
kekIdentityoptionaluserAssignedIdentityoptional - stringThe user assigned identity to be used to grant permissions in case the type of identity used is UserAssigned
useSystemAssignedIdentityoptional - booleanIndicate that system assigned identity should be used. Mutually exclusive with 'userAssignedIdentity' field
keyVaultPropertiesoptionalkeyUrioptional - stringThe key uri of the Customer Managed Key
moveDetailsoptionalupgradeDetailsoptional
skuoptionalcapacityoptional - stringThe sku capacity
familyoptional - stringThe sku family
namerequired - stringThe Sku name.
sizeoptional - stringThe sku size
tieroptional - stringThe Sku tier.
systemDataoptionalcreatedAtoptional - stringThe timestamp of resource creation (UTC).
createdByoptional - stringThe identity that created the resource.
createdByTypeoptional - stringThe type of identity that created the resource.
lastModifiedAtoptional - stringThe type of identity that last modified the resource.
lastModifiedByoptional - stringThe identity that last modified the resource.
lastModifiedByTypeoptional - stringThe type of identity that last modified the resource.
tagsoptional - stringResource tags.
typerequired - string
Frequently asked questions
What is Azure Recovery Services Protection Container Mapping?
Azure Recovery Services Protection Container Mapping 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 Mapping?
For Terraform, the kevinhead/azurerm, niveklabs/azurerm and pkhuntia/aztfmod source code examples are useful. See the Terraform Example section for further details.
For Azure Resource Manager, the bwren/bwren, HasanIftakher/Azure-Monitor and tulpy/Azure source code examples are useful. See the Azure Resource Manager Example section for further details.