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

chore: create TFC/TFE workspace using the Terraform CLI #2424

Merged
merged 5 commits into from
Jan 4, 2023

Conversation

mutahhir
Copy link
Contributor

@mutahhir mutahhir commented Dec 14, 2022

Since we're moving to using TF CLI for Terraform Cloud, this PR removes the additional API call we make to TFC/TFE to create a workspace. Instead, it relies on the first cdktf diff or cdktf deploy by the developer to create a workspace on TFC.

The reason for this change is that by default workspaces created by the TFC API are set to use 'local execution', but when using the TF CLI and the CloudBackend, the created workspace uses 'remote execution'.

Other Improvements:

  • The CLI checks the user's selected organisation if the selected workspace name already exists, and if so, allows the user to select a new name.
  • Adding a tfe-hostname to the init command (Maybe I missed something, but I didn't see how TFE customers could use CDKTF before without going from local to remote?)
  • Updating templates to respect tfe-hostname when generating the CloudBackend on init

Notes on Testing

I've only tested the PR on the latest release of TFE, however, it seems like the version that supports CloudBackend on TFE bundles with TF version 1.1.3 which is behind our new TF version support, so it should be safe to use.

Copy link
Member

@ansgarm ansgarm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2023

I'm going to lock this pull request 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 related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants