-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Re-configuring remote state raises conflict on pull #5410
Comments
I have the same issue |
Hi @robzienert! Sorry for the troubles here. I want to make sure I'm understanding the scenario correctly: you said you saw this when you did I think my work in #6540 would actually unintentionally fix this problem for you, because it adds a special case that allows Terraform to silently clobber a local state that has no resources in it. The goal of that exception was to allow running However, I'm pretty sure it's a bug that this arose in the first place, assuming that you were starting from a condition of having no local state whatsoever... so we should probably get to the bottom of that rather than just papering over it with the change in #6540. |
I have a fix in #7320 which allows refreshing a local state with no resources. |
Still waiting on a review of #7320. |
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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
I'm currently working through a POC using CircleCI to manage plans & applies of Terraform state, using S3 as the remote backend. Circle won't be keeping the filesystem around, so relying on the
.terraform
folders locally to stick around isn't possible. When doing a plan (when a PR is opened), I run the following commands:terraform remote config [...]
terraform remote pull
terraform plan -out plan.out
First pass through worked fine and I could apply state, but if I test the condition where .terraform does not exist, I'm getting unexpected behaviors:
For giggles, I run pull just to make sure I'm not crazy:
The local state looks like this:
And the remote state in s3 looks like this:
I would have expected that
remote config
would've actually pulled the state, but it doesn't. For extra sanity, I also tried adding "-pull=true" while runningremote config
, just in case there was a documentation breakdown.I verified that everything works fine if I just pull the remote state:
I'm on 0.6.12, but it was happening on 0.6.11 as well.
The text was updated successfully, but these errors were encountered: