Skip to content

Commit

Permalink
feat: Apply diagnostic settings changes once the deployment is finish…
Browse files Browse the repository at this point in the history
…ed (#441)

* feat: Apply diagnostic settings changes once the deployment is finished

* Added comment
  • Loading branch information
pipalmic authored Jan 9, 2025
1 parent c99e758 commit 54d9f82
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions modules/azure/logic_app_standard/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,13 @@ data "azurerm_monitor_diagnostic_categories" "diagnostic_categories" {
}

// Write logs and metrics to log analytics if specified
// Needs to be done once the deployment is finished, because updating Diagnostic Settings leads to a restart of the Logic App
// which causes the deployment to fail if it is not finished yet
resource "azurerm_monitor_diagnostic_setting" "diagnostic_setting" {
depends_on = [
null_resource.deploy
]

count = var.log_analytics_workspace_id == null ? 0 : 1
name = "diag-${var.logic_app_name}"
target_resource_id = azurerm_logic_app_standard.app.id
Expand Down

0 comments on commit 54d9f82

Please sign in to comment.