Open hwwilliams opened 8 months ago
Thanks for raising this issue. Maybe adding "create_before_destroy" on azurerm_virtual_hub_connection is helpful for this situation.
Thanks for raising this issue. Maybe adding "create_before_destroy" on azurerm_virtual_hub_connection is helpful for this situation.
No that doesn't help because then you get an error about how you can only have 1 vhub connection per vnet at a time.
Please try to add "create_before_destroy" and only apply it. Once it's applied successfully, then the order is changed for above situation.
Is there an existing issue for this?
Community Note
Terraform Version
1.6.4
AzureRM Provider Version
3.93.0
Affected Resource(s)/Data Source(s)
azurerm_virtual_hub_route_table_route, azurerm_virtual_hub_connection
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
If
azurerm_virtual_hub_connection
needs to be replaced and a route in a route table that was created byazurerm_virtual_hub_route_table_route
is referencing that vhub connection then it should destroy and recreate it as necessary. I would understand if the route in question was not being managed by Terraform and so it's assuming it is not safe to destroy the resource but since Terraform is managing it I expect it to handle the replacement cleanly.Actual Behaviour
It fails to destroy the vhub connection because it's being referenced by a route that is being managed by Terraform.
Steps to Reproduce
Important Factoids
No response
References
No response