Skip to content

Instantly share code, notes, and snippets.

@spy86
Created April 29, 2026 08:33
Show Gist options
  • Select an option

  • Save spy86/c9b51eb9bbb2bac391c5d265e90afca3 to your computer and use it in GitHub Desktop.

Select an option

Save spy86/c9b51eb9bbb2bac391c5d265e90afca3 to your computer and use it in GitHub Desktop.
variable "envs" {
type = map(object({
location = string
}))
default = {
dev = { location = "westeurope" }
staging = { location = "westeurope" }
}
}
resource "azurerm_resource_group" "rg_env" {
for_each = var.envs
name = "rg-${var.project}-${each.key}"
location = each.value.location
tags = merge(local.common_tags, { env_key = each.key })
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment