Recall & Review
beginner
What is a Terraform workspace?
A Terraform workspace is a way to have multiple instances of the same infrastructure configuration, each with its own state, allowing you to manage different environments like dev, test, and prod within the same directory.
Click to reveal answer
beginner
How does directory-based separation differ from using workspaces in Terraform?
Directory-based separation means creating separate folders for each environment with its own Terraform files and state, while workspaces use one directory but switch states internally to manage multiple environments.
Click to reveal answer
intermediate
What is a key advantage of using Terraform workspaces over directory-based separation?
Workspaces allow you to reuse the same configuration files for multiple environments, reducing duplication and making it easier to maintain consistent infrastructure setups.
Click to reveal answer
intermediate
What is a potential downside of using Terraform workspaces?
Workspaces can be confusing because the same configuration is used for all environments, so mistakes in variable values or state management can affect multiple environments if not handled carefully.
Click to reveal answer
intermediate
When might directory-based separation be preferred over workspaces?
Directory-based separation is preferred when environments have very different configurations or when teams want clear physical separation of code and state files to avoid accidental changes across environments.
Click to reveal answer
What does a Terraform workspace primarily manage?
✗ Incorrect
Terraform workspaces manage separate state files so you can have multiple environments using the same configuration.
Which method involves creating separate folders for each environment?
✗ Incorrect
Directory-based separation means using different folders for each environment.
What is a benefit of using workspaces instead of directories?
✗ Incorrect
Workspaces let you reuse the same configuration files for multiple environments.
Which is a risk when using Terraform workspaces?
✗ Incorrect
Because workspaces share the same config, applying changes to the wrong workspace can affect the wrong environment.
When is directory-based separation most useful?
✗ Incorrect
Directory-based separation is best when environments differ a lot and need separate configs.
Explain the difference between Terraform workspaces and directory-based separation.
Think about how state and configuration files are organized.
You got /4 concepts.
Describe a scenario where you would choose Terraform workspaces over directory-based separation.
Consider when reusing configuration is helpful.
You got /4 concepts.