-
Notifications
You must be signed in to change notification settings - Fork 119
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
recreating a node doesn't recreate the pool attachment that depends on it #82
Comments
@DavidGamba I see you mentioned you tried to add Since this is an intermediary resource (representing a relationship between two other resources) you should define the dependency (using Can you try the below:
|
@dannyk81 Thanks for the quick reply. IMHO the dependency should be implicit. --- main.tf
+++ main.tf
@@ -229,12 +229,14 @@ resource "bigip_ltm_pool" "dgamba-test-pool" {
resource "bigip_ltm_pool_attachment" "dgamba-test-pool--dgamba-test-node-1" {
pool = "${bigip_ltm_pool.dgamba-test-pool.name}"
node = "${bigip_ltm_node.dgamba-test-node-1.name}:8080"
+
+ depends_on = ["bigip_ltm_node.dgamba-test-node-1", "bigip_ltm_pool.dgamba-test-pool"]
}
resource "bigip_ltm_node" "dgamba-test-node-1" {
name = "/Common/dgamba-test-node-1"
- address = "10.169.20.244"
+ address = "valid-dns.example.com"
connection_limit = "0"
dynamic_ratio = "1" I had only tried with |
Hey @DavidGamba, thanks for the additional details. The whole dependency management in terraform is rather counter intuitive, indeed the above would not help (we are using a slightly different operational flow so I didn't hit this before). The dependency tree (whether derived implicitly or defined explicitly) only defines the order of the operations, however it doesn't mark the dependant resource for recreation, there's a good explanation here: hashicorp/terraform#8099 (comment) and also a related issue here: hashicorp/terraform#16200 One way to work around this, is to change the node's Here's my sample code: resource "bigip_ltm_node" "test_node1" {
name = "/Common/test_node1"
address = "11.11.11.11"
}
resource "bigip_ltm_pool" "test_pool1" {
name = "/Common/test_pool1"
load_balancing_mode = "round-robin"
allow_snat = "yes"
allow_nat = "yes"
}
resource "bigip_ltm_pool_attachment" "test_attach1" {
pool = "${bigip_ltm_pool.test_pool1.name}"
node = "${bigip_ltm_node.test_node1.name}:80"
} I applied the above and now would like to change the diff --git a/bigip.tf b/bigip.tf
index 3358dae..8f7a7f7 100644
--- a/bigip.tf
+++ b/bigip.tf
@@ -1,6 +1,6 @@
resource "bigip_ltm_node" "test_node1" {
- name = "/Common/test_node1"
- address = "11.11.11.11"
+ name = "/Common/test_node1a"
+ address = "11.11.11.12"
}
resource "bigip_ltm_pool" "test_pool1" { and now
and apply works as well:
As you can see, the name change forces a new resource - which is what we want, hope this helps. |
Thanks @dannyk81 for a very detailed explanation of the root cause of the issue. I will use the workaround you provided. Hopefully this issue serves as documentation for other users running into this problem. |
adding partial success support and failure handling to as3 delete function
Starting from a basic pool:
Then change the IP of the node or change from IP to DNS entry:
Only the node is changing, the node attachment is not affected in the plan. Then apply:
Trying to add
depends_on
on the pool attachment didn't work.Changes on the node that require a destroy/create should taint the pool attachment.
The text was updated successfully, but these errors were encountered: