Hi,
When I am using S3 backend, what exactly terraform init -reconfigure is doing? Will it discard local state an pull version from the bucket (act as an opposite of force-copy) or it's doing something else?
Hi @s-maj,
The -reconfigure flag is there to allow one to modify the backend configuration during init, without loading the previous backend config or state for comparison. It's specifically meant to avoid migrating the state, while still saving the backend config from the config files.
For example, if you needed to change the dyanamodb_table value in the backend config because the table was no longer accessible, you could use the -reconfigure flag to change the saved config value without terraform attempting to check the remote state, which would fail.
This of course allows you to bypass the state migration and point the backend to an entirely new state file without confirmation, which may be desired, but use the usual caution and take backups as needed.
Cool, thanks @jbardin for clarification.
might be useful to have this in the docs for terraform init. I know it's in terraform init -help
Hi @b-dean,
The -reconfigure flag is mentioned under Backend Initialization. That page however could probably use some reformatting to make all the options more discoverable.
Thanks!
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.
Most helpful comment
Hi @b-dean,
The
-reconfigureflag is mentioned under Backend Initialization. That page however could probably use some reformatting to make all the options more discoverable.Thanks!