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

fix(cli): error message for non-existent tf cloud orgs #3207

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions examples/java/aws/imports/constraints.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
howdoicomputer marked this conversation as resolved.
Show resolved Hide resolved
"cdktf": "0.18.2",
"providers": {
"aws": "~> 3.0"
}
}
3 changes: 3 additions & 0 deletions examples/java/aws/imports/versions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"registry.terraform.io/hashicorp/aws": "3.76.1"
}
6 changes: 6 additions & 0 deletions packages/cdktf-cli/src/bin/cmds/helper/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,12 @@ async function gatherInfo(
token
);

if (organizationIds.length == 0) {
throw Errors.Usage(
`You must be part of an organization in Terraform Cloud in order to use it as a RemoteBackend or CloudBackend.\n`
);
};

// todo: add validation for the organization name and workspace. add error handling
const organizationSelect = await select({
message: "Terraform Cloud Organization Name",
Expand Down
Loading