This module adds a parameter with all Azure regions, allowing developers to select the region closest to them.
1module "azure_region" { 2 source = "registry.coder.com/modules/azure-region/coder" 3 version = "1.0.12" 4 default = "eastus" 5} 6 7resource "azurem_resource_group" "example" { 8 location = module.azure_region.value 9}
Change the display name and icon for a region using the corresponding maps:
1module "azure-region" { 2 source = "registry.coder.com/modules/azure-region/coder" 3 version = "1.0.12" 4 custom_names = { 5 "australia" : "Go Australia!" 6 } 7 custom_icons = { 8 "australia" : "/icons/smiley.svg" 9 } 10} 11 12resource "azurerm_resource_group" "example" { 13 location = module.azure_region.value 14}
Hide all regions in Australia except australiacentral:
1module "azure-region" { 2 source = "registry.coder.com/modules/azure-region/coder" 3 version = "1.0.12" 4 exclude = [ 5 "australia", 6 "australiacentral2", 7 "australiaeast", 8 "australiasoutheast" 9 ] 10} 11 12resource "azurerm_resource_group" "example" { 13 location = module.azure_region.value 14}
For a complete Azure template, see the following examples in the Coder Registry.