adding static web to storage account

This commit is contained in:
2025-04-18 15:42:19 -05:00
parent 8de2d0275f
commit 870036b14e
3 changed files with 7 additions and 8 deletions

View File

@@ -0,0 +1,6 @@
resource "azurerm_storage_account_static_website" "static_website" {
count = length(var.storage_tables)
storage_account_id = azurerm_storage_account.storage_account.id
error_404_document = var.static_websites[count.index].error_404_document
index_document = var.static_websites[count.index].index_document
}

View File

@@ -4,12 +4,4 @@ resource "azurerm_storage_account" "storage_account" {
location = data.azurerm_resource_group.resource_group.location
account_tier = var.account_tier
account_replication_type = var.account_replication_type
dynamic static_website {
for_each = var.static_websites
content {
index_document = static_website.value.index_document
}
}
}

View File

@@ -15,6 +15,7 @@ variable "resource_group_name" {
variable "static_websites" {
default = []
type = list(object({
error_404_document = string
index_document = string
}))
}