Azure multi-region best practice

I’m using Terraform to deploy Azure resources and now want to deploy across multiple regions.

I’m finding even with Modules I’m repeating code, once for each region.

How should I be writing code for multi region? I can’t find any best practices

1 Like

I had a similar scenario when I wanted to create a set of NSG that I could update all at once when my ISP changed my IP Address. You need an NSG in each region you use one and usually they all use the same rule set. Updating n number of NSG every 3 monmths was a pain.

I ended up using maps of my settings and iterated over them with for_each. Maybe you could adapt the method for use case? I used a simple list because the parameters were simple lists. You might to use the more complex list(object({}) construct.

https://github.com/kvietmeier/Terraform/tree/master/azure/CoreInfra/nsg