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

Terraform init prompt message when changing configuration project #36066

Open
avachette opened this issue Nov 20, 2024 · 2 comments
Open

Terraform init prompt message when changing configuration project #36066

avachette opened this issue Nov 20, 2024 · 2 comments
Labels
cli enhancement new new issue not yet triaged

Comments

@avachette
Copy link

avachette commented Nov 20, 2024

Terraform Version

$ terraform version
Terraform v1.8.4
on linux_arm64

Your version of Terraform is out of date! The latest version
is 1.9.8. You can update by downloading from https://www.terraform.io/downloads.html

Terraform Configuration Files

$ terraform init --backend-config=./states/po.conf

Initializing the backend...
Initializing modules...
╷
│ 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".
╵

Debug Output

Not relevant here.

Expected Behavior

│ If you wish to change the current configuration with no changes to the state, use "terraform
│ init -reconfigure".

Actual Behavior

│ If you wish to store the current configuration with no changes to the state, use "terraform
│ init -reconfigure".

Steps to Reproduce

$ terraform init --backend-config=./states/pp.conf

Initializing the backend...
Initializing modules...
╷
│ 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".
╵

Additional Context

I found a bit misleading the sentence using the word store because in the end it's just changing the configuration of terraform without touching the state part.

I can make the relevant PR in this file:

If it seems appropriate for you.

References

No response

@avachette avachette added bug new new issue not yet triaged labels Nov 20, 2024
@jbardin
Copy link
Member

jbardin commented Nov 21, 2024

Hi @avachette,

As for the reasoning of the wording; the act of changing the configuration is replacing the previous configuration by storing the current configuration. Both words describe the same action from a slightly different point of view.

@avachette
Copy link
Author

Indeed but from a PoV of the user, we don't really know what is stored?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli enhancement new new issue not yet triaged
Projects
None yet
Development

No branches or pull requests

2 participants