Skip to content

Commit

Permalink
Merge pull request #7 from aballiet/update-doc
Browse files Browse the repository at this point in the history
Update doc
  • Loading branch information
aballiet authored Dec 12, 2023
2 parents 75cfe83 + cb6f274 commit c0d57b7
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 29 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ terraform {
required_providers {
airbyte = {
source = "aballiet/airbyte-oss"
version = "1.1.0"
version = "1.1.1"
}
}
}
Expand Down
80 changes: 58 additions & 22 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@ description: |-
* OSS users can utilize the Configuration API, but at their own risk.
* This API is utilized internally by the Airbyte Engineering team and may be modified in the future if the need arises.
* Modifications by the Airbyte Engineering team could create breaking changes and OSS users would need to update their code to catch up to any backwards incompatible changes in the API.
This API is a collection of HTTP RPC-style methods. While it is not a REST API, those familiar with REST should find the conventions of this API recognizable.
Here are some conventions that this API follows:
* All endpoints are http POST methods.
* All endpoints accept data via application/json request bodies. The API does not accept any data via query params.
* The naming convention for endpoints is: localhost:8000/{VERSION}/{METHODFAMILY}/{METHODNAME} e.g. localhost:8000/v1/connections/create.
* For all update methods, the whole object must be passed in, even the fields that did not change.
Authentication (OSS):
* When authenticating to the Configuration API, you must use Basic Authentication by setting the Authentication Header to Basic and base64 encoding the username and password (which are airbyte and password by default - so base64 encoding airbyte:password results in YWlyYnl0ZTpwYXNzd29yZA==). So the full header reads 'Authorization': "Basic YWlyYnl0ZTpwYXNzd29yZA=="
---

# aballiet-terraform-provider-airbyte-oss Provider
Expand Down Expand Up @@ -63,31 +55,75 @@ provider "airbyte" {
Below a full example with a custom connector : defining a `SourceDefintion`, `Source` and a `Connection` :

```hcl
locals {
workspace_id = "<MY_AIRBYTE_WORKSPACE_ID>"
bq_destination_id = "e03724f5-987b-4f97-abf1-3ed54f3ea126"
}
data "airbyte_workspace" "default" {
workspace_id = "3bd35192-80b7-40ff-82a7-956845321660"
}
resource "airbyte_source_definition" "ashby" {
# Here we are using the Slack official source connector
# But you can use any source connector you want from your own registry
resource "airbyte_source_definition" "slack" {
source_definition = {
docker_image_tag = "0.1.0"
docker_repository = "us-central1-docker.pkg.dev/<MY_GCP_PROJECT>/airbyte/source-ashby"
documentation_url = "https://developers.ashbyhq.com/reference/introduction"
name = "Ashby"
name = "Slack"
docker_repository = "airbyte/source-slack"
docker_image_tag = "0.3.5"
documentation_url = "https://api.slack.com/messaging/managing"
}
workspace_id = local.workspace_id
workspace_id = data.airbyte_workspace.default.workspace_id
}
resource "airbyte_source" "ashby" {
# In the `connection_configuration` you can pass any configuration you want
# Based on the connector spec
# In this Slack example, configuration matches :
# https://github.com/airbytehq/airbyte/blob/master/airbyte-integrations/connectors/source-slack/source_slack/spec.json#L9
resource "airbyte_source" "slack" {
connection_configuration = jsonencode({
api_key = "<MY_API_KEY>"
api_token = "xoxb-1234567890-1234567890123-999999999999999999999"
start_date = "2023-01-01T00:00:00Z"
lookback_window = 7
join_channels = false
channel_filter = ["your-channel-name"]
})
name = "Ashby"
source_definition_id = airbyte_source_definition.ashby.source_definition_id
workspace_id = local.workspace_id
name = "Slack"
source_definition_id = airbyte_source_definition.slack.source_definition_id
workspace_id = data.airbyte_workspace.default.workspace_id
}
# TODO for connection : I will publish a Terraform module to make it easier (need to discover Stream schema)
module "airbyte_connection" {
source = "aballiet/connection/airbyte"
version = "0.0.5"
name = "Slack Basic"
status = "active"
workspace_id = data.airbyte_workspace.default.workspace_id
source_id = airbyte_source.slack.source_id
destination_id = local.bq_destination_id
destination_dataset = "airbyte_slack"
normalize = true
schedule = {
type = "basic"
basic = {
units = 24
time_unit = "hours"
}
}
streams = [
{
name = "channel_members"
destination_sync_mode = "overwrite"
sync_mode = "full_refresh"
},
{
name = "users"
destination_sync_mode = "overwrite"
sync_mode = "full_refresh"
},
]
}
```

<!-- schema generated by tfplugindocs -->
Expand Down
8 changes: 5 additions & 3 deletions examples/provider/provider.tf
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
terraform {
required_providers {
airbyte = {
source = "aballiet/airbyte"
version = "1.1.0"
source = "aballiet/airbyte-oss"
version = "1.1.1"
}
}
}

provider "airbyte" {
# Configuration options
server_url = "http://localhost:8001/api/" # Must match your Airbyte server endpoint (airbyte-server-svc on k8s)
username = "YOUR_USERNAME"
password = "YOUR_PASSWORD"
}
2 changes: 1 addition & 1 deletion gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ features:
globalSecurity: 2.81.2
globalServerURLs: 2.82.1
terraform:
version: 1.1.0
version: 1.1.1
author: aballiet
imports:
option: openapi
Expand Down
4 changes: 2 additions & 2 deletions internal/sdk/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,9 @@ func New(opts ...SDKOption) *SDK {
sdkConfiguration: sdkConfiguration{
Language: "go",
OpenAPIDocVersion: "1.0.0",
SDKVersion: "1.1.0",
SDKVersion: "1.1.1",
GenVersion: "2.214.1",
UserAgent: "speakeasy-sdk/go 1.1.0 2.214.1 1.0.0 airbyte",
UserAgent: "speakeasy-sdk/go 1.1.1 2.214.1 1.0.0 airbyte",
},
}
for _, opt := range opts {
Expand Down

0 comments on commit c0d57b7

Please sign in to comment.