Terraform enables you to safely and predictably create, change, and improve infrastructure. It is a source-available tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.
When creating a terraform workspace using the CLI, and providing an existing state file with the -state=<path> argument, a misleading success message states that a subsequent terraform plan will operate on an empty state.
The success message when creating a workspace and populating with an existing state should reflect the plans execution against that state.
Terraform Version
Terraform v0.14.5
Terraform Configuration Files
# this is a CLI issue, not a config issue
Debug Output
Crash Output
Expected Behavior
A message stating the workspace has been created with the provided state
Actual Behavior
Created and switched to workspace "xxx"!
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.
Steps to Reproduce
terraform workspace new -state=<somestate.tf> newname
When creating a terraform workspace using the CLI, and providing an existing state file with the
-state=<path>
argument, a misleading success message states that a subsequent terraform plan will operate on an empty state.The success message when creating a workspace and populating with an existing state should reflect the plans execution against that state.
Terraform Version
Terraform Configuration Files
Debug Output
Crash Output
Expected Behavior
A message stating the workspace has been created with the provided state
Actual Behavior
Steps to Reproduce
terraform workspace new -state=<somestate.tf> newname
Additional Context
References