File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ locals {
2727}
2828
2929resource "azurerm_monitor_diagnostic_setting" "backup_vault" {
30- for_each = var. deploy_diagnostic_settings ? [ 1 ] : []
30+ count = var. deploy_diagnostic_settings ? 1 : 0
3131 name = " ${ var . backup_vault_name } -diagnostic-settings"
3232 target_resource_id = azurerm_data_protection_backup_vault. backup_vault . id
3333 log_analytics_workspace_id = var. log_analytics_workspace_id
Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ variable "deploy_diagnostic_settings" {
138138 default = true
139139
140140 validation {
141- condition = var. deploy_diagnostic_settings == true || var. log_analytics_workspace_id = = " "
141+ condition = ! var. deploy_diagnostic_settings || var. log_analytics_workspace_id ! = " "
142142 error_message = " Diagnostic settings can only be deployed if a log analytics workspace ID is provided."
143143 }
144144}
You can’t perform that action at this time.
0 commit comments