1. [Home](<https://delaparra-services.nl/>) 
1. [Knowledge hub](<https://delaparra-services.nl/knowledge-hub>) 
1. [state file](<https://delaparra-services.nl/knowledge-hub/state-file>)

  

Category: Terraform 

# state file

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

## What is state file?

 

state file: Terraform’s record of the real resources it manages and how they map to your config. Source of truth for what exists. The state file is Terraform's record of the infrastructure it manages. It maps each resource in your configuration to a real object, such as a server ID or bucket name, and stores its current attributes.

 

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 state file

  

### How is state file used in practice?

 

Terraform compares your configuration, the state and the real infrastructure to work out what to change. Without the state, it would not know which existing resources belong to it.

    

### What should you keep in mind with state file?

 

Treat the state file as sensitive and important. It often contains secrets in plain text, such as database passwords, so keep it in a secured remote backend, not in Git. Enable versioning, so you can recover from mistakes, and use locking so two people cannot write it at once. ` terraform state list ` shows what is tracked, and editing the file by hand is almost never the right fix.

    

### What does an example of state file look like?

 

```
terraform state list
```

 

## At a glance

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

 

## More Terraform terms

 

- [refresh](<https://delaparra-services.nl/knowledge-hub/refresh>) 
- [remote backend](<https://delaparra-services.nl/knowledge-hub/remote-backend>) 
- [resource](<https://delaparra-services.nl/knowledge-hub/resource>) 
- [state lock](<https://delaparra-services.nl/knowledge-hub/state-lock>) 
- [state mv / rm](<https://delaparra-services.nl/knowledge-hub/state-mv-rm>) 
- [taint](<https://delaparra-services.nl/knowledge-hub/taint-terraform>)

 

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

 

## 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/state-file/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/state-file)
