Closed ekhaydarov closed 2 years ago
Any update on this one?
hey @ekhaydarov , please see here on the issue we had and the resolution.
Can confirm issue still exists:
masked.path: Importing from ID ".../networkSecurityGroupId/..."...
masked.path: Import prepared!
Prepared azurerm_network_watcher_flow_log for import
masked.path: Refreshing state... [id=.../networkSecurityGroupId/...]
╷
│ Error: Cannot import non-existent remote object
│
│ While attempting to import an existing object to "masked.path", the provider detected that no object exists with the
│ given id. Only pre-existing objects can be imported; check that the id is correct and that it is associated with the provider's configured region or endpoint, or use "terraform apply" to create a new
│ remote object for this resource.
╵
@ekhaydarov This should now be fixed by #15016, please confirm and feel free to reopen this issue if it still exists.
This functionality has been released in v2.96.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.
For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!
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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Community Note
Terraform (and AzureRM Provider) Version
Affected Resource(s)
Terraform Configuration Files
Debug Output
Panic Output
Expected Behaviour
terraform import azurerm_network_watcher_flow_log.flowlog["nsg"] /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/networkWatchers/watcher1/networkSecurityGroupId/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/networkSecurityGroups/group1
results in successful import of resource
Actual Behaviour
Throws an error that the resource does not exist. Confirmed via portal that it does exist. construction of this resource id is less than ideal but can lodge this complaint to azure team where it will be added to the pile of things that are backwards.
run
az network watcher flow-log list
and extract a completely different resource id for exactly the flow log above that looks like thistry to import it
Steps to Reproduce
Pretty sure we did nothing. One day we just had a terraform state drift alert and here we are trying to sync the state. Terraform says there has been a change outside it. The same flow logs had been deleted. Again when i look at portal nothing has changed to the flow logs in the last month.
Important Factoids
References
0000