File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -74,15 +74,12 @@ resource "azurerm_sql_server" "primary" {
74
74
}
75
75
76
76
resource "azurerm_mssql_server_extended_auditing_policy" "main" {
77
- for_each = local. if_extended_auditing_policy_enabled
78
- content {
79
- server_id = var. enable_failover_group == true ? [azurerm_sql_server . primary . id , azurerm_sql_server . secondary . id ] : [azurerm_sql_server . primary . id ]
80
- storage_endpoint = azurerm_storage_account. storeacc . 0 . primary_blob_endpoint
81
- storage_account_access_key = azurerm_storage_account. storeacc . 0 . primary_access_key
82
- storage_account_access_key_is_secondary = false
83
- retention_days = var. log_retention_days
84
- }
85
-
77
+ count = var. enable_auditing_policy ? 1 : 0
78
+ server_id = azurerm_sql_server. primary . id
79
+ storage_endpoint = azurerm_storage_account. storeacc . 0 . primary_blob_endpoint
80
+ storage_account_access_key = azurerm_storage_account. storeacc . 0 . primary_access_key
81
+ storage_account_access_key_is_secondary = false
82
+ retention_days = var. log_retention_days
86
83
}
87
84
88
85
You can’t perform that action at this time.
0 commit comments