Skip to content
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

Document terraform help from Yuvi someplace suitable #2401

Open
consideRatio opened this issue Mar 22, 2023 · 3 comments
Open

Document terraform help from Yuvi someplace suitable #2401

consideRatio opened this issue Mar 22, 2023 · 3 comments

Comments

@consideRatio
Copy link
Member

Erik wrote:

(base) ➜  gcp git:(master) terraform init          

Initializing the backend...
╷
│ Error: Backend configuration changed
│ 
│ A change in the backend configuration has been detected, which may require migrating existing state.
│ 
│ If you wish to attempt automatic migration of the state, use "terraform init -migrate-state".
│ If you wish to store the current configuration with no changes to the state, use "terraform init -reconfigure".
╵

Should I do terraform init -migrate-state here? I'm not sure what this is about.

Yuvi wrote:

ah, look for hidden files in your current directory
you most likely do not want -migrate-state
this usually means terraform is not looking for state files where it should - which is on GCS remotely, but locally.

Erik wrote:
Ah
I moved away my found .terraform folder, and did (from terraform/gcp): terraform init -backend-config=backends/default-backend.hcl


This resolved the situation, but I don't understand the details here. What caused this? Had I made changes to terraform state that wasn't captured by the remote state or similar?

@consideRatio consideRatio changed the title Document terraform help from Yuvi Document terraform help from Yuvi someplace suitable Mar 22, 2023
@yuvipanda
Copy link
Member

Had I made changes to terraform state that wasn't captured by the remote state or similar?

Most likely not, as terraform prints out this error precisely to prevent that from happening.

@yuvipanda
Copy link
Member

I just ran into this again because I upgraded my terraform version.

1 similar comment
@yuvipanda
Copy link
Member

I just ran into this again because I upgraded my terraform version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs Shaping / Refinement
Development

No branches or pull requests

2 participants