Closed vikram-chandrakanth closed 1 year ago
Hi @vikram-chandrakanth
You should not be using the provider from this repo (in case you are), since active development moved to https://github.com/terraform-providers/terraform-provider-bigip
On a high level look here, I think the problem is in how the node name is declared:
bigip_ltm_pool_attachment.nodes_attach[0]: Creating...
node: "" => "web_node01:80"
pool: "" => "/Common/server"
^^ above is wrong, since the node name should be a fullPath
so you are missing the partition bit:
node: "" => "/Common/web_node01:80"
Can you please retry with above and using the latest release from https://github.com/terraform-providers/terraform-provider-bigip
Repository Archived
Hi Team,
resource_bigip_ltm_pool_attachment, is not updating the last state, on the first run it attaches the member to the pool,
But on re-run, it try to add it again. and fails on saying, there are already a member of the pool.
First Run:
bigip_ltm_pool_attachment.nodes_attach[2]: Creating... node: "" => "test_node01:80" pool: "" => "/Common/node" bigip_ltm_pool_attachment.nodes_attach[1]: Creating... node: "" => "web_node02:80" pool: "" => "/Common/server" bigip_ltm_pool_attachment.nodes_attach[0]: Creating... node: "" => "web_node01:80" pool: "" => "/Common/server" bigip_ltm_pool_attachment.nodes_attach[3]: Creating... node: "" => "test_node02:80" pool: "" => "/Common/node" bigip_ltm_pool_attachment.nodes_attach[3]: Creation complete after 0s (ID: /Common/node-test_node02:80) bigip_ltm_pool_attachment.nodes_attach[2]: Creation complete after 0s (ID: /Common/node-test_node01:80) bigip_ltm_pool_attachment.nodes_attach[1]: Creation complete after 0s (ID: /Common/server-web_node02:80) bigip_ltm_pool_attachment.nodes_attach[0]: Creation complete after 0s (ID: /Common/server-web_node01:80)
Second Run:
bigip_ltm_pool_attachment.nodes_attach[1]: Refreshing state... (ID: /Common/server-web_node02:80) bigip_ltm_pool_attachment.nodes_attach[0]: Refreshing state... (ID: /Common/server-web_node01:80) bigip_ltm_pool_attachment.nodes_attach[3]: Refreshing state... (ID: /Common/node-test_node02:80) bigip_ltm_pool_attachment.nodes_attach[2]: Refreshing state... (ID: /Common/node-test_node01:80) bigip_ltm_pool_attachment.nodes_attach[0]: Creating... node: "" => "web_node01:80" pool: "" => "/Common/server" bigip_ltm_pool_attachment.nodes_attach[3]: Creating... node: "" => "test_node02:80" pool: "" => "/Common/node" bigip_ltm_pool_attachment.nodes_attach[1]: Creating... node: "" => "web_node02:80" pool: "" => "/Common/server" bigip_ltm_pool_attachment.nodes_attach[2]: Creating... node: "" => "test_node01:80" pool: "" => "/Common/node"
Error: Error applying plan:
4 error(s) occurred:
bigip_ltm_pool_attachment.nodes_attach[2]: 1 error(s) occurred:
bigip_ltm_pool_attachment.nodes_attach.2: Failure adding node test_node01:80 to pool /Common/node: HTTP 409 :: {"code":409,"message":"01020066:3: The requested Pool Member (/Common/node /Common/test_node01 80) already exists in partition Common.","errorStack":[],"apiError":3}
bigip_ltm_pool_attachment.nodes_attach[3]: 1 error(s) occurred:
bigip_ltm_pool_attachment.nodes_attach.3: Failure adding node test_node02:80 to pool /Common/node: HTTP 409 :: {"code":409,"message":"01020066:3: The requested Pool Member (/Common/node /Common/test_node02 80) already exists in partition Common.","errorStack":[],"apiError":3}
bigip_ltm_pool_attachment.nodes_attach[1]: 1 error(s) occurred:
bigip_ltm_pool_attachment.nodes_attach.1: Failure adding node web_node02:80 to pool /Common/server: HTTP 409 :: {"code":409,"message":"01020066:3: The requested Pool Member (/Common/server /Common/web_node02 80) already exists in partition Common.","errorStack":[],"apiError":3}
bigip_ltm_pool_attachment.nodes_attach[0]: 1 error(s) occurred:
bigip_ltm_pool_attachment.nodes_attach.0: Failure adding node web_node01:80 to pool /Common/server: HTTP 409 :: {"code":409,"message":"01020066:3: The requested Pool Member (/Common/server /Common/web_node01 80) already exists in partition Common.","errorStack":[],"apiError":3}
Terraform does not automatically rollback in the face of errors. Instead, your Terraform state file has been partially updated with any resources that successfully completed. Please address the error above and apply again to incrementally change your infrastructure.
main.tf
provider "bigip" { address = "${var.url}" username = "${var.username}" password = "${var.password}" }
resource "bigip_ltm_pool_attachment" "nodes_attach" { count = "${length(var.pool_nodes)}" pool = "/Common/${lookup(var.pool_nodes[count.index], "pool")}" node = "${lookup(var.pool_nodes[count.index], "name")}" }
Regards, Vikram