-
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
azurerm_subnet_route_table_association wants to destroy and recreate on subsequent 'apply' #20678
Comments
Thanks for raising this issue. Seems I cannot repro this issue with below tf config that is similar with yours. Could you double check if the resource group name has been changed on the outside of TF? tf config:
|
@neil-yechenwei Yes. In order to observe this issue you need to have a route table with a resource ID that is being returned as mixed-case by the data provider. |
Additional information: If I look at the route table in Azure portal, its resource ID is all lowercase. So it appears that while Azure itself is happy to present the resource ID as all lowercase, for some reason Terraform sometimes presents it in mixed case. But not always. The discrepancy leads to the problem reported in this issue. |
@eehret Thanks for raising this issue. Our team recently came across the same bug (unnecessary re-creation of @neil-yechenwei The Azure documentation states:
In #5455 and #1386 your colleague @tombuildsstuff already explained that there's no simple fix tackling all issues consistently. But maybe in the case for Also #20138 seems related (no comment from your side yet) I'd appreciate some effort from your side to fix this at least partially (so far, issues addressing this seem to be just closed or stale) or at least document a warning to all resources that one should create all resources within Let me know if you need any further information. |
Reporter of #20138 here. @eehret's experience directly matches ours. This doesn't happen only on It would be awesome if this could be addressed, as it effects us pretty commonly in at least one of our resource groups. |
I ran into the same error today. Terraform 1.3.9 I used practically same code as documentation example here I noticed that when I use route_table_id = azurerm_route_table.example.id terraform sent back a "/" at the end of the id but route table Ressource ID (and probably for all Azure resources) doesn't finish with a "/" in properties in Azure Portal Hope it will help. |
Is there an existing issue for this?
Community Note
Terraform Version
1.3.7
AzureRM Provider Version
3.45.0
Affected Resource(s)/Data Source(s)
azurerm_subnet_route_table_association
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
azurerm_subnet_route_table_association gets created successfully.
Attempting another subsequent
terraform apply
without making any change to the configuration does not result in Terraform suggesting to destroy and recreate the resource.Actual Behaviour
Terraform is noticing the discrepancy in the resource group name of the azurerm_route_table and thinks that a destroy and recreate of the azurerm_subnet_route_table_association is required.
Note my comments above in the example code. Terraform is doing this because of a discrepancy in the case of the resource group of the route table resource.
Steps to Reproduce
Important Factoids
No response
References
No response
The text was updated successfully, but these errors were encountered: