Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI Error: workspaces not supported #23076

Closed
phazel opened this issue Oct 14, 2019 · 2 comments
Closed

CLI Error: workspaces not supported #23076

phazel opened this issue Oct 14, 2019 · 2 comments

Comments

@phazel
Copy link

phazel commented Oct 14, 2019

Terraform Version

Terraform v0.12.10
+ provider.aws v2.32.0

Terraform Configuration Files

credentials "app.terraform.io" {
  token = "AAAAAAAAAAA.something.BBBBBBBBBBBBBBBBBBBBBBBBBBB"
}

Debug Output

https://gist.github.com/phazel/1da824f34ef0f3a4d4481b1c83b17549

Crash Output

Expected Behavior

List of existing workspaces, which at this point should have just been 'default'. Also creation of new workspace.

Actual Behavior

workspaces not supported error

Steps to Reproduce

  1. Set up terraform repo, state, and resources in AWS
  2. Set up remote state in Terraform Cloud
  3. Attempt to list workspaces and add a new one

Additional Context

I've set up remote state in Terraform Cloud, and I've currently got my infra resources set up in one AWS account. I'm trying to use workspaces to set up the same collection of resources in another AWS environment, using workspaces. Given that TF Cloud has workspaces and recommends creating new ones for each environment, it seemed to me like things had moved from the previous model of one backend holding the state for all workspaces. Is this assumption correct? Is workspaces still the right tool for this? Is there some incompatibility between workspaces in the cli and Terraform Cloud workspaces?

References

This issue might also be relevant:
#22035

@phazel phazel changed the title CLI Error: Workspaces Not Supported CLI Error: workspaces not supported Oct 14, 2019
@phazel
Copy link
Author

phazel commented Oct 14, 2019

Solved: I needed to use prefix for my backend configuration, to allow multiple backends/workspaces.

# Using multiple workspaces:
terraform {
  backend "remote" {
    hostname = "app.terraform.io"
    organization = "company"

    workspaces {
      prefix = "my-app-"
    }
  }
}

@phazel phazel closed this as completed Oct 14, 2019
@ghost
Copy link

ghost commented Nov 14, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Nov 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant