File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ resource "azurerm_application_insights" "this" {
99}
1010
1111data "azurerm_monitor_diagnostic_categories" "this" {
12+ count = var. enable_diagnostic_setting ? 1 : 0
1213 resource_id = azurerm_linux_web_app. this . id
1314}
1415
@@ -20,14 +21,14 @@ resource "azurerm_monitor_diagnostic_setting" "this" {
2021 log_analytics_destination_type = var. analytics_destination_type
2122
2223 dynamic "enabled_log" {
23- for_each = data. azurerm_monitor_diagnostic_categories . this . log_category_types
24+ for_each = data. azurerm_monitor_diagnostic_categories . this [ 0 ] . log_category_types
2425 content {
2526 category = enabled_log. value
2627 }
2728 }
2829
2930 dynamic "metric" {
30- for_each = data. azurerm_monitor_diagnostic_categories . this . metrics
31+ for_each = data. azurerm_monitor_diagnostic_categories . this [ 0 ] . metrics
3132 content {
3233 category = metric. value
3334 }
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ terraform {
44 required_providers {
55 azurerm = {
66 source = " hashicorp/azurerm"
7- version = " >= 3.23 .0"
7+ version = " >= 3.40 .0"
88 }
99 }
1010}
You can’t perform that action at this time.
0 commit comments