Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to select the default Terraform workspace.
Terraform
terraform workspace select [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using workspace names like 'prod' or 'dev' which are not default.
Forgetting to specify the workspace name.
✗ Incorrect
The default workspace in Terraform is named default. Selecting it uses the default environment.
2fill in blank
mediumComplete the code to create a new workspace named 'test'.
Terraform
terraform workspace [1] test Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'create' instead of 'new'.
Using 'select' which switches but does not create.
✗ Incorrect
Use terraform workspace new to create a new workspace.
3fill in blank
hardFix the error in the command to list all workspaces.
Terraform
terraform workspace [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'show' or 'status' which are invalid for listing workspaces.
Using 'ls' when the full command 'list' is expected here.
✗ Incorrect
The correct command to list workspaces is terraform workspace list or its shorthand ls. Here, 'list' is the standard command.
4fill in blank
hardFill both blanks to create and switch to a new workspace named 'prod'.
Terraform
terraform workspace [1] prod && terraform workspace [2] prod
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'delete' or 'list' instead of 'new' or 'select'.
Switching before creating the workspace.
✗ Incorrect
First, create the workspace with new, then switch to it with select.
5fill in blank
hardFill all three blanks to delete the workspace named 'old' and switch to default.
Terraform
terraform workspace [1] old && terraform workspace [2] [3]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Trying to delete the default workspace.
Not switching to a workspace before deleting another.
✗ Incorrect
Delete the 'old' workspace, then switch to the 'default' workspace.