Skip to content

HP04Harsh/azure-multi-region-dr-terraform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

image

Multi-Region Azure Infrastructure

Author: Harsh Pardhi
Version: v1.1
Date: 27/05/2026

Overview

Multi-tier Azure infrastructure across Central India and South India regions with web, app, and database layers.

Architecture

  • 2 Regions: Central India, South India
  • 3 Tiers: Web (VM Scale Sets), App (VM Scale Sets), Database (Azure SQL)
  • Networking: VNet peering, NSGs, NAT Gateway, Load Balancer, Traffic Manager

Quick Start

1. Setup Azure

az login
az account set --subscription <sub-id>

2. Create Backend Storage

az group create --name tfstate-rg --location centralindia
az storage account create --name tfstate12345 --resource-group tfstate-rg --location centralindia --sku Standard_LRS --kind StorageV2
az storage container create --name tfstate --account-name tfstate12345

3. Configure Variables

cp terraform.tfvars.example terraform.tfvars
# Edit terraform.tfvars with your SSH key and DB password

4. Deploy

terraform init
terraform plan
terraform apply

Files

.
β”œβ”€β”€ main.tf              # Main config
β”œβ”€β”€ variables.tf         # Variables
β”œβ”€β”€ outputs.tf           # Outputs
β”œβ”€β”€ backend.tf           # Remote state
β”œβ”€β”€ terraform.tfvars.example
└── modules/
    β”œβ”€β”€ network/         # VNet, subnets, NSGs
    β”œβ”€β”€ compute/         # VM Scale Sets
    β”œβ”€β”€ database/        # Azure SQL
    β”œβ”€β”€ nat/             # NAT Gateway
    └── lb/              # Load Balancer, Traffic Manager

Key Variables

  • rg_name: Resource group name (default: prod-rg)
  • primary_region: Central India
  • secondary_region: South India
  • ssh_key: SSH public key for VM access
  • db_password: SQL admin password

Access

  • Application: Traffic Manager FQDN
  • Database: SQL Server FQDN from outputs
  • VMs: SSH with provided key

Cleanup

terraform destroy

What It Creates

  • 2 Virtual Networks with peering
  • 4 VM Scale Sets (web + app in both regions)
  • 2 Azure SQL databases with geo-replication
  • 2 NAT Gateways for outbound internet
  • 2 Load Balancers + Traffic Manager
  • All required networking and security components

About

πŸš€ Production-ready, multi-region Azure infrastructure with active-passive Disaster Recovery (DR) deployed via Terraform. Features Traffic Manager routing, automatic VM Scale Sets, and geo-replicated Azure SQL across Central & South India.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages