-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Terraform forces to recreate instance after gcloud compute instances move #3117
Comments
We don't support out-of-band management and reconciliation in terraform - the tool isn't designed to be used that way. The only approach that is guaranteed to work is to change your terraform config to match your desired new state, and run In this case, the reason that it is not possible is that running We'll try to modify our provider to be more forgiving in these cases, and I'll keep looking for alternate solutions, but in the meantime you should probably do the delete/recreate if at all possible. |
Aha! What happens when you move the resource is:
Consequently, it is no longer accurate to say that the instance was initialized from |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
This issue was originally opened by @Cib0rg as hashicorp/terraform#20463. It was migrated here as a result of the provider split. The original body of the issue is below.
Hello.
We use terraform. We create large infrastructure with it and now trying to scale it down. Earlier we put instances in three zones and now we need only two zones. So I try to move instances between zones with gcloud compute instance move and terraform always try to recreate instance. Even after manual correction of tfstate i see following:
But when I try to take a look into state I see following:
Terraform Version
Terraform v0.11.11
Expected Behavior
Terraform should correctly pick up data from it state
Actual Behavior
Terraform don't pick up disk image data
Steps to Reproduce
Additional Context
References
The text was updated successfully, but these errors were encountered: