Skip to main content

Manipulating OpenTF State

OpenTF uses state data 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: