Author: Harsh Pardhi
Version: v1.1
Date: 27/05/2026
Multi-tier Azure infrastructure across Central India and South India regions with web, app, and database layers.
- 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
az login
az account set --subscription <sub-id>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 tfstate12345cp terraform.tfvars.example terraform.tfvars
# Edit terraform.tfvars with your SSH key and DB passwordterraform init
terraform plan
terraform apply.
βββ 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
rg_name: Resource group name (default: prod-rg)primary_region: Central Indiasecondary_region: South Indiassh_key: SSH public key for VM accessdb_password: SQL admin password
- Application: Traffic Manager FQDN
- Database: SQL Server FQDN from outputs
- VMs: SSH with provided key
terraform destroy- 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