From 21fa50db01cf5b32bf386224bb7a87574bfa7d0a Mon Sep 17 00:00:00 2001 From: Ruairi Fennell Date: Mon, 14 Oct 2019 16:30:01 +0100 Subject: [PATCH] Lookup log profile before updating Signed-off-by: Ruairi Fennell --- terraform/azure.tf | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/terraform/azure.tf b/terraform/azure.tf index acb10fe1f..edbdd9ab9 100644 --- a/terraform/azure.tf +++ b/terraform/azure.tf @@ -368,11 +368,15 @@ SETTINGS PROTECTED_SETTINGS } +data "azurerm_monitor_log_profile" "log_profile" { + name = "azure_log_profile" +} + resource "azurerm_monitor_log_profile" "azure_log_profile" { - name = "default" - categories = [ "Action" ] - locations = [ "${var.log_profile_default_location}" ] - storage_account_id = "${azurerm_storage_account.sa.id}" + name = "${data.azurerm_monitor_log_profile.log_profile.name}" + categories = ["${data.azurerm_monitor_log_profile.log_profile.categories}"] + locations = ["${data.azurerm_monitor_log_profile.log_profile.locations}"] + storage_account_id = "${data.azurerm_monitor_log_profile.log_profile.storage_account_id}" retention_policy { enabled = true