Recall & Review
beginner
What is a Terraform workspace?
A Terraform workspace is like a separate environment where you can manage different versions of your infrastructure independently, similar to having different folders for different projects.
Click to reveal answer
beginner
How do you create a new workspace in Terraform?
Use the command
terraform workspace new <workspace_name> to create a new workspace.Click to reveal answer
beginner
How can you switch to an existing workspace?
Use
terraform workspace select <workspace_name> to switch to an existing workspace.Click to reveal answer
beginner
What command lists all available Terraform workspaces?
Use
terraform workspace list to see all workspaces in your current Terraform project.Click to reveal answer
intermediate
Why use Terraform workspaces instead of separate projects?
Workspaces let you manage multiple environments (like dev, test, prod) in the same project without copying files, making it easier to keep infrastructure consistent and organized.Click to reveal answer
Which command creates a new Terraform workspace?
✗ Incorrect
The command
terraform workspace new <name> creates a new workspace.How do you switch to an existing workspace named 'test'?
✗ Incorrect
Use
terraform workspace select test to switch to the 'test' workspace.What does
terraform workspace list show?✗ Incorrect
It lists all workspaces available in the current Terraform project.
Why might you use workspaces in Terraform?
✗ Incorrect
Workspaces help manage different environments independently within the same project.
What happens if you run
terraform workspace select with a workspace name that does not exist?✗ Incorrect
Terraform returns an error because the workspace does not exist.
Explain how to create and switch between Terraform workspaces.
Think of workspaces as separate folders for different environments.
You got /3 concepts.
Describe why using Terraform workspaces can be helpful in managing infrastructure.
Imagine managing different rooms in the same house instead of building new houses.
You got /4 concepts.