-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for VNet in azurerm_network_watcher_flow_log #25982
Comments
This comment was marked as duplicate.
This comment was marked as duplicate.
`network_security_group_id` is superseded by `target_resource_id` Fixes hashicorp#25982
@favoretti any updates? |
Any updates? |
I guess it's not doable in Terraform yet! target_resource_id or resource_id to specify the VNET are not simply working in azurerm_network_watcher_flow_log. We seem to have to use NSG' for now... |
`network_security_group_id` is superseded by `target_resource_id` Fixes hashicorp#25982
@ryanghavidel2024 I just tried to set a VNet id to the "targetResourceId" field in their REST API endpoint to create flow logs and successfully created VNet Flow Logs. Since Azure Go SDK supports sending this field, it should work. API definition: https://learn.microsoft.com/en-us/rest/api/network-watcher/flow-logs/create-or-update?view=rest-network-watcher-2024-01-01 |
it also works with
|
@kaplik @MrImpossibru Super! Thanks so much. |
Looks like NSG targeted flow logs have a deprecation announcement, luckily it's not till June 2025 (2027 for EOL) but it's now official that VNET Flow Logs will be the go forward: |
Hi there, |
Any updates regarding the timeline? |
A bit off-topic, but this was about time. Having to create a NSG flow log to have traces from network activity on a subnet level is a weird approach. |
`network_security_group_id` is superseded by `target_resource_id` Fixes hashicorp#25982
are we sure this was resolved? I'm pointing to v4.10.0 and am still seeing that "network_security_group_id" is a required parameter, and "target_resource_id" is not recognized as a valid parameter. |
They still need to release a newer version with this change. |
was able to deploy using v.4.12.0. however it looks like it only allows VNET as the target_resource_id. when setting the value to be a subnet its not working. any chance we allow target_resource_id to allow subnets as well? Error: parsing "/subscriptions/7187238787123/resourceGroups/test-rgp/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1": unexpected segment "subnets/subnet1" present at the end of the URI (input "/subscriptions/7187238787123/resourceGroups/test-rgp/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1") |
@kevinrosal is that supported through portal? Apologies, I somehow didn't check API specs. I can add it as a followup PR. |
@favoretti yes. from the portal possible options are VNET, Subnet, NIC |
@kevinrosal mind opening a new issue for this? I'll work on adding it in the meantime. |
Please see #28175 for this |
Is there an existing issue for this?
Community Note
Description
I am creating a Terraform Azure Verified Module for Flow Logs. We have a requirement to create a flow log as part of the VNet creation. This is supported in the portal:
but not in the provider. Please add this capability.
I believe that the network_security_group_id variable should be renamed to target_resource_id similar to azapi. I confirmed that setting this to a VNet also works. It doesn't have to be just a NSG.
New or Affected Resource(s)/Data Source(s)
azurerm_network_watcher_flow_log
Potential Terraform Configuration
References
No response
The text was updated successfully, but these errors were encountered: