diff --git a/local.tf b/local.tf index 5dc1103..bb6abad 100644 --- a/local.tf +++ b/local.tf @@ -4,8 +4,8 @@ locals { account_tier = (var.account_tier == null ? (var.account_kind == "BlockBlobStorage" || var.account_kind == "FileStorage" ? "Premium" : "Standard") : var.account_tier) static_website_enabled = (local.validate_static_website) ? [{}] : [] - validate_static_website = ((var.enable_static_website && var.account_kind == "BlockBlobStorage" || var.account_kind == "StorageV2") ? - true : file("ERROR: Account kind must be BlockBlobStorage or StorageV2 when enabling static website")) + validate_static_website = ( var.enable_static_website ? ((var.account_kind == "BlockBlobStorage" || var.account_kind == "StorageV2") ? + true : file("ERROR: Account kind must be BlockBlobStorage or StorageV2 when enabling static website")) : false ) validate_nfsv3 = (!var.nfsv3_enabled || (var.nfsv3_enabled && var.enable_hns) ? true : file("ERROR: NFS V3 can only be enabled when Hierarchical Namespaces are enabled")) diff --git a/main.tf b/main.tf index a0cc70a..47f19fc 100644 --- a/main.tf +++ b/main.tf @@ -27,7 +27,7 @@ resource "azurerm_storage_account" "sa" { } dynamic "blob_properties" { - for_each = (var.account_kind == "BlockBlobStorage" ? [1] : []) + for_each = ((var.account_kind == "BlockBlobStorage" || var.account_kind == "StorageV2") ? [1] : []) content { dynamic "delete_retention_policy" { for_each = (var.blob_delete_retention_days == null ? [] : [1])