Update workspace delete command docs and help to reference RUM instead of non-empty state

This commit is contained in:
Jarrett Spiker 2022-10-11 15:51:17 -04:00
parent 6b290cf163
commit 9d2e8a4c7e
2 changed files with 13 additions and 8 deletions

View File

@ -210,7 +210,7 @@ Usage: terraform [global options] workspace delete [OPTIONS] NAME
Options:
-force Remove even a non-empty workspace.
-force Remove even a workspace with resources under management.
-lock=false Don't hold a state lock during the operation. This is
dangerous if others might concurrently run commands

View File

@ -13,20 +13,25 @@ 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 have resources under management,
and it must not be your current workspace. If the workspace has resources under management,
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
Workspaces with resources under management (RUM) are workspaces which manage resources that physically exist.
This means that the workspace has a non-empty state.
Additionally, different [backends](/language/settings/backends/configuration#backend-types) may implement other
restrictions on whether a workspace is considered to have RUM, such as whether the workspace is locked.
If you delete a workspace with resources under management (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 has resources under management. 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.