mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-02-16 16:00:37 -05:00
* 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>
33 lines
1.3 KiB
Plaintext
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.
|