From e65e42c3dfb469af944945c6b2261c2b6f4ae076 Mon Sep 17 00:00:00 2001 From: jksprattler Date: Mon, 20 Jan 2025 15:34:41 -0600 Subject: [PATCH] add count index to local._names --- cloud_Azure/terraform/module/storage_account.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloud_Azure/terraform/module/storage_account.tf b/cloud_Azure/terraform/module/storage_account.tf index fabeedd..e1cb2a6 100644 --- a/cloud_Azure/terraform/module/storage_account.tf +++ b/cloud_Azure/terraform/module/storage_account.tf @@ -7,7 +7,7 @@ resource "random_id" "storage_account_id" { # Each output name is concatenation of the exporter name truncated to 12 chars and a random id of 12 chars, adjusted to naming restrictions locals { truncated_name = substr(var.name, 0, 12) - _names = [for name in var.resource_group_names : "${local.truncated_name}${random_id.storage_account_id.hex}"] + _names = [for name in var.resource_group_names : "${local.truncated_name}${random_id.storage_account_id[count.index].hex}"] _lowercase_names = [for name in local._names : lower(name)] _alphanum_lowercase_names = [for name in local._lowercase_names : join("", regexall("[[:alnum:]]+", name))] generated_storage_account_names = [for name in local._alphanum_lowercase_names : substr(name, 0, 24)]