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"