nerdexam
HashiCorp

TA-002-P · Question #225

A user has created three workspaces using the command line -prod, dev, and test. The user wants to create a fourth workspace named stage. Which command will the user execute to accomplish this?

The correct answer is A. terraform workspace new stage. The correct syntax for creating a new Terraform workspace is terraform workspace new <name>. So terraform workspace new stage creates the 'stage' workspace and automatically switches to it. Options B and C use invalid flag syntax (-new, -create). Option D uses 'create' which is…

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

Question

A user has created three workspaces using the command line -prod, dev, and test. The user wants to create a fourth workspace named stage. Which command will the user execute to accomplish this?

Options

  • Aterraform workspace new stage
  • Bterraform workspace -new stage
  • Cterraform workspace -create stage
  • Dterraform workspace create stage

How the community answered

(48 responses)
  • A
    90% (43)
  • B
    2% (1)
  • C
    2% (1)
  • D
    6% (3)

Explanation

The correct syntax for creating a new Terraform workspace is terraform workspace new <name>. So terraform workspace new stage creates the 'stage' workspace and automatically switches to it. Options B and C use invalid flag syntax (-new, -create). Option D uses 'create' which is not a valid subcommand - the correct subcommand is 'new'.

Topics

#Terraform CLI#Workspaces#Command syntax#terraform workspace new

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice