atmos terraform workspace delete
Use this command to delete a Terraform workspace for an Atmos component in a stack.
Usage
Execute the terraform workspace delete command like this:
atmos terraform workspace delete <component> -s <stack> [workspace-name] [options]
This command deletes a Terraform workspace. The workspace must be empty (contain no resources) before it can be deleted. You cannot delete the currently selected workspace.
A workspace must be empty before it can be deleted. Use terraform destroy to remove all resources first.
Run atmos terraform workspace delete --help to see all the available options
Examples
# Delete a workspace (auto-calculated from stack context)
atmos terraform workspace delete vpc -s dev
# Delete a specific workspace by name
atmos terraform workspace delete vpc -s dev my-workspace
# Force delete a non-empty workspace
atmos terraform workspace delete vpc -s dev my-workspace -force
Arguments
component(required)Atmos terraform component.
workspace-name(optional)The name of the workspace to delete. If not provided, Atmos calculates the workspace name from the stack context.
Flags
--stack(alias-s) (required)Atmos stack.
--dry-run(optional)Show what would be executed without actually running the command.
atmos terraform workspace delete vpc -s dev --dry-run--skip-init(optional)Skip running
terraform initbefore executing the command.atmos terraform workspace delete vpc -s dev --skip-init
Native Terraform Flags
The atmos terraform workspace delete command supports native terraform workspace delete flags. Pass them directly or use -- to separate Atmos flags from Terraform flags.
-forceForce deletion even if the workspace has resources. Use with caution.
atmos terraform workspace delete vpc -s dev -force my-workspace-lock=trueLock the state file when locking is supported. Defaults to
true.atmos terraform workspace delete vpc -s dev -lock=false my-workspace-lock-timeout=DURATIONDuration to retry a state lock. Defaults to
0s.atmos terraform workspace delete vpc -s dev -lock-timeout=30s my-workspace
See Also
atmos terraform workspace- Workspace management overviewatmos terraform workspace list- List workspacesatmos terraform workspace new- Create a new workspace