Terraform state

Terraform's record, usually a JSON file called terraform.tfstate, mapping each resource in the configuration to the real object it created.

State files can hold secrets and losing or corrupting one breaks management of real resources.

In more detail

State is how Terraform knows which real objects it owns, so plans can compare configuration, state and reality. It records every attribute, including passwords and keys, in plain text, even for values marked sensitive. Never edit it by hand, keep it out of Git, back it up, and share it through a remote backend with locking.

Related terms

Related guides

Taught in

References

Certification courses