airbytehq / terraform-provider-airbyte

Terraform Provider for Airbyte API
https://api.airbyte.com/
MIT License
44 stars 19 forks source link

Issue when creating new workspace (ID) #76

Open pschult3 opened 8 months ago

pschult3 commented 8 months ago

Description When using the Terraform Airbyte Provider (v0.3.7) to create a new workspace (ID) with the AirByte Version "v0.50.47", there seems to be a problem to access the new workspace through the localhost interface. The workspace-ID can be found in the terraform state, and via the REST-API. It was possible to resolve this issue, when setting manually via the REST-API an organization-ID.

Steps to Reproduce

  1. Use the Terraform Airbyte Provider (v0.3.7) to create a new workspace.
resource "airbyte_workspace" "my_workspace" {
  name = "test"
}

output "terraform_workspace_id" {
  value = airbyte_workspace.my_workspace.workspace_id
}
  1. Get the workspace-ID via the Terraform state

terraform state show airbyte_workspace.my_workspace

  1. Move to localhost:8000 and login.

  2. Try to navigate to http://localhost:8000/workspaces/{workspace_id_from_terraform_state} --> this should not work

Current "solution", setting the organization_id via:

import requests

url = "http://localhost:8000/api/v1/workspaces/update_organization"

headers = {
    "accept": "application/json",
    "content-type": "application/json",
    "authorization": "Basic {auth_token}"
}
payload = {
  "workspaceId": "{workspace_id_from_terraform_state}",
  "organizationId": '00000000-0000-0000-0000-000000000000'
}

response = requests.post(url, json=payload, headers=headers)

You should be able to access: http://localhost:8000/workspaces/{workspace_id_from_terraform_state}


With Terraform Airbyte Provider (v0.3.4) and the AirByte Version "v0.50.33", it was possible to get the workspace_id from the terraform state and access it directly via the localhost workspaces.

Ideally it would be possible to directly see all possible workspaces in the Interface or recover the state in order to type in manually the workspace ID.

iulianapostol-ozone commented 2 months ago

I'm amazed this hasn't been answered already, have the same issue