Recall & Review
beginner
What is a workspace in Terraform?
A workspace in Terraform is a separate instance of your infrastructure state. It allows you to manage multiple environments (like development, staging, production) using the same configuration but with isolated states.
Click to reveal answer
beginner
Why use naming conventions for Terraform workspaces?
Naming conventions help keep workspaces organized and easy to identify. They reduce confusion, prevent mistakes like deploying to the wrong environment, and make collaboration smoother.
Click to reveal answer
beginner
Give an example of a simple workspace naming convention.
A simple naming convention could be: environment-purpose. For example,
dev-webapp for the development environment of a web application, or prod-db for the production database.Click to reveal answer
intermediate
What characters should you avoid in Terraform workspace names?
Avoid spaces, special characters, and uppercase letters. Use only lowercase letters, numbers, and hyphens (-) to keep names simple and compatible.
Click to reveal answer
intermediate
How does consistent workspace naming improve team collaboration?
Consistent names make it easy for everyone to understand which environment they are working on. It reduces errors, speeds up onboarding, and helps automate scripts that depend on workspace names.
Click to reveal answer
What is the main purpose of Terraform workspaces?
✗ Incorrect
Terraform workspaces allow you to manage multiple isolated states, such as different environments, using the same configuration.
Which of the following is a good workspace name?
✗ Incorrect
Use lowercase letters and hyphens only. 'dev-webapp' follows the best practice for workspace naming.
Why should you avoid spaces in workspace names?
✗ Incorrect
Spaces can cause errors or require extra handling in command-line tools like Terraform.
What does a workspace name like 'staging-api' tell you?
✗ Incorrect
'staging-api' indicates the workspace is for the staging environment of the API service.
How does a naming convention help automation?
✗ Incorrect
Consistent naming lets automation scripts detect and use the correct workspace without manual input.
Explain why using a clear workspace naming convention is important in Terraform.
Think about how names help you and your team avoid confusion.
You got /4 concepts.
Describe a simple and effective workspace naming convention you could use.
Combine environment and project with a dash.
You got /4 concepts.