If using remote state has any considerations been made to removing the local state file, and only keeping track of it in memory? Based on what is sometimes sensitive information in the statefile I could see a benefit in removing the local state file and only using in-memory state.
Any specific reasons this has not been considered or implemented?
Hi @pfremm,
I'm not sure what you mean exactly. If you're using remote state, then terraform works how you describe. There is no working local copy of the state unless an error is encountered when saving the remote state.
I think @jbardin that what @pfremm means is what happens when already working on an existing project and switching to a remote backend afterwards ? The local tfstate file might still have 'sensitive' information ? (correct me if i'm wrong @pfremm )
@peterver, Terraform already does that too! If you migrate the local state to a remote state during init, the local state is removed. However, if you don't let terraform migrate the state and manually set it up yourself, terraform will not touch the local state since it can't know what you intend to do with that file.
Just tested locally and indeed it does @jbardin, I stand corrected. In that case @pfremm could you expand on your idea :D ?
Hello again!
We didn't hear back from you, so I'm going to close this in the hope that a previous response gave you the information you needed. If not, please do feel free to re-open this and leave another comment with the information my human friends requested above. 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
@peterver, Terraform already does that too! If you migrate the local state to a remote state during init, the local state is removed. However, if you don't let terraform migrate the state and manually set it up yourself, terraform will not touch the local state since it can't know what you intend to do with that file.