Skip to content

Instantly share code, notes, and snippets.

@rohrerb
Created August 7, 2019 13:19
Show Gist options
  • Save rohrerb/4490f3a63baab12fa6f428646128260e to your computer and use it in GitHub Desktop.
Save rohrerb/4490f3a63baab12fa6f428646128260e to your computer and use it in GitHub Desktop.
Simple resource group module.
module "rgs" {
source = "./modules/resource_group"
names = ["rg-0","rg-1","rg-2"]
azure_location = "eastus"
}
variable "names" {
description = "List of resource groups to create"
type = "list"
}
variable "azure_location" {
description = "Location in which to deploy resources"
}
resource "azurerm_resource_group" "rg" {
count = "${length(var.names)}"
name = "${var.names[count.index]}"
location = "${var.azure_location}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment