Azure Recovery Services Fabric

This page shows how to write Terraform and Azure Resource Manager for Recovery Services Fabric and write them securely.

azurerm_site_recovery_fabric (Terraform)

The Fabric in Recovery Services can be configured in Terraform with the resource name azurerm_site_recovery_fabric. The following sections describe 10 examples of how to use the resource and its parameters.

Example Usage from GitHub

main.tf#L1
resource "azurerm_site_recovery_fabric" "primary" {
  name                = "primary-fabric"
  resource_group_name = var.secondary_resource_group_name
  recovery_vault_name = var.vault_name
  location            = var.primary_location
}
main.tf#L14
resource "azurerm_site_recovery_fabric" "primary" {
  count = signum(var.create ? 1 : 0)

  name                = "primary-fabric"
  resource_group_name = var.resource_group_name
  recovery_vault_name = azurerm_recovery_services_vault.vault.*.name[0]
main.tf#L14
resource "azurerm_site_recovery_fabric" "primary" {
  count = signum(var.create ? 1 : 0)

  name                = "primary-fabric"
  resource_group_name = var.resource_group_name
  recovery_vault_name = azurerm_recovery_services_vault.vault.*.name[0]
main.tf#L7
resource "azurerm_site_recovery_fabric" "this" {
  location            = var.location
  name                = var.name
  recovery_vault_name = var.recovery_vault_name
  resource_group_name = var.resource_group_name

azure_recovery_fabric.tf#L1
resource "azurerm_site_recovery_fabric" "recovery_fabric" {
  depends_on = [azurerm_recovery_services_vault.asr, time_sleep.delay_create]
  for_each   = try(var.settings.recovery_fabrics, {})

  name                = each.value.name
  resource_group_name = var.resource_group_name
main.tf#L7
resource "azurerm_site_recovery_fabric" "this" {
  location            = var.location
  name                = var.name
  recovery_vault_name = var.recovery_vault_name
  resource_group_name = var.resource_group_name

azure_recovery_fabric.tf#L4
resource "azurerm_site_recovery_fabric" "recovery_fabric" {
  depends_on = [time_sleep.delay_create]
  for_each   = try(var.settings.recovery_fabrics, {})

  name                = each.value.name
  resource_group_name = var.resource_group_name
azure_recovery_fabric.tf#L1
resource "azurerm_site_recovery_fabric" "recovery_fabric" {
  depends_on = [azurerm_recovery_services_vault.asr, time_sleep.delay_create]
  for_each   = try(var.settings.recovery_fabrics, {})

  name                = each.value.name
  resource_group_name = var.resource_group_name
azure_recovery_fabric.tf#L4
resource "azurerm_site_recovery_fabric" "recovery_fabric" {
  depends_on = [time_sleep.delay_create]
  for_each   = try(var.settings.recovery_fabrics, {})

  name                = each.value.name
  resource_group_name = var.resource_group_name
azure_recovery_fabric.tf#L4
resource "azurerm_site_recovery_fabric" "recovery_fabric" {
  depends_on = [time_sleep.delay_create]
  for_each   = try(var.settings.recovery_fabrics, {})

  name                = each.value.name
  resource_group_name = var.resource_group_name

Review your Terraform file for Azure best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Manages a Azure Site Recovery Replication Fabric within a Recovery Services vault. Only Azure fabrics are supported at this time. Replication Fabrics serve as a container within an Azure region for other Site Recovery resources such as protection containers, protected items, network mappings.

Microsoft.RecoveryServices/vaults/replicationFabrics (Azure Resource Manager)

The vaults/replicationFabrics in Microsoft.RecoveryServices can be configured in Azure Resource Manager with the resource name Microsoft.RecoveryServices/vaults/replicationFabrics. 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 Fabric?

Azure Recovery Services Fabric 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 Fabric?

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.