From c48fe0c643e8971f1fdada99b76bf8f858fe380f Mon Sep 17 00:00:00 2001 From: Zoe Cope Date: Tue, 5 Mar 2024 09:09:14 +0000 Subject: [PATCH] bit nicer --- main.tf | 1 + sa-sa.tf | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/main.tf b/main.tf index a6cc1778..b47c79b3 100644 --- a/main.tf +++ b/main.tf @@ -23,6 +23,7 @@ locals { "mfa.html", ] b2c_container_name = "${var.product}-b2c-container" + content_type = strcontains(each.value, ".html") ? "text/html" : strcontains(each.value, ".css") ? "text/css" : strcontains(each.value, ".png") ? "image/x-png" : strcontains(each.value, ".ico") ? "image/x-ico" : strcontains(each.value, ".svg") ? "image/svg+xml" : "application/octet-stream" containers = [{ name = local.b2c_container_name access_type = "container" diff --git a/sa-sa.tf b/sa-sa.tf index c2cd12b0..718874dc 100644 --- a/sa-sa.tf +++ b/sa-sa.tf @@ -65,7 +65,7 @@ resource "azurerm_monitor_diagnostic_setting" "storageblobsa" { resource "azurerm_storage_blob" "b2c_config" { for_each = { for idx, file_name in local.b2c_files : idx => file_name } name = each.value - content_type = strcontains(each.value, ".html") ? "text/html" : strcontains(each.value, ".css") ? "text/css" : strcontains(each.value, ".png") ? "image/x-png" : strcontains(each.value, ".ico") ? "image/x-ico" : strcontains(each.value, ".svg") ? "image/svg+xml" : "application/octet-stream" + content_type = local.content_type content_md5 = filemd5("./b2c/assets/${each.value}") storage_account_name = module.sa_storage_account.storageaccount_name storage_container_name = local.b2c_container_name