hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.6k stars 4.64k forks source link

Support for version 2 flow logs in azurerm_network_watcher_flow_log #5403

Closed ThomasStubergh closed 4 years ago

ThomasStubergh commented 4 years ago

Community Note

Description

When you enable flow logs on a NSG, the NSG supports two kinds of versions. Version 1 and version 2.

Extract from Azure Portal: "Version 1 logs ingress and egress IP traffic flows for both allowed and denied traffic. Version 2 provides additional throughput information (bytes and packets) per flow."

Azurerm_network_watcher_flow_log therefore should have an option or switch to choose which version of flow logs are needed.

New or Affected Resource(s)

Potential Terraform Configuration

resource "azurerm_network_watcher_flow_log" "test" {
  network_watcher_name = "${azurerm_network_watcher.test.name}"
  resource_group_name  = "${azurerm_resource_group.test.name}"

  network_security_group_id = "${azurerm_network_security_group.test.id}"
  storage_account_id        = "${azurerm_storage_account.test.id}"
  enabled                   = true

  flow_log_version = v1/v2

  retention_policy {
    enabled = true
    days    = 7
  }

  traffic_analytics {
    enabled               = true
    workspace_id          = "${azurerm_log_analytics_workspace.test.workspace_id}"
    workspace_region      = "${azurerm_log_analytics_workspace.test.location}"
    workspace_resource_id = "${azurerm_log_analytics_workspace.test.id}"
  }
}

flow_log_version = v1/v2 beeing a new option.

References

https://docs.microsoft.com/en-us/azure/network-watcher/network-watcher-nsg-flow-logging-overview and https://github.com/terraform-providers/terraform-provider-azurerm/pull/5059

ghost commented 4 years ago

This has been released in version 1.42.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 1.42.0"
}
# ... other configuration ...
ghost commented 4 years ago

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!