Skip to content

delete

Delete a workspace’s state from the backend — tofu workspace delete. The backend is derived from the configuration as open derives it, resolved against the name being deleted, with this call’s var and var_file for a backend block or a state encryption that reads a variable (the state is read to count what it holds). Refused for ‘default’, for a name the backend does not list (list shows them), for a workspace open here, for one a convergence holds, and for one whose state holds resources unless force is set (which orphans them). Never touches a configuration directory.

Tiers: full

Annotation Value
title Delete workspace
readOnlyHint false
destructiveHint true
idempotentHint true
openWorldHint true
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 for this call only — ‘tofu -var’: what the backend block and the state encryption read. Not kept. A string is the raw text a -var carries; any other JSON value is passed as its HCL literal.
var_file array of string no Variables files for this call only — ‘tofu -var-file’, in order, below var. A relative path is relative to the configuration directory.
workspace_name string yes Workspace to delete — a named state slot inside the backend. Cannot be ‘default’.
force boolean no Delete even if the workspace’s state holds resources (orphans that infrastructure).

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