<@U04S8PLJWMT> I have a few custom sources in my d...
# ask-ai
s
@kapa.ai I have a few custom sources in my dev environment. I am trying to import them to prod environment. When I try to run terraform it gives me the following error. How can I achieve this.
Copy code
Error: failure to invoke API
│
│   with module.airbyte_sources.airbyte_source_custom.this["jenkins"],
│   on module/airbyte-sources/main.tf line 136, in resource "airbyte_source_custom" "this":
│  136: resource "airbyte_source_custom" "this" {
│
│ unknown status code returned: Status 404
│ {"status":404,"type":"https://reference.airbyte.com/reference/errors#resource-not-found","title":"resource-not-found","detail":"The requested resource
│ could not be found.","documentationUrl":null,"data":{"resourceType":"STANDARD_SOURCE_DEFINITION","resourceId":"8f342433-e5ee-407e-a56a-16523423c544ec"}}
k
New message text here
s
@kapa.ai Once I have my custom connector on prod. How do I know its definition id ?
k
A message from kapa.ai
New message text here
s
@kapa.ai Can you point me to the api that can used to export and import custom sources?
k
A message from kapa.ai
You can use Airbyte's public API to export and import custom sources (connectors) in Airbyte OSS and Self-Managed environments, starting from version 1.6. Specifically, for custom connectors created using a YAML manifest (Connector Builder), the following endpoints are available: - Export (List/Get) custom YAML source definitions: -
GET /workspaces/{workspaceId}/definitions/declarative_sources/
— List all YAML source definitions in a workspace. -
GET /workspaces/{workspaceId}/definitions/declarative_sources/{definitionId}
— Get a specific YAML source definition. - Import (Create) custom YAML source definitions: -
POST /workspaces/{workspaceId}/definitions/declarative_sources/
— Create a new YAML source definition by posting your manifest. - Update/Delete: -
PUT /workspaces/{workspaceId}/definitions/declarative_sources/{definitionId}
— Update a YAML source definition. -
DELETE /workspaces/{workspaceId}/definitions/declarative_sources/{definitionId}
— Delete a YAML source definition. You can find more details and the full API reference [here](https://reference.airbyte.com/reference/getting-started#/). Note that in Airbyte Cloud, you can only create or modify custom connectors using a YAML manifest, and you cannot modify public connector definitions [Create custom connectors from YAML or Docker images using the API and Terraform](https://docs.airbyte.com/release_notes/v-1.6#create-custom-connectors-from-yaml-or-docker-images-using-the-api-and-terraform). If you are using Docker-based custom connectors, similar endpoints exist for source and destination definitions. Summary: Use the
/workspaces/{workspaceId}/definitions/declarative_sources/
endpoints to export (GET) and import (POST) custom YAML sources via the Airbyte API.
s
@kapa.ai What if a connector is incompatible with connector builder. Can it still be exported ?
k
A message from kapa.ai
If a connector is incompatible with the Connector Builder (for example, if it is a Docker-based custom connector built with code), the knowledge sources do not mention an official way to export it using the same API endpoints as for YAML-based (Connector Builder) connectors. The documented export/import API endpoints are specifically for connectors created with a YAML manifest via the Connector Builder [Create custom connectors from YAML or Docker images using the API and Terraform](https://docs.airbyte.com/release_notes/v-1.6#create-custom-connectors-from-yaml-or-docker-images-using-the-api-and-terraform). For Docker-based custom connectors, the recommended approach is to manage the Docker image itself: build, tag, and push it to a private Docker registry, then manually register it in the target Airbyte instance by providing the image name and tag in the UI or via the appropriate API endpoints. There is no mention in the knowledge sources of an API to "export" a Docker-based connector's definition directly from one instance to another [Uploading Docker-based custom connectors](https://docs.airbyte.com/platform/operator-guides/using-custom-connectors). In summary, only connectors built with the Connector Builder (YAML manifest) can be exported and imported using the documented API endpoints. For Docker-based connectors, you must handle the image and registration process manually.