Skip to content
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 removes route created out side the terraform resource definition #1

Open
nicknameyu opened this issue Sep 22, 2022 · 2 comments

Comments

@nicknameyu
Copy link

azurerm 3.23.0
terraform 1.2.5

Issue Description:
I'm using azurerm_route_table to deploy route table for a subnet that is being used for Azure Kubenetes Cluster using Kubenet plugin.
When using kubenet plugin, AKS will automatically add route to the route table to facilitate the routing to the pods running on the VMSS. These route rules are dynamic because the VMSS nodes come and go randomly. Then when I need to adjust some other features of in the same workspace, action group for example, even I don't change anything about the route table, azurerm_route_table will remove the dynamic created routes for VMSS. AKS will soon add them back but it will be 3-5 minutes later. Which means in this 3-5 minutes, the PODs on AKS cluster cannot receive the requests.
I'm trying to figure out a solution to avoid this routing table removal. lifecycle is not an option, cause in some circumstance I do need modify the route table, and terraform doesn't allow me to use a parameter to control lifecycle. https://www.terraform.io/language/meta-arguments/lifecycle#literal-values-only
Questions:

  1. why azurerm_route_table deletes those routing rules out side the resource definition? in the load balancer resource for example, if an attribute is outside the resource definition, terraform doesn't delete it.
  2. Is there any way I can parameterize this control of keeping/removing attributes outside the resource definition?
@BzSpi
Copy link
Contributor

BzSpi commented Jun 9, 2023

Hello,

Thanks for opening this issue.

Can you provide the Terraform code ?

@nicknameyu
Copy link
Author

There isn't any code. @BzSpi , please read the issue description carefully. The key issue here is that Terraform removes the routing rules that were not created in the Terraform code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants