-
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_route_table/Subnet association is dropped on update. #36
Comments
After staring at this for a while, I think I see a root issue that, if fixed, may resolve other issues. I applied the above HCL and then added a tag and re-applied. The plan output I see is this:
So - the azurerm_route_table resource is detecting route properties getting nulled out. But that's not what happened since those properties weren't populated in the original azurerm_route_table, but were added as a route resource independently. This might be terraform core?? |
I'd be interested in seeing the tffile you used to generate this but based on what you said this looks like standard terraform behavior. If the route_table did not have any routes specified in the tf file than a route was added outside of Terraform, Terraform would see this as a resource out of state with what is in the tf file and remove the conflicting route. If default routes are added when you create a route_table then this is a bug for the provider and we can set route_table.route to computed and that should fix this issue. Does that make sense or am I reading this wrong? |
There are two resources: azurerm_route_table and azurerm_route. azurerm_route_table MAY have an embedded list of route but in the test case it doesn't. The HCL used is pasted above in the thread opener. No resources were added/deleted/updated outside of TF. On the first run of tf apply: (HCL posted above)
Modify the HCL - add a tag. Second run of tf apply:
The output should look something like this:
|
So it looks like we should make |
That worked. Thanks for the assist. |
Woo! Glad it worked out |
This issue is fixed in #450 |
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! |
This issue was originally opened by @TStraub-rms as hashicorp/terraform#11226. It was migrated here as part of the provider split. The original body of the issue is below.
Terraform Version
terraform version
0.8.4
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
Updating the route table should keep or update the subnet association of the table.
Actual Behavior
The initial
terraform apply
will create all the resources without an issue.When updating the route table (by updating the tags for instance), the subnet association is dropped.
Steps to Reproduce
terraform apply
a route table with at least one route.terraform apply
will update the tags, but remove the subnet association from the route table.The text was updated successfully, but these errors were encountered: