答案 0 :(得分:1)
您可以按照ydaetskcoR所述,使用azurerm_monitor_diagnostic_setting
来配置设置,它的工作原理与您提供的屏幕截图相同。这是示例代码:
resource "azurerm_monitor_diagnostic_setting" "example" {
name = "example"
target_resource_id = "application_gateway_resource_id"
storage_account_id = data.azurerm_storage_account.example.id
log {
category = "ApplicationGatewayFirewallLog"
enabled = true
retention_policy {
enabled = true
days = 30
}
}
}
Terraform不支持应用程序网关的数据,因此您需要自己输入现有应用程序网关的资源ID,或者在创建新的应用程序网关时引用该ID。
答案 1 :(得分:0)
似乎Terraform for Azure WAF(ApplicationGateway)尚不支持日志。