Skip to content

Commit

Permalink
fix(management): azapi_resource.diag_settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Laudenlaruto committed Jul 10, 2024
1 parent 283edaa commit fdd5df2
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions resources.management_groups.tf
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,13 @@ resource "azurerm_management_group" "level_6" {
# This will deploy Diagnostic Settings for the Management Groups
# when the input variable deploy_diagnostics_for_mg is true
resource "azapi_resource" "diag_settings" {
for_each = local.azapi_mg_diagnostics
type = "Microsoft.Insights/diagnosticSettings@2021-05-01-preview"
name = "toLA"
location = local.default_location
parent_id = each.key
body = jsonencode({
for_each = local.azapi_mg_diagnostics
type = "Microsoft.Insights/diagnosticSettings@2021-05-01-preview"
name = "toLA"
location = local.default_location
parent_id = each.key
schema_validation_enabled = false
body = {
properties = {
logAnalyticsDestinationType = "null"
logs = [
Expand All @@ -99,7 +100,7 @@ resource "azapi_resource" "diag_settings" {
]
workspaceId = local.template_file_variables.log_analytics_workspace_resource_id
}
})
}
depends_on = [
time_sleep.after_azurerm_management_group,
azurerm_management_group.level_1,
Expand Down

0 comments on commit fdd5df2

Please sign in to comment.