Error setting up workspace without organization ID in Terraform connector for Airbyte OSS

Summary

When setting up a workspace through the Terraform connector for Airbyte OSS, encountering an error due to missing organization ID even though it is optional. Seeking insights on resolving this issue.


Question

Hi, I am trying to set up workspace through terraform connector for Airbyte OSS. From the documentation I understand that it is optional to provide organization Id. But I get following error:

│ ID.","type":"<https://reference.airbyte.com/reference/errors#unprocessable-entity>","title":"unprocessable-entity","status":422}```
Greatly appreciate any insights/feedback on how to go past this error. Thanks!

<br>

---

This topic has been created from a Slack thread to give it more visibility.
It will be on Read-Only mode here. [Click here](https://airbytehq.slack.com/archives/C021JANJ6TY/p1720815223594379) if you want 
to access the original thread.

[Join the conversation on Slack](https://slack.airbyte.com)

<sub>
["error", "workspace", "organization-id", "terraform-connector", "airbyte-oss"]
</sub>

First thing, I wouldn’t add extra workspaces as there is no help in user interface to switch between them. I’d stick to the default one that is automatically created.
You can use data resource for that
https://registry.terraform.io/providers/airbytehq/airbyte/latest/docs/data-sources/workspace

https://reference.airbyte.com/reference/createworkspace
> If you only have a single organization, the ID will be inferred. If you get an error telling you that you have more than one organization, go to the Organization Settings page in the UI to get your organization ID and use that to create new workspaces.
If you really need another workspace, you can check organization table in database.

<@U07B7GPF2PJ> What version are you on? This is something that could have happened some time ago, but if you’re up to date on version, the API should be defaulting to the default organization that’s created for OSS instances.

<@U04DNBGKS2Y> the terraform module version - 0.5.2, airbyte - 0.63.4. Do you belive it got fixed in any versions after these?

<@U05JENRCF7C> I don’t want to create a new workspace but since i did not find a way to infer the workspace id through terraform, i leaned towards creating a new workspace. Ideally if there was a way to retrieve or use the default workspace id through terraform, I would use it. At present I have to go to the UI and pick the workspace Id and populate into the terraform code- it works, but would like to eliminate this manual step.

<@U04DNBGKS2Y> can you add a task to backlog that implements data source that gets list of workspaces?

Before switching to official Airbyte provider I used josephjohncox/terraform-provider-airbyte and it was possible to get a default workspace id like this: https://github.com/josephjohncox/terraform-provider-airbyte/blob/main/examples/data-sources/airbyte_workspace_ids/data-source.tf

something like data "airbyte_workspaces" would be nice that returns list of workspaces with attributes

Yes - should be fairly trivial for us to add. Will add it to our list.

<@U04DNBGKS2Y> thanks :keanu-thanks: