Azure / Azure-Verified-Modules

Azure Verified Modules (AVM) is an initiative to consolidate and set the standards for what a good Infrastructure-as-Code module looks like. Modules will then align to these standards, across languages (Bicep, Terraform etc.) and will then be classified as AVMs and available from their respective language specific registries.
https://aka.ms/AVM
MIT License
335 stars 73 forks source link

[Module Proposal]: `avm-ptn-bcdr-vm-replication` #843

Open FreddyAyala opened 5 months ago

FreddyAyala commented 5 months ago

Check for previous/existing GitHub issues/module proposals

Check this module doesn't already exist in the module indexes

Bicep or Terraform?

Terraform

Module Classification?

Pattern Module

Module Name

avm-ptn-bcdr-vm-replication

Module Details

Azure Site Recovery VM Replication Module Description

The avm-ptn-bcdr-vm-replication module is designed to simplify the deployment and configuration of Virtual Machine replication using Azure Site Recovery Services (ASR) within Azure. It abstracts the complexity involved in setting up a disaster recovery scenario by managing all necessary resources to replicate a VM from one Azure region to another, ensuring that in case of a regional outage, your VM can be quickly recovered in the secondary location.

Module Functionality

Here's a high-level overview of what this module will manage:

  1. Resource Groups: Create or reference existing resource groups in primary and secondary regions to host the ASR infrastructure and replicated VMs.
  2. Virtual Network: Define or reference existing virtual networks in both primary and secondary sites with their respective subnets for consistent networking.
  3. Storage Accounts: Provision or reference storage accounts required for replication caching and other ASR operations.
  4. Virtual Machines: Reference and configure the primary Virtual Machine which needs to be replicated.
  5. Recovery Services Vault: Create a Recovery Services Vault in the secondary region to manage and orchestrate replication and failover activities.
  6. Site Recovery Fabrics: Set up primary and secondary ASR fabrics which are logical containers representing each site.
  7. Protection Containers: Create or configure protection containers within fabrics which group together VMs for replication.
  8. Replication Policy: Define replication policy settings such as frequency of replication and retention of recovery points.
  9. Network Mapping: Manage the mapping of virtual networks between primary and secondary sites to ensure connectivity after failover.
  10. Replication: Handle the replication of the specified VMs from the primary to the secondary site based on the defined replication policy.
  11. Optional Configuration: Customize additional replication settings such as Target Availability Set, Proximity Placement Group, and encryption settings if required.

Example Module Usage

Usage of this module could resemble the following:

hcl

module "avm-ptn-bcdr-vm-replication" {
 source  = "path/to/module/avm-ptn-bcdr-vm-replication"
 // Required variables
 primary_location             = "West US"
 secondary_location           = "East US"
primary_vm_id                = azurerm_virtual_machine.vm.id
primary_network_interface_id = azurerm_network_interface.vm.id
// Optional variables with their defaults
replication_policy_name       = "default-replication-policy"
recovery_vault_sku            = "Standard"
target_disk_type              = "Premium_LRS"
failover_network_mappings = {
primary_subnet_id   = azurerm_subnet.primary.id
secondary_subnet_id = azurerm_subnet.secondary.id17  }
 // ... more configurations
}

Argument Reference

The following arguments are supported:

Do you want to be the owner of this module?

Yes

Module Owner's GitHub Username (handle)

FreddyAyala

(Optional) Secondary Module Owner's GitHub Username (handle)

No response

FreddyAyala commented 5 months ago

@mbilalamjad Really appreciate any feedback, thanks.

prjelesi commented 5 months ago

Hi @FreddyAyala

Thanks for requesting/proposing to be an AVM module owner!

We just want to confirm you agree to the below pages that define what module ownership means:

Any questions or clarifications needed, let us know!

If you agree, please just reply to this issue with the exact sentence below (as this helps with our automation 👍):

"I CONFIRM I WISH TO OWN THIS AVM MODULE AND UNDERSTAND THE REQUIREMENTS AND DEFINITION OF A MODULE OWNER"

Thanks,

The AVM Core Team

RR

FreddyAyala commented 5 months ago

Hi @FreddyAyala

Thanks for requesting/proposing to be an AVM module owner!

We just want to confirm you agree to the below pages that define what module ownership means:

Any questions or clarifications needed, let us know!

If you agree, please just reply to this issue with the exact sentence below (as this helps with our automation 👍):

