Files
opentf/website/docs/cli/state/index.mdx
Kuba Martin 4d665a0091 Update website/docs/cli. (#171)
* Initial renaming, rewriting and cleaning up wave for the CLI docs.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* More renaming.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* More renaming.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* More renaming.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* Remove tutorial references.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* Post-review fixes.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

---------

Signed-off-by: Jakub Martin <kubam@spacelift.io>
2023-08-25 11:09:18 +02:00

33 lines
1.3 KiB
Plaintext

---
page_title: Manipulating State - OpenTF CLI
description: >-
State data tracks which real-world object corresponds to each resource.
Inspect state, move or import resources, and more.
---
# Manipulating OpenTF State
OpenTF uses [state data](/opentf/language/state) to remember which
real-world object corresponds to each resource in the configuration;
this allows it to modify an existing object when its resource declaration
changes.
OpenTF updates state automatically during plans and applies. However, it's
sometimes necessary to make deliberate adjustments to OpenTF's state data,
usually to compensate for changes to the configuration or the real managed
infrastructure.
OpenTF CLI supports several workflows for interacting with state:
- [Inspecting State](/opentf/cli/state/inspect)
- [Forcing Re-creation](/opentf/cli/state/taint)
- [Moving Resources](/opentf/cli/state/move)
- Importing Pre-existing Resources (documented in the
[Importing Infrastructure](/opentf/cli/import) section)
- [Disaster Recovery](/opentf/cli/state/recover)
~> **Important:** Modifying state data outside a normal plan or apply can cause
OpenTF to lose track of managed resources, which might waste money, annoy
your colleagues, or even compromise the security of your operations. Make sure
to keep backups of your state data when modifying state out-of-band.