open
Open a workspace against a configuration — tofu init with its backend settings, plus tofu workspace select. The backend comes from the configuration’s own backend block; backend_config and backend_config_files supply only what it leaves out. Reads the state (no lock is held: the engine takes the state lock while a convergence runs) and reports its lineage, serial and resource count (state_list lists them) — no lineage and no serial means no statefile yet: the first up writes one. If a convergence already holds the workspace — one this server or an earlier one started — it is reported under convergence with what to do next: apply continues one paused at its approval point, up supersedes it, cancel ends it. var and var_file are kept for the workspace while it is open (names only are ever shown): every later tool on it reads the state with them, so a state-encryption passphrase or a value the backend block reads goes here, once, and each plan command’s own var lays over them. Omit workspace_alias for the default workspace; name one to open several, and pass it to every later tool. Opening a workspace already open under the same alias, the same way, returns it as it is; with var or var_file it replaces the values the workspace keeps, once the state reads with them.
Tiers: read · plan · apply · full
Annotations
Section titled “Annotations”| Annotation | Value |
|---|---|
title |
Open workspace |
readOnlyHint |
false |
destructiveHint |
true |
idempotentHint |
false |
openWorldHint |
true |
Arguments
Section titled “Arguments”| Name | Type | Required | Description |
|---|---|---|---|
config_alias |
string | no | Configuration whose backend this is, as registered by init (omit for the configuration init registered without an alias, ‘default’, however many others are registered). |
backend_type |
string | no | Backend type (e.g. ‘local’, ‘s3’) for a configuration that declares no backend of its own. Omit to use the declared backend — the normal case. A type contradicting a declared backend is refused; edit the declared block to move the store. |
backend_config |
object | no | Backend settings merged over the declared ones per key, these winning — ‘tofu init -backend-config=key=value’. The place for credentials and per-environment values the backend block deliberately leaves out; a configuration that declares its backend fully needs nothing here. |
backend_config_files |
array of string | no | Backend settings files (‘tofu init -backend-config=<file>’), in order, merged below backend_config. |
var |
object | no | Root input variable values — ‘tofu -var’ — kept for this workspace while it is open, in this server’s memory only: never written down, never shown back (status lists the names). Every later tool on the workspace uses them: state_list, output, show, taint, cancel and apply derive its backend and its state encryption with them, and each plan command lays its own var and var_file over them, name by name. The place for a state-encryption passphrase (passphrase = var.passphrase) and for a value the backend block reads. A string is the raw text a -var carries; any other JSON value is passed as its HCL literal. Opening the workspace again with var or var_file replaces them. |
var_file |
array of string | no | Variables files — ‘tofu -var-file’ — kept with var for this workspace, in order, below var, and read again at each use: name a file that holds a secret rather than reading the secret into the conversation. A relative path is relative to the configuration directory. |
workspace_name |
string | no | OpenTofu workspace name — a named state slot inside the backend, what terraform.workspace reads. Defaults to ‘default’. It addresses state a ‘tofu workspace select’ user created. |
workspace_alias |
string | no | Alias every later tool passes as workspace_alias. Omit for the default (unnamed) workspace; name one to open several at once. |
reconfigure |
boolean | no | Consent to re-binding this workspace’s state to a backend that differs from the one the engine recorded for it — ‘tofu init -reconfigure’. Taken at the next up (or other plan command). A copied statefile of another workspace is refused regardless. |
force_unlock |
boolean | no | Release a stale state lock now — ‘tofu force-unlock’. Only when you are certain no other process is using the workspace (a previous server died holding it). |
lock_id |
string | no | The lock to release, as the lock error names it; implies force_unlock. Remote (TFC/TFE/Scalr) backends want ‘<organization>/<workspace>’. |
Turf™ is a trademark of Turf LLC. Terraform® is a trademark of HashiCorp. Ansible® is a trademark of Red Hat, LLC, registered in the United States and other countries. Helm®, Kubernetes®, Prometheus® and OpenTelemetry® are registered trademarks, and Jaeger™ is a trademark, of the Linux Foundation. OpenTofu® and Model Context Protocol® are registered trademarks of LF Projects, LLC. All other trademarks are the property of their respective owners. Turf is not affiliated with, endorsed by, or sponsored by HashiCorp, IBM, Red Hat, the Linux Foundation, LF Projects or the OpenTofu project.
© 2026 Turf LLC. Free for individuals, education and small businesses within the Community limits, under the Turf Community Edition License 1.0. Government and larger organizations need a commerciallicense.turf.build · Discord ·GitHub