elastic / terraform-provider-ec

https://registry.terraform.io/providers/elastic/ec/latest/docs
Apache License 2.0
176 stars 89 forks source link

ec_deployment fails after changing Terraform resrouce #508

Open brettmiller opened 2 years ago

brettmiller commented 2 years ago

Readiness Checklist

Expected Behavior

Existing deployment is destroyed and a new deployment with the same deployment name is created.

Current Behavior

Existing deployment is destroyed and the error below is produced when it tries to create the new deployment.

ec_deployment.vmn-tango-ec-d01-use1: Creating... ec_deployment.vmn-tango-ec-d01-use1: Still creating... [10s elapsed] ╷ │ Error: Provider produced inconsistent result after apply │ │ When applying changes to ec_deployment.vmn-tango-ec-d01-use1, provider "provider[\"registry.terraform.io/elastic/ec\"]" produced an unexpected new value: Root resource was │ present, but now absent. │ │ This is a bug in the provider, which should be reported in the provider's own issue tracker. ╵

 Terraform definition

Initial resource definition:

resource "ec_deployment" "vmn-tango-ec-p01-use1" { name = "vmn-tango-ec-d01-use1" request_id = "..." ... elasticsearch {... } }

Updated resource definition:

(fix typo - resource name modified from "p01" to "d01") resource "ec_deployment" "vmn-tango-ec-d01-use1" { name = "vmn-tango-ec-d01-use1" request_id = "..." ... elasticsearch {... } }

Steps to Reproduce

  1. Create/apply an "ec_deployment"
  2. Modify the "ec_deployment" Terraform resource name (not the deployment name)
  3. Apply changes

Context

This issue is keeping us from being able to create a new EC deployment with our prefered deployment name.

Your Environment

brettmiller commented 2 years ago

This was resolved by removing the "request_id" that trying to applying the initial resource said to add. It seems like this should error with something like ""request_id' no longer exists"