nerdexam
HashiCorp

TA-002-P · Question #200

After creating a new workspace "PROD" you need to run the command terraform select PROD to switch to it.

The correct answer is A. False. By default, when you create a new workspace you are automatically switched to it To create a new workspace and switch to it, you can use terraform workspace new <new_workspace_name>; to switch to a existing workspace you can use terraform workspace select…

Use the Terraform CLI (terraform plan, apply, destroy, fmt, init, validate, workspace, import, taint, providers, output)

Question

After creating a new workspace "PROD" you need to run the command terraform select PROD to switch to it.

Options

  • AFalse
  • BTrue

How the community answered

(34 responses)
  • A
    94% (32)
  • B
    6% (2)

Explanation

By default, when you create a new workspace you are automatically switched to it To create a new workspace and switch to it, you can use terraform workspace new <new_workspace_name>; to switch to a existing workspace you can use terraform workspace select <existing_workspace_name>; $ terraform workspace new example Created and switched to workspace "example"! You're now on a new, empty workspace. Workspaces isolate their state, so if you run "terraform plan" Terraform will not see any existing state for this configuration.

Topics

#Terraform workspaces#CLI commands#terraform workspace new#terraform select

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice