TA-002-P · Question #306
A user creates three workspaces from the command line -prod, dev, and test. Which of the following commands will the user run to switch to the dev workspace?
The correct answer is B. terraform workspace select dev. The correct syntax to switch between Terraform workspaces is terraform workspace select <workspace-name>. So the correct command is terraform workspace select dev. The other options are invalid: (A) terraform workspace dev is not a valid subcommand syntax. (C) terraform…
Question
A user creates three workspaces from the command line -prod, dev, and test. Which of the following commands will the user run to switch to the dev workspace?
Options
- Aterraform workspace dev
- Bterraform workspace select dev
- Cterraform workspace -switch dev
- Dterraform workspace switch dev
How the community answered
(26 responses)- B92% (24)
- C4% (1)
- D4% (1)
Explanation
The correct syntax to switch between Terraform workspaces is terraform workspace select <workspace-name>. So the correct command is terraform workspace select dev. The other options are invalid: (A) terraform workspace dev is not a valid subcommand syntax. (C) terraform workspace -switch dev uses a flag format that does not exist. (D) terraform workspace switch dev - while 'switch' is intuitive, the actual subcommand is select, not switch'. Other common workspace commands include terraform workspace list, terraform workspace new <name>, and terraform workspace show`.
Topics
Community Discussion
No community discussion yet for this question.