hashicorp / terraform-cdk

Define infrastructure resources using programming constructs and provision them using HashiCorp Terraform
https://www.terraform.io/cdktf
Mozilla Public License 2.0
4.79k stars 443 forks source link

Automatically Create Terraform Cloud Workspace #670

Closed skorfmann closed 1 year ago

skorfmann commented 3 years ago

Community Note

Description

References

When using multiple stacks, it'd be pretty neat if the CLI would offer to create a configured workspace if it doesn't exist.

Right now we see the following error:

⠙ synthesizing server...
TerraformCloud returned an HTTP 404 error. Please make sure the configured organization (some-tf-cloud-user) and workspace (foo-bar-stack) exist and you have the correct access rights.
ansgarm commented 3 years ago

Related to this / might be addressed with this: When initializing a new project from a template that supports multiple stacks, only a single Terraform Cloud Workspace is created. In the case of my multi stack remote template the name of the project can also differ from the name of the stacks, so the TFC Workspace that gets created in init might not even match the ones defined in the template.

skorfmann commented 3 years ago

Yes - I think this should be moved to the synth stage. Essentially collect all backend configs and check for the existence. I'm tempted to try to building this on top of #682

matschaffer commented 2 years ago

This is somewhat offtopic, but is there a doc for using cdktf on terraform cloud? I was unable to locate it so came here looking for a "terraform cloud support" issue to upvote. Thanks in advance!

ansgarm commented 2 years ago

@matschaffer: There are notes on that (somewhat hidden) in the Project Setup Docs.

github-actions[bot] commented 1 year ago

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've 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.