Skip to content

Commit

Permalink
Merge pull request #32293 from hashicorp/backport/jspiker/workspace-d…
Browse files Browse the repository at this point in the history
…elete-rum-docs/marginally-rested-bream

Backport of Update workspace delete command docs to reference RUM vs empty state into v1.3
  • Loading branch information
alisdair committed Nov 25, 2022
2 parents 3a45fb0 + 3638870 commit 3159ad6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
4 changes: 3 additions & 1 deletion internal/command/workspace_delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,9 @@ Usage: terraform [global options] workspace delete [OPTIONS] NAME
Options:
-force Remove even a non-empty workspace.
-force Remove a workspace even if it is managing resources.
Terraform can no longer track or manage the workspace's
infrastructure.
-lock=false Don't hold a state lock during the operation. This is
dangerous if others might concurrently run commands
Expand Down
17 changes: 10 additions & 7 deletions website/docs/cli/commands/workspace/delete.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,23 @@ Usage: `terraform workspace delete [OPTIONS] NAME [DIR]`

This command will delete the specified workspace.

To delete an workspace, it must already exist, it must have an empty state,
and it must not be your current workspace. If the workspace state is not empty,
To delete a workspace, it must already exist, it must not be tracking resources,
and it must not be your current workspace. If the workspace is tracking resources,
Terraform will not allow you to delete it unless the `-force` flag is specified.

If you delete a workspace with a non-empty state (via `-force`), then resources
Additionally, different [backends](/language/settings/backends/configuration#backend-types) may implement other
restrictions on whether a workspace is considered safe to delete without the `-force` flag, such as whether the workspace is locked.

If you delete a workspace which is tracking resources (via `-force`), then resources
may become "dangling". These are resources that physically exist but that
Terraform can no longer manage. This is sometimes preferred: you want
Terraform to stop managing resources so they can be managed some other way.
Terraform can no longer manage. This is sometimes preferred: you may want
Terraform to stop managing resources, so they can be managed some other way.
Most of the time, however, this is not intended and so Terraform protects you
from getting into this situation.

The command-line flags are all optional. The only supported flag is:
The command-line flags are all optional. The only supported flags are:

* `-force` - Delete the workspace even if its state is not empty. Defaults to false.
* `-force` - Delete the workspace even if it is tracking resources. After deletion, Terraform can no longer track or manage the workspace's infrastructure. Defaults to false.
* `-lock=false` - Don't hold a state lock during the operation. This is
dangerous if others might concurrently run commands against the same
workspace.
Expand Down

0 comments on commit 3159ad6

Please sign in to comment.