Skip to content

Commit 9b02ee1

Browse files
committed
module update
1 parent faba4b0 commit 9b02ee1

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

main.tf

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,12 @@ resource "azurerm_sql_server" "primary" {
7474
}
7575

7676
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
8683
}
8784

8885

0 commit comments

Comments
 (0)