ResourceGroupArgs { Location = "West Europe" }); ); var environments = new string[]{"dev", "uat", "prod"}; foreach (var environment in environments) { var storageAccount = new Account($"storage{environment}", new AccountArgs { Name = $"iacpulumi{environment}", ResourceGroupName = resourceGroup.Name, Location = resourceGroup.Location, AccountReplicationType = "LRS", AccountTier = "Standard", }); } resource "azurerm_resource_group" "rg" { name = "terraform-resources" location = "West Europe" } variable "environments" { description = "storage account regions" type = list(string) default = ["dev", "uat", "prod"] } resource "azurerm_storage_account" "sa" { name = "iacpulumi${var.environments[count.index]}" resource_group_name = azurerm_resource_group.rg.name location = azurerm_resource_group.rg.location account_tier = "Standard" account_replication_type = "LRS" count = length(var.environments) }