Peter
Peter

Reputation: 564

terraform .tfstate file doesn't change after removing itens

For some unknown reason, the removed items remain in the state file after I remove from the .tfstate file.

CASE:

  1. downloaded my state file(my_statefile.tfstate) from cloud_bucket where it's stored
  2. In the application cloned repo, I placed the file in the folder that contains the items I want to remove from the state
  3. ran terraform init
  4. ran terraform state list -state=my_statefile.tfstate
output:
item 1
item 2
item 3
  1. ran terraform state rm -state=my_statefile.tfstate item1
  2. ran terraform state list -state=my_statefile.tfstate
output:
item 2
item 3

However when I inspect the file with cat my_statefile.tfstate

the item 1 is still there..

I even created a empty file called empty.tfstate and tried the flow described above and got the same results which is kind of odd.

Does anyone have any clues on what can be happening here?

Upvotes: 0

Views: 39

Answers (0)

Related Questions