"I CONFIRM I WISH TO OWN THIS AVM MODULE AND UNDERSTAND THE REQUIREMENTS AND DEFINITION OF A MODULE OWNER"

Thanks,

The AVM Core Team

RR

I CONFIRM I WISH TO OWN THIS AVM MODULE AND UNDERSTAND THE REQUIREMENTS AND DEFINITION OF A MODULE OWNER

microsoft-github-policy-service[bot] commented 5 months ago

[!NOTE] The "Needs: Author Feedback :ear:" label was removed and the "Needs: Attention :wave:" label was added as per ITA11.

FreddyAyala commented 5 months ago

Thanks @prjelesi, the module has been created, with the code ready as a prerelease: https://github.com/Azure/terraform-azurerm-avm-ptn-bcdr-vm-replication awaiting for telemetry id or any other information needed.

prjelesi commented 5 months ago

Hi @FreddyAyala will update tomorrow.

prjelesi commented 5 months ago

Hi @FreddyAyala

Thanks for confirming that you wish to own this AVM module and understand the related requirements and responsibilities!

Before starting development, please ensure ALL the following requirements are met.

Please use the following values explicitly as provided in the module index page:

Check if this module exists in the other IaC language. If so, collaborate with the other owner for consistency. 👍

You can now start the development of this module! ✅ Happy coding! 🎉

Please respond to this comment and request a review from the AVM core team once your module is ready to be published! Please include a link pointing to your PR, once available. 🙏

Any further questions or clarifications needed, let us know!

Thanks,

The AVM Core Team

microsoft-github-policy-service[bot] commented 4 months ago

[!IMPORTANT] @FreddyAyala, this issue has not had any activity in the last 3 weeks. Please feel free to reach out to the AVM core team should you have any questions or need any help with the development of this module.

[!TIP] To silence this notification, provide an update every 3 weeks on the Module Proposal issue, or add the "Status: Long Term :hourglass_flowing_sand:" label.

[!NOTE] This message was posted as per ITA24.

microsoft-github-policy-service[bot] commented 3 months ago

[!IMPORTANT] @FreddyAyala, this issue has not had any activity in the last 3 weeks. Please feel free to reach out to the AVM core team should you have any questions or need any help with the development of this module.

[!TIP] To silence this notification, provide an update every 3 weeks on the Module Proposal issue, or add the "Status: Long Term :hourglass_flowing_sand:" label.

microsoft-github-policy-service[bot] commented 3 months ago

[!IMPORTANT] @FreddyAyala, this issue has not had any activity in the last 3 weeks. Please feel free to reach out to the AVM core team should you have any questions or need any help with the development of this module.

[!TIP] To silence this notification, provide an update every 3 weeks on the Module Proposal issue, or add the "Status: Long Term :hourglass_flowing_sand:" label.

microsoft-github-policy-service[bot] commented 2 months ago

[!IMPORTANT] @FreddyAyala, this issue has not had any activity in the last 3 weeks. Please feel free to reach out to the AVM core team should you have any questions or need any help with the development of this module.

[!TIP] To silence this notification, provide an update every 3 weeks on the Module Proposal issue, or add the "Status: Long Term :hourglass_flowing_sand:" label.

microsoft-github-policy-service[bot] commented 1 month ago

[!IMPORTANT] @FreddyAyala, this issue has not had any activity in the last 3 weeks. Please feel free to reach out to the AVM core team should you have any questions or need any help with the development of this module.

[!TIP] To silence this notification, provide an update every 3 weeks on the Module Proposal issue, or add the "Status: Long Term :hourglass_flowing_sand:" label.

microsoft-github-policy-service[bot] commented 1 month ago

[!IMPORTANT] @FreddyAyala, this issue has not had any activity in the last 3 weeks. Please feel free to reach out to the AVM core team should you have any questions or need any help with the development of this module.

[!TIP] To silence this notification, provide an update every 3 weeks on the Module Proposal issue, or add the "Status: Long Term :hourglass_flowing_sand:" label.

microsoft-github-policy-service[bot] commented 1 week ago

[!IMPORTANT] @FreddyAyala, this issue has not had any activity in the last 3 weeks. Please feel free to reach out to the AVM core team should you have any questions or need any help with the development of this module.

[!TIP] To silence this notification, provide an update every 3 weeks on the Module Proposal issue, or add the "Status: Long Term :hourglass_flowing_sand:" label.