You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
If you are interested in working on this issue or have submitted a pull request, please leave a comment
Hi,
I have a module that went out of sync between state and Azure portal.
I have modified the module, aligned it, ran init/plan and started importing already existing resources.
Those resources are basically subnets with route tables and nsgs on them.
i have created association resource objects for both nsg and routing table and imported these as well.
When i execute the plan command, i get a line showing that the "route_table_id" property will change to NULL from the value that it had, for example -
I tried modifying the state file manually, basically removing the value of route_table_id for those imported objects to be null, or jut or remove the property all together, the plan executed after that didn't show like there is a difference. Still showed like it is going to be null after the change.
To overcome this i decided to manually change the hcl and add that route_table_id property, maybe terraform will now not try to make a "null" out of it. this just showed like the new proprerty will be added now, and not changed or deleted.
So i removed this change as well.
After running apply once more, the routes and nsg were removed from the attached subnets, not sure why, the association objects are there.
I put back the "route_table_id_property" on the objects, ran apply, now "nothing changed", but i still have both tthe association and the property configured, when tryingt o remove the property terraform shows like it will re-add it.
So how can one remove a depcreated property????
Terraform (and AzureRM Provider) Version
terraform 0.12.9
azurerm 1.36.1
Affected Resource(s)
azure_rm_route_table
azure_rm_route_table_association
azure_rm_subnet
azure_rm_security_group
azure_rm_security_group_association
Terraform Configuration Files
resourceazurerm_subnetinternal {
count=length(local.internal_subnets["name"])
name=element(local.internal_subnets["name"], count.index)
virtual_network_name=azurerm_virtual_network.vnet.nameresource_group_name=azurerm_resource_group.network.nameaddress_prefix=element(local.internal_subnets["address_prefix"], count.index)
resourceazurerm_subnet_route_table_associationinternal_to_trust {
count=length(local.internal_subnets["name"])
subnet_id=element(azurerm_subnet.internal.*.id, count.index)
route_table_id=azurerm_route_table.test_rt.id
}
resourceazurerm_route_tabletest_rt {
name="my-rt"location=terraform.workspaceresource_group_name=azurerm_resource_group.network.nametags=var.tags
}
}```
### Panic Output
Warning:"network_security_group_id": [DEPRECATED] Use the `azurerm_subnet_network_security_group_association` resource instead
Warning:"route_table_id": [DEPRECATED] Use the `azurerm_subnet_route_table_association` resource instead.
The text was updated successfully, but these errors were encountered:
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!
ghost
locked and limited conversation to collaborators
Mar 28, 2020
Community Note
Hi,
I have a module that went out of sync between state and Azure portal.
I have modified the module, aligned it, ran init/plan and started importing already existing resources.
Those resources are basically subnets with route tables and nsgs on them.
i have created association resource objects for both nsg and routing table and imported these as well.
When i execute the plan command, i get a line showing that the "route_table_id" property will change to NULL from the value that it had, for example -
I tried modifying the state file manually, basically removing the value of route_table_id for those imported objects to be null, or jut or remove the property all together, the plan executed after that didn't show like there is a difference. Still showed like it is going to be null after the change.
To overcome this i decided to manually change the hcl and add that route_table_id property, maybe terraform will now not try to make a "null" out of it. this just showed like the new proprerty will be added now, and not changed or deleted.
So i removed this change as well.
After running apply once more, the routes and nsg were removed from the attached subnets, not sure why, the association objects are there.
I put back the "route_table_id_property" on the objects, ran apply, now "nothing changed", but i still have both tthe association and the property configured, when tryingt o remove the property terraform shows like it will re-add it.
So how can one remove a depcreated property????
Terraform (and AzureRM Provider) Version
terraform 0.12.9
azurerm 1.36.1
Affected Resource(s)
azure_rm_route_table
azure_rm_route_table_association
azure_rm_subnet
azure_rm_security_group
azure_rm_security_group_association
Terraform Configuration Files
The text was updated successfully, but these errors were encountered: