delphix-integrations / terraform-provider-delphix

Repository for Delphix Terraform Provider built on DCT APIs.
https://integrations.delphix.com
11 stars 9 forks source link

"Wednesday 23rd of August - Deletion and recreation of an environment fails" #66

Open ozcan-ozkaya-et opened 1 year ago

ozcan-ozkaya-et commented 1 year ago

Expected Behavior We are recreating a Delphix environment, moving it from a plain resource to a module, terraform should delete the plain resource and create it under module instead. Delete the existing and create the new one.

Actual Behavior Creation fails because does not wait for the deletion to be completed.

Steps To Reproduce the Problem Recreate an existing environment, simply changing the resource address within the Terraform configuration.

Steps to reproduce the behavior:

  1. Move the address of an existing environment
  2. apply
  3. See error
Error: [NOT OK] Env-Create FAILED. JobId: e459d95263984aef98cd0f690af6c798 / Error: Failed to add host "10.35.23.28"

because it belongs to another host environment "magicplus-neur-staging-target-082".

module.main.module.delphix_target["082"].delphix_environment.target["magicplus-neur-staging-target-082"] will be created

Screenshots Screenshot 2023-08-23 at 09 42 34

Plan actions Destroy of current env.

 module.main.delphix_environment.target["082"] will be destroyed
 (because delphix_environment.target is not in configuration)

Creation of the new env

 # module.main.module.delphix_target["082"].delphix_environment.target["magicplus-neur-staging-target-082"] will be created

Version Version Engine V10 DCT v9 TF provider v2

Additional Context Add any other context about the problem here, including additional logs or debugging information if appropriate.

nick-mathison commented 1 year ago

Thanks for the detailed report!

This seems very similar to #67 where you are changing the value of a property (hostname) and then expect the Environment to update accordingly.

What's different is that you are reporting an incomplete "delete" action. We'll need to investigate and confirm.