Open ZarakiKenpachi7 opened 2 weeks ago
Hi @ZarakiKenpachi7 thanks for reporting this issue, I can reproduce this issue on my side. According to the schema, the whole subnet
nested block's type is set(object)
, which means once any element has changed any attribute, the element would be treated as a whole new element, since the hash of object has been changed. Unlike list
we can compare element based on index, any change to set's element would result in removing old instance and insert the new one.
Is that possible to use azurerm_subnet
resource instead of nested subnet
block inside azurerm_virtual_network
resource? I think that could solve your issue, or, you can set subnet[0].delegation[0].service_delegation[0].actions
to ["Microsoft.Network/virtualNetworks/subnets/action"]
as workaround.
Is there an existing issue for this?
Community Note
Terraform Version
1.9.5
AzureRM Provider Version
4.0.1
Affected Resource(s)/Data Source(s)
azurerm_virtual_network
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
No Configuration Changes
Actual Behaviour
It tries to recreate the subnet every time a TF plan runs. Even though there is no change in the configuration.
Steps to Reproduce
terraform init terraform plan terraform apply --auto-approve
Important Factoids
No
References
No response