github.com/kcburge/terraform@v0.11.12-beta1/website/docs/commands/workspace/new.html.md (about) 1 --- 2 layout: "commands-workspace" 3 page_title: "Command: workspace new" 4 sidebar_current: "docs-workspace-sub-new" 5 description: |- 6 The terraform workspace new command is used to create a new workspace. 7 --- 8 9 # Command: workspace new 10 11 The `terraform workspace new` command is used to create a new workspace. 12 13 ## Usage 14 15 Usage: `terraform workspace new [NAME]` 16 17 This command will create a new workspace with the given name. A workspace with 18 this name must not already exist. 19 20 If the `-state` flag is given, the state specified by the given path 21 will be copied to initialize the state for this new workspace. 22 23 The command-line flags are all optional. The only supported flag is: 24 25 * `-state=path` - Path to a state file to initialize the state of this environment. 26 27 ## Example: Create 28 29 ``` 30 $ terraform workspace new example 31 Created and switched to workspace "example"! 32 33 You're now on a new, empty workspace. Workspaces isolate their state, 34 so if you run "terraform plan" Terraform will not see any existing state 35 for this configuration. 36 ``` 37 38 ## Example: Create from State 39 40 To create a new workspace from a pre-existing local state file: 41 42 ``` 43 $ terraform workspace new -state=old.terraform.tfstate example 44 Created and switched to workspace "example". 45 46 You're now on a new, empty workspace. Workspaces isolate their state, 47 so if you run "terraform plan" Terraform will not see any existing state 48 for this configuration. 49 ```