github.com/hugorut/terraform@v1.1.3/website/docs/cli/state/index.mdx (about) 1 --- 2 page_title: Manipulating State - Terraform CLI 3 description: >- 4 State data tracks which real-world object corresponds to each resource. 5 Inspect state, move or import resources, and more. 6 --- 7 8 # Manipulating Terraform State 9 10 > **Hands-on:** Try the [Manage Resources in Terraform State](https://learn.hashicorp.com/tutorials/terraform/state-cli?utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS) tutorial on HashiCorp Learn. 11 12 Terraform uses [state data](/language/state) to remember which 13 real-world object corresponds to each resource in the configuration; 14 this allows it to modify an existing object when its resource declaration 15 changes. 16 17 Terraform updates state automatically during plans and applies. However, it's 18 sometimes necessary to make deliberate adjustments to Terraform's state data, 19 usually to compensate for changes to the configuration or the real managed 20 infrastructure. 21 22 Terraform CLI supports several workflows for interacting with state: 23 24 - [Inspecting State](/cli/state/inspect) 25 - [Forcing Re-creation (Tainting)](/cli/state/taint) 26 - [Moving Resources](/cli/state/move) 27 - Importing Pre-existing Resources (documented in the 28 [Importing Infrastructure](/cli/import) section) 29 - [Disaster Recovery](/cli/state/recover) 30 31 ~> **Important:** Modifying state data outside a normal plan or apply can cause 32 Terraform to lose track of managed resources, which might waste money, annoy 33 your colleagues, or even compromise the security of your operations. Make sure 34 to keep backups of your state data when modifying state out-of-band.