Terraform: Considered removal of local state

Created on 3 May 2018  ยท  6Comments  ยท  Source: hashicorp/terraform

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?

question

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.

All 6 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

franklinwise picture franklinwise  ยท  3Comments

sprokopiak picture sprokopiak  ยท  3Comments

rjinski picture rjinski  ยท  3Comments

ketzacoatl picture ketzacoatl  ยท  3Comments

rkulagowski picture rkulagowski  ยท  3Comments