Terraform Associate (004) · Free practice question 3 of 12
Default CLI workspace cannot be deleted
An engineer at Tresco Mobile runs terraform workspace delete default to clean up a working directory. What happens?
- A.Terraform deletes the default workspace and its state
- B.Terraform renames the default workspace to the next workspace in alphabetical order
- C.Terraform deletes every workspace except default
- D.Terraform refuses, because the default workspace always exists and cannot be deleted
Show answer and explanation
Correct answer: D. Terraform refuses, because the default workspace always exists and cannot be deleted
Why: Every initialized working directory has a workspace named default, which cannot be deleted. Other workspaces can be deleted with terraform workspace delete, normally after switching away from them. Terraform never renames workspaces or deletes other workspaces as a side effect.
More free Terraform Associate (004) questions
- Skipping refresh during plan
- Local state backup file
- Local execution mode in HCP Terraform
- Self-hosted agents for private networks
- Run triggers between workspaces
- Health assessments for drift detection
- Dynamic provider credentials with OIDC
- terraform_data triggers_replace argument
- Provisioners as a last resort
- Running tests with terraform test
- Lock file hashes for multiple platforms