Closed bcline760 closed 2 years ago
Hi @bcline760! This is an issue which fortunately is already solved, but I apologise for the setup being a bit more advanced than you would expect.
By enabling log_monitoring_enabled
and adding a azurerm_monitor_diagnostic_setting
with export settings to Log Analytics or EventHub, additional log destinations are supported already:
resource "azurerm_synapse_sql_pool_extended_auditing_policy" "test" {
sql_pool_id = azurerm_synapse_sql_pool.test.id
log_monitoring_enabled = true
}
resource "azurerm_monitor_diagnostic_setting" "test" {
name = "acctest-DS-test"
target_resource_id = azurerm_synapse_sql_pool.test.id
eventhub_authorization_rule_id = azurerm_eventhub_namespace_authorization_rule.test.id
eventhub_name = azurerm_eventhub.test.name
log {
category = "SQLSecurityAuditEvents"
enabled = true
retention_policy {
enabled = false
}
}
metric {
category = "AllMetrics"
retention_policy {
enabled = false
}
}
// log, metric will return all disabled categories
lifecycle {
ignore_changes = [log, metric]
}
}
I hope this helps you out and close this issue for now, if this is not enough: let me know!
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Community Note
Description
Right now
azure_synapse_sql_pool_extended_auditing_policy
only supports writing audit logs to a storage account. I would like to see support for Log Analytics and Event Hubs. This ability is present in the Azure Portal to use log analytics and event hubs.New or Affected Resource(s)
Potential Terraform Configuration
I realize that this might be a helluva breaking change. To maintain backwards compatibility, break it into separate resources or rename the resource like removing the "extended" out or go like
azurerm_synapse_workspace_auditing
. I'm terrible at names. :PReferences
https://docs.microsoft.com/en-us/azure/azure-sql/database/auditing-overview#setup-auditing