-
Notifications
You must be signed in to change notification settings - Fork 74
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
[Bug]: Applying server_network adds server to network, but in next apply removes it #812
Comments
Btw, I tried this workaround, but this does NOT work. #650 (comment) |
Hey @MohammedNoureldin, could you add the code for the |
Hi @apricote, Thank you for your reply. Here is the code:
|
Okay, so the issue is that you define a If you move that to a new |
So in the end should I have two separate
Is that correct? |
Yes, if you want to attach the server to two networks. |
I have just tested it. This seems to be working. I just saw shortly that not all network changes were applied from the first apply, but I cannot reproduce it quickly. Anyway, the original issue seems to be clarified and resolved. Thank you! |
What happened?
Considering the example shown below, where I want to add a server created by a module to network created by me. For this I am using server_network resource.
When I call
terraform apply -state .tfstate
it works and my VPS gets added to the network. However, when I call apply again, it wants to "destroy" meaning remove the server from the network, so after every apply it toggles the state of the resource between adding and removing the server from the network.Here is the log:
Here you can see, it wants to destroy / remove the server from the network, although I did nothing except calling apply again.
What did you expect to happen?
Calling apply must not remove the server from the network.
Please provide a minimal working example
Notice that server id comes from a module.
The text was updated successfully, but these errors were encountered: