RavinderReddyF5 / terraform-provider-bigip-version0.12

Terraform resources that can configure F5 BIGIP products
Mozilla Public License 2.0
0 stars 0 forks source link

[CLOSED] Terraform plan doesn't match apply #308

Open RavinderReddyF5 opened 3 years ago

RavinderReddyF5 commented 3 years ago

Issue by stobias123 Tuesday Apr 14, 2020 at 18:45 GMT Originally opened as https://github.com/terraform-providers/terraform-provider-bigip/issues/277


Given a scenario where a ltm_node already exists called node1 and I have a file that creates a new file as shown....

resource "bigip_ltm_node" "node" {
  name             = "/Common/node1"
   ...
}

The plan will show success and 1 node to add.

When I run the apply, I get a failure and partial resource creation.

Error: Error modifying node /Common/node1: HTTP 409 :: {“code”:409,“message”:“01020066:3: The requested Node (/Common/node1) already exists in partition Common.“,”errorStack”:[],“apiError”:3}

Why does my plan not fail showing the resource already exists?

RavinderReddyF5 commented 3 years ago

Comment by dkulchinsky Wednesday Apr 15, 2020 at 02:47 GMT


plan checks diff between state and configuration (your tf files), if the node you just added in your terraform config already exist on the device you will get the above error and this is expected.

to reconcile the this, you should import the resource from the device to the terraform state (using terraform import command)