0
0
Terraformcloud~5 mins

Default workspace in Terraform - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the default workspace in Terraform?
The default workspace is the initial workspace Terraform creates automatically. It holds the state for your infrastructure unless you create and switch to other workspaces.
Click to reveal answer
beginner
How does the default workspace relate to Terraform state files?
The default workspace stores its state in the main state file (usually terraform.tfstate). Other workspaces have separate state files.
Click to reveal answer
intermediate
Can you rename or delete the default workspace in Terraform?
No, the default workspace cannot be renamed or deleted. It always exists as the base workspace.
Click to reveal answer
beginner
How do you switch from the default workspace to another workspace?
Use the command terraform workspace select <workspace-name> to switch from the default workspace to another existing workspace.
Click to reveal answer
intermediate
Why use multiple workspaces instead of just the default workspace?
Multiple workspaces let you manage different environments (like dev, test, prod) with separate states, avoiding conflicts and making management easier.
Click to reveal answer
What is the name of the initial workspace Terraform creates by default?
Adefault
Bmain
Cbase
Dprimary
Can you delete the default workspace in Terraform?
ANo, it always exists
BOnly if no resources exist
CYes, anytime
DOnly with special permissions
Which command switches to a different workspace?
Aterraform workspace new
Bterraform workspace init
Cterraform workspace select
Dterraform workspace delete
Where does the default workspace store its state?
AIn a separate file per workspace
BIn the main terraform.tfstate file
CIn the cloud only
DIt does not store state
Why might you create multiple workspaces instead of using only the default?
ATo avoid using state files
BTo speed up Terraform runs
CTo reduce Terraform file size
DTo manage different environments separately
Explain what the default workspace is and its role in Terraform state management.
Think about how Terraform keeps track of your infrastructure by default.
You got /4 concepts.
    Describe how and why you would use multiple workspaces instead of just the default workspace.
    Consider managing dev, test, and prod environments.
    You got /4 concepts.