File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -63,16 +63,29 @@ resource "azurerm_sql_server" "primary" {
63
63
administrator_login_password = random_password. main . result
64
64
tags = merge ({ " Name" = format (" %s-primary" , var. sqlserver_name ) }, var. tags , )
65
65
66
- dynamic "extended_auditing_policy" {
66
+ /* dynamic "extended_auditing_policy" {
67
67
for_each = local.if_extended_auditing_policy_enabled
68
68
content {
69
69
storage_account_access_key = azurerm_storage_account.storeacc.0.primary_access_key
70
70
storage_endpoint = azurerm_storage_account.storeacc.0.primary_blob_endpoint
71
71
retention_in_days = var.log_retention_days
72
72
}
73
+ } */
74
+ }
75
+
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
73
84
}
85
+
74
86
}
75
87
88
+
76
89
resource "azurerm_sql_server" "secondary" {
77
90
count = var. enable_failover_group ? 1 : 0
78
91
name = format (" %s-secondary" , var. sqlserver_name )
You can’t perform that action at this time.
0 commit comments