Azure Recovery Services Replicated Vm
This page shows how to write Terraform and Azure Resource Manager for Recovery Services Replicated Vm and write them securely.
azurerm_site_recovery_replicated_vm (Terraform)
The Replicated Vm in Recovery Services can be configured in Terraform with the resource name azurerm_site_recovery_replicated_vm
. The following sections describe 5 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "azurerm_site_recovery_replicated_vm" "this" {
managed_disk = var.managed_disk
name = var.name
recovery_replication_policy_id = var.recovery_replication_policy_id
recovery_vault_name = var.recovery_vault_name
resource_group_name = var.resource_group_name
resource "azurerm_site_recovery_replicated_vm" "this" {
managed_disk = var.managed_disk
name = var.name
recovery_replication_policy_id = var.recovery_replication_policy_id
recovery_vault_name = var.recovery_vault_name
resource_group_name = var.resource_group_name
resource "azurerm_site_recovery_replicated_vm" "vm-replication" {
for_each = { for vm in azurerm_virtual_machine.vm : vm.id => vm
if local.enable_recovery
}
name = format("%s-replication", each.value.name)
resource "azurerm_site_recovery_replicated_vm" "vm-replication" {
for_each = { for vm in azurerm_virtual_machine.vm : vm.id => vm
if local.enable_recovery
}
name = format("%s-replication", each.value.name)
resource "azurerm_site_recovery_replicated_vm" "vm-replication" {
name = var.replicated_vm_name
resource_group_name = var.rg_second_name
recovery_vault_name = azurerm_recovery_services_vault.vault.name
source_recovery_fabric_name = azurerm_site_recovery_fabric.primary.name
source_vm_id = var.source_vm_id
Parameters
-
id
optional computed - string -
managed_disk
optional - set of object-
disk_id
- string -
staging_storage_account_id
- string -
target_disk_type
- string -
target_replica_disk_type
- string -
target_resource_group_id
- string
-
-
name
required - string -
network_interface
optional computed - set of object-
recovery_public_ip_address_id
- string -
source_network_interface_id
- string -
target_static_ip
- string -
target_subnet_name
- string
-
-
recovery_replication_policy_id
required - string -
recovery_vault_name
required - string -
resource_group_name
required - string -
source_recovery_fabric_name
required - string -
source_recovery_protection_container_name
required - string -
source_vm_id
required - string -
target_availability_set_id
optional - string -
target_network_id
optional computed - string -
target_recovery_fabric_id
required - string -
target_recovery_protection_container_id
required - string -
target_resource_group_id
required - string -
timeouts
single block
Explanation in Terraform Registry
Manages a VM replicated using Azure Site Recovery (Azure to Azure only). A replicated VM keeps a copiously updated image of the VM in another region in order to be able to start the VM in that region in case of a disaster.
Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems (Azure Resource Manager)
The vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems in Microsoft.RecoveryServices can be configured in Azure Resource Manager with the resource name Microsoft.RecoveryServices/vaults/replicationFabrics/replicationProtectionContainers/replicationProtectedItems
. 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 Replicated Vm?
Azure Recovery Services Replicated Vm 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 Replicated Vm?
For Terraform, the niveklabs/azurerm, kevinhead/azurerm and rohrerb/terraform-eiac source code examples are useful. See the Terraform Example section for further details.