From 38d012f27a16c9a77d52e90e9bad99ae432bec83 Mon Sep 17 00:00:00 2001 From: Zachary Blasczyk <77289967+zacharyblasczyk@users.noreply.github.com> Date: Mon, 5 Aug 2024 12:47:11 -0700 Subject: [PATCH] fix: Max Length of Storage Account name (#90) --- modules/storage/main.tf | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/storage/main.tf b/modules/storage/main.tf index 0c55022..c798a7d 100644 --- a/modules/storage/main.tf +++ b/modules/storage/main.tf @@ -1,5 +1,9 @@ +locals { + postfix = "storage" + truncated_namespace = substr(replace(var.namespace, "-", ""), 0, 24 - length(local.postfix)) +} resource "azurerm_storage_account" "default" { - name = replace("${var.namespace}-storage", "-", "") + name = "${local.truncated_namespace}${local.postfix}" resource_group_name = var.resource_group_name location = var.location account_tier = "Standard"