Using Terraform CLI, how do you delete a workspace?
Experience Level: Junior
Tags: Terraform
Answer
Run the following command:
terraform workspace delete your-workspace
Before you can delete the workspace, you need to switch to a different workspace.
Related Terraform job interview questions
Using Terraform CLI, how do you display a name of the current workspace?
Terraform JuniorUsing Terraform CLI, how do you switch to a different workspace?
Terraform JuniorUsing Terraform CLI, how do you create a new workspace?
Terraform JuniorUsing Terraform CLI, how do you display list of Terraform workspaces?
Terraform JuniorUsing Terraform CLI, how do you update the state file of your infrastructure with metadata that matches the physical resources they are tracking?
Terraform Junior