Skip to content

Instantly share code, notes, and snippets.

@kevincloud
Created June 26, 2020 19:56
Show Gist options
  • Save kevincloud/d4405d27ae956ea15e8bd3a85b8a4083 to your computer and use it in GitHub Desktop.
Save kevincloud/d4405d27ae956ea15e8bd3a85b8a4083 to your computer and use it in GitHub Desktop.
variable "resource_group_name" { }
variable "location" { }
variable "account_names" {
type = list(string)
description = "List of names for storage accounts"
default = [
"myaccount",
"hisaccount",
"heraccount",
"theiraccount",
"anotheraccount"
]
}
resource "azurerm_storage_account" "storageacct" {
count = length(var.account_names)
name = "${var.account_names[count.index]}-acct${count.index + 1}"
resource_group_name = var.resource_group_name
location = var.location
account_tier = "Standard"
account_replication_type = "GRS"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment