1

I am trying to do this, via Terraform code: enter image description here

However, I can not find how. Is it some obscure resource or it is not implemented at all ?

Kostas Demiris
  • 3,415
  • 8
  • 47
  • 85

2 Answers2

3

You can use the azurerm_monitor_diagnostic_setting to configure the setting as ydaetskcoR said, it works like the screenshot you provided shows. Here is the example code:

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 does not support Data for application gateway, so you need to input the resource id of the existing application gateway yourself, or quote the id when you create the new application gateway.

Charles Xu
  • 29,862
  • 2
  • 22
  • 39
0

It seems like logs are not supported by Terraform for Azure WAF (ApplicationGateway) yet.