Can't Initialize Terraform Cloud Backend - default workspace doesn't exist #5891
Replies: 1 comment
-
|
Hi @david-lawrence-tc! I'm Dosu and I’m helping the atlantis team. This is a known limitation when using Atlantis with Terraform Cloud remote backend and workspace prefixes: Terraform requires backend initialization before you can select a workspace, but if there’s no "default" workspace in Terraform Cloud, The only reliable workaround is to ensure that each Atlantis project is explicitly configured with the correct workspace in your There is currently no built-in Atlantis feature or configuration to bypass this chicken-and-egg problem. If possible, you could create a "default" workspace in Terraform Cloud as a workaround, but this may not fit all workflows. Otherwise, this is a limitation of how Terraform and Atlantis interact with remote backends using workspace prefixes (source). To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am having trouble initializing a project in atlantis that has backend configured in Terraform Cloud. Terraform Cloud does not support default workspaces, but terraform initializes with a default workspace, so I cannot seem to even initialize.
For example, in Terraform Cloud, I have workspaces named like
With backend config like
So if I check workspaces from terraform CLI, I get
Now, when I try to initialize one of these workspaces in atlantis, I cannot get initialized, even when specifying the workspace explicitly to atlantis. For example if I run
I get this
I tried to customize the default workflow for atlantis to first select the workspace first with
But this also failed with
Besides not being able to select workspace before init, from the docs I can also see that $WORKSPACE is not set yet so this wouldn't work anyway.
So I'm stuck in a chicken/egg problem. I can't select workspace before init, and I can't init because I can't set the workspace. Any advice on how to proceed here?
Beta Was this translation helpful? Give feedback.
All reactions