TA-002-P · Question #357
TA-002-P Question #357: Real Exam Question with Answer & Explanation
The correct answer is C: It has its own state file. Each Terraform workspace manages its own isolated state file, allowing different environments (like development, staging, production) to be deployed from the same configuration.
Question
You have decided to create a new Terraform workspace to deploy a development environment. What is different about this workspace?
Options
- AIt uses a different branch of code
- BIt uses a different backend
- CIt has its own state file
- DIt pulls in a different terraform.tvars file
Explanation
Each Terraform workspace manages its own isolated state file, allowing different environments (like development, staging, production) to be deployed from the same configuration.
Common mistakes.
- A. Workspaces operate on the same codebase; using a different branch would typically imply a different version of the configuration, not just a different workspace.
- B. Workspaces share the same backend configuration, but within that backend, each workspace gets its own isolated state.
- D. While you might use different
terraform.tfvarsfiles with different workspaces, this is a common practice, not an inherent difference about the workspace itself; the core difference is the state file.
Concept tested. Terraform workspaces and state management
Reference. https://developer.hashicorp.com/terraform/cli/commands/workspace
Topics
Community Discussion
No community discussion yet for this question.