1. [Home](<https://delaparra-services.nl/>) 
1. [Knowledge hub](<https://delaparra-services.nl/knowledge-hub>) 
1. [terraform.tfstate](<https://delaparra-services.nl/knowledge-hub/terraformtfstate>)

  

Category: Terraform 

# terraform.tfstate

  Explained by [Reinier de la Parra](<https://delaparra-services.nl/about>)  Updated November 25, 2026    

## What is terraform.tfstate?

 

terraform.tfstate: The default local state file. A JSON document; never edit it by hand — use the state subcommands. ` terraform.tfstate ` is the default local state file, a JSON document where Terraform records every resource it manages and its current attributes. It is created in your working folder when you use local state. That is fine for experiments, but risky for real infrastructure: it lives on one machine, has no locking and often contains secrets in plain text.

 

Definition source [Coders Lingo](<https://coderslingo.com/resources/open-dataset/>), [CC BY 4.0](<https://creativecommons.org/licenses/by/4.0/>)

 

## Frequently asked questions about terraform.tfstate

  

### What should you keep in mind with terraform.tfstate?

 

Never edit it by hand. Use ` terraform state ` subcommands, or ` moved ` and ` import ` blocks, for any changes. Never commit it to Git; add ` *.tfstate ` and ` *.tfstate.backup ` to ` .gitignore `. For anything shared or long-lived, move to a remote backend with locking and versioning. ` terraform init -migrate-state ` copies existing local state to the new backend.

    

### What does an example of terraform.tfstate look like?

 

```
cat terraform.tfstate | jq .resources
```

 

## At a glance

   CategoryTerraform Explained by[Reinier de la Parra](<https://delaparra-services.nl/about>) UpdatedNovember 25, 2026

 

## More Terraform terms

 

- [taint](<https://delaparra-services.nl/knowledge-hub/taint-terraform>) 
- [ternary](<https://delaparra-services.nl/knowledge-hub/ternary>) 
- [terraform block](<https://delaparra-services.nl/knowledge-hub/terraform-block>) 
- [validate](<https://delaparra-services.nl/knowledge-hub/validate>) 
- [variable](<https://delaparra-services.nl/knowledge-hub/variable>) 
- [workspace](<https://delaparra-services.nl/knowledge-hub/workspace>)

 

[All terms starting with T](<https://delaparra-services.nl/knowledge-hub#letter-t>)

 

## Skills

 

- ### Terraform safe workflow

 

Use when running or changing Terraform (or OpenTofu) - init, fmt, validate, plan, apply, destroy, import, state mv/rm, refresh, workspaces, remote backends, state locking, drift, taint/-replace. Enforces a plan-review-apply workflow and protects state.

 [View skill](<https://delaparra-services.nl/skills/terraform-safe-workflow>) [Download zip](<https://delaparra-services.nl/skills/terraform-safe-workflow/download>) 
- ### Terraform Module Library

 

Build reusable Terraform modules for AWS, Azure, GCP, and OCI infrastructure following infrastructure-as-code best practices. Use when creating infrastructure modules, standardizing cloud provisioning, or implementing reusable IaC components.

 [View skill](<https://delaparra-services.nl/skills/terraform-module-library>) [Download zip](<https://delaparra-services.nl/skills/terraform-module-library/download>)

 [Download all skills (zip)](<https://delaparra-services.nl/knowledge-hub/terraformtfstate/skills.zip>)

 

## Manuals

 

- [Kubernetes and Terraform: do you need them?](<https://delaparra-services.nl/manuals/kubernetes-en-terraform-heb-je-het-nodig>)

 

## Related services

 

- [Custom software and web applications](<https://delaparra-services.nl/services#service-03>)

Perhaps your customers need somewhere to download their invoices, or your staff are managing bookings in a spreadsheet.

 

## Need any help?

 

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.

  [Get in touch](<https://delaparra-services.nl/availability>)

[HTML version](https://delaparra-services.nl/knowledge-hub/terraformtfstate)
