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 state rm - deletes everything #16240

Closed
kjhosein opened this issue Oct 2, 2017 · 5 comments
Closed

Terraform state rm - deletes everything #16240

kjhosein opened this issue Oct 2, 2017 · 5 comments

Comments

@kjhosein
Copy link

kjhosein commented Oct 2, 2017

Terraform Version

0.9.11

Expected Behavior

I wouldn't have imagined that terraform state rm without arguments would delete all of the resources in the terraform.tfstate file. I think this should be treated as an erroneous command by the user.

Actual Behavior

TF removed all of the resource in the terraform.tfstate file.
If remote state is configured, it'll also sync the now bare tfstate up to the remote location.

Steps to Reproduce

terraform state rm

@jbardin
Copy link
Member

jbardin commented Oct 2, 2017

Thanks for filing the issue.

This is fixed in current releases by #15479.

@jbardin jbardin closed this as completed Oct 2, 2017
@alwaysastudent
Copy link

How to remove all ?

@padamczewski
Copy link

@alwaysastudent:
terraform state rm "" as per this comment

@rivernews
Copy link

@padamczewski
Unfortunately when I run terraform state rm "", I got the following error:

Error: Variable name required

  on  line 1:
  (source code not available)

Must begin with a variable name.

I'm on terraform 0.12.6 by the way.

@ghost
Copy link

ghost commented Nov 22, 2019

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.

@ghost ghost locked and limited conversation to collaborators Nov 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants