From e68c9ec46dbcf9f3dd59921afbea710b3403032b Mon Sep 17 00:00:00 2001 From: Tamir Kamara <26870601+tamirkamara@users.noreply.github.com> Date: Sun, 12 Feb 2023 06:20:02 +0000 Subject: [PATCH 1/2] ignore_chnages for log_analytics_destination_type --- core/terraform/airlock/airlock_processor.tf | 2 ++ core/terraform/api-webapp.tf | 2 ++ core/terraform/appgateway/appgateway.tf | 3 ++- core/terraform/keyvault.tf | 9 +++++---- core/terraform/servicebus.tf | 3 ++- core/version.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/core/terraform/airlock/airlock_processor.tf b/core/terraform/airlock/airlock_processor.tf index fac0ecccc8..24fa4f44ee 100644 --- a/core/terraform/airlock/airlock_processor.tf +++ b/core/terraform/airlock/airlock_processor.tf @@ -113,6 +113,8 @@ resource "azurerm_monitor_diagnostic_setting" "airlock_function_app" { days = 365 } } + + lifecycle { ignore_changes = [log_analytics_destination_type] } } resource "azurerm_private_endpoint" "function_storage" { diff --git a/core/terraform/api-webapp.tf b/core/terraform/api-webapp.tf index 4082fe0ca5..b8ba17ccac 100644 --- a/core/terraform/api-webapp.tf +++ b/core/terraform/api-webapp.tf @@ -152,4 +152,6 @@ resource "azurerm_monitor_diagnostic_setting" "webapp_api" { days = 365 } } + + lifecycle { ignore_changes = [log_analytics_destination_type] } } diff --git a/core/terraform/appgateway/appgateway.tf b/core/terraform/appgateway/appgateway.tf index f567b1574a..e21f6a9e7c 100644 --- a/core/terraform/appgateway/appgateway.tf +++ b/core/terraform/appgateway/appgateway.tf @@ -198,7 +198,6 @@ resource "azurerm_monitor_diagnostic_setting" "agw" { name = "diagnostics-agw-${var.tre_id}" target_resource_id = azurerm_application_gateway.agw.id log_analytics_workspace_id = var.log_analytics_workspace_id - # log_analytics_destination_type = "Dedicated" dynamic "enabled_log" { for_each = ["ApplicationGatewayAccessLog", "ApplicationGatewayPerformanceLog", "ApplicationGatewayFirewallLog"] @@ -221,6 +220,8 @@ resource "azurerm_monitor_diagnostic_setting" "agw" { days = 365 } } + + lifecycle { ignore_changes = [log_analytics_destination_type] } } diff --git a/core/terraform/keyvault.tf b/core/terraform/keyvault.tf index 5d84ebf460..0d8205c6c9 100644 --- a/core/terraform/keyvault.tf +++ b/core/terraform/keyvault.tf @@ -113,10 +113,9 @@ resource "azurerm_key_vault_secret" "application_admin_client_secret" { } resource "azurerm_monitor_diagnostic_setting" "kv" { - name = "diagnostics-kv-${var.tre_id}" - target_resource_id = azurerm_key_vault.kv.id - log_analytics_workspace_id = module.azure_monitor.log_analytics_workspace_id - log_analytics_destination_type = "AzureDiagnostics" + name = "diagnostics-kv-${var.tre_id}" + target_resource_id = azurerm_key_vault.kv.id + log_analytics_workspace_id = module.azure_monitor.log_analytics_workspace_id dynamic "enabled_log" { for_each = ["AuditEvent", "AzurePolicyEvaluationDetails"] @@ -139,4 +138,6 @@ resource "azurerm_monitor_diagnostic_setting" "kv" { days = 365 } } + + lifecycle { ignore_changes = [log_analytics_destination_type] } } diff --git a/core/terraform/servicebus.tf b/core/terraform/servicebus.tf index 9c370bf96b..2dddf56495 100644 --- a/core/terraform/servicebus.tf +++ b/core/terraform/servicebus.tf @@ -96,7 +96,6 @@ resource "azurerm_monitor_diagnostic_setting" "sb" { name = "diagnostics-sb-${var.tre_id}" target_resource_id = azurerm_servicebus_namespace.sb.id log_analytics_workspace_id = module.azure_monitor.log_analytics_workspace_id - # log_analytics_destination_type = "Dedicated" dynamic "enabled_log" { for_each = ["OperationalLogs", "VNetAndIPFilteringLogs", "RuntimeAuditLogs", "ApplicationMetricsLogs"] @@ -119,4 +118,6 @@ resource "azurerm_monitor_diagnostic_setting" "sb" { days = 365 } } + + lifecycle { ignore_changes = [log_analytics_destination_type] } } diff --git a/core/version.txt b/core/version.txt index ed9d4d87b6..ab55bb1afc 100644 --- a/core/version.txt +++ b/core/version.txt @@ -1 +1 @@ -__version__ = "0.7.4" +__version__ = "0.7.5" From 266eb2e1df3b6f54bacf97a371c68076d6dbd2d5 Mon Sep 17 00:00:00 2001 From: Tamir Kamara <26870601+tamirkamara@users.noreply.github.com> Date: Sun, 12 Feb 2023 06:24:56 +0000 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 00d2d36a0e..49fe3deb4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,7 @@ BUG FIXES: * Skip Certs shared service E2E on Friday & Saturday due to LetsEncrypt limits [#3203](https://github.com/microsoft/AzureTRE/pull/3203) * Create Workspace AppInsights via AzAPI provider due to an issue with AzureRM [#3207](https://github.com/microsoft/AzureTRE/pull/3207) * 'Workspace Owner' is now able to access Airlock request's SAS URL even if the request is not in review [#3208](https://github.com/microsoft/AzureTRE/pull/3208) +* Ignore changes in log_analytics_destination_type to prevent redundant updates [#3217](https://github.com/microsoft/AzureTRE/pull/3217) COMPONENTS: