Azure/Mission-Critical-Online

Multiple stamps per region

DavidDury opened this issue · 4 comments

In the documentation is mentioned the following: A stamp is a regional deployment and can also be considered as a scale-unit. For now we only always deploy one stamp in an Azure Region but this can be extended to allow multiple stamps per region if required.

How can this be achieved?

A couple of things would need to be changed:

  • The resource names are usually constructed with {prefix}-{location (i.e. Azure Region name)}-{resourceName}, e.g. here
  • The stamps are deployed by iterating through a list of regions which are passed into Terraform using the stamps variable. This logic would need to be changed as well. You could, for example, pass somthing like ["uksouth_1", "uksouth_2"], into terraform and then deconstruct it there into regionName-ZoneName

Please bear with me, I am fairly new to Terraform, just to make sure I understood I will need to pass also the AZ as variables and in a loop when deployment is done, construct the resource group to include the AZ variable and in such way will become one stamp per resource group ?

If I totally messed it, please share some code will be highly appreciated.

Not only the resource group name needs to be changed, also the resource names themselves. The link to the RG definition was just on example. In the same src folder you find, for example, the Terraform templates for AKS, Key Vault etc. All of these need to be changed in order to make sure they are unique.
In terms of the zones: At least in our reference implementation the only zonal service is AKS. I.e. there you can specify which zone(s) the node pools should be deployed into. All other PaaS services are zone-redundant anyway. So you dont have to specify explicitly which zone to deploy them to.

It's not a single piece of code that I could share on this. It's not a super hard task, but it will require a solid understanding on your part how the terraform infra is laid out here. Which is actually not very specific to Terraform. Would this be done in ARM/Bicep, the very same challenge would be there. Its about making sure all your resources names within one stamp dont overlap with another stamp.

Thank you, appreciated!