Skip to content

Instantly share code, notes, and snippets.

@spy86
Last active April 29, 2026 08:09
Show Gist options
  • Select an option

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

Select an option

Save spy86/fe9f2dcfac8b88ce8a5f6a67ad9e7561 to your computer and use it in GitHub Desktop.
variable "rg_count" {
type = number
default = 2
}
resource "azurerm_resource_group" "rg_multi" {
count = var.rg_count
name = "rg-${local.name_prefix}-${count.index}"
location = var.location
tags = local.common_tags
}
output "rg_names_v1" {
value = [for rg in azurerm_resource_group.rg_multi : rg.name]
}
output "rg_names_v2" {
value = azurerm_resource_group.rg_multi[*].name
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment