0
0
Terraformcloud~10 mins

Creating and switching workspaces in Terraform - Interactive Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a new Terraform workspace named "dev".

Terraform
terraform workspace [1] dev
Drag options to blanks, or click blank then click option'
Acreate
Bselect
Cdelete
Dlist
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'select' instead of 'create' will switch workspaces but not create one.
Using 'delete' will remove a workspace, not create it.
2fill in blank
medium

Complete the code to switch to the existing Terraform workspace named "prod".

Terraform
terraform workspace [1] prod
Drag options to blanks, or click blank then click option'
Alist
Bselect
Cshow
Dcreate
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'create' will try to make a new workspace instead of switching.
Using 'list' only shows available workspaces.
3fill in blank
hard

Fix the error in the command to list all Terraform workspaces.

Terraform
terraform workspace [1]
Drag options to blanks, or click blank then click option'
Aselect
Bshow
Clist
Dcreate
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'show' will display the current workspace only.
Using 'select' requires a workspace name.
4fill in blank
hard

Fill both blanks to create and then switch to a workspace named "staging".

Terraform
terraform workspace [1] staging && terraform workspace [2] staging
Drag options to blanks, or click blank then click option'
Acreate
Bselect
Cdelete
Dlist
Attempts:
3 left
💡 Hint
Common Mistakes
Trying to select before creating the workspace causes an error.
Using 'delete' or 'list' in these commands is incorrect.
5fill in blank
hard

Fill all three blanks to create a workspace named "test", switch to it, and then list all workspaces.

Terraform
terraform workspace [1] test && terraform workspace [2] test && terraform workspace [3]
Drag options to blanks, or click blank then click option'
Acreate
Bselect
Clist
Dshow
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'show' instead of 'list' will only show the current workspace.
Switching before creating causes errors.