Skip to content

Commit

Permalink
feat: implement BearerAuth and update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
aballiet committed Jul 29, 2023
1 parent 20e4fdd commit 1c81f15
Show file tree
Hide file tree
Showing 34 changed files with 395 additions and 141 deletions.
4 changes: 2 additions & 2 deletions airbyte.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ externalDocs:
url: "https://airbyte.io"
servers:
- url: "http://localhost:8000/api"
security:
- bearerAuth: []
tags:
- name: workspace
description: Workspace related resources.
Expand Down Expand Up @@ -6151,5 +6153,3 @@ components:
application/json:
schema:
$ref: "#/components/schemas/KnownExceptionInfo"
security:
- {}
3 changes: 2 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ terraform {
required_providers {
airbyte = {
source = "aballiet/airbyte"
version = "1.0.0"
version = "1.0.1"
}
}
}
Expand All @@ -71,4 +71,5 @@ provider "airbyte" {

### Optional

- `bearer_auth` (String, Sensitive)
- `server_url` (String) Server URL (defaults to http://localhost:8000/api)
168 changes: 168 additions & 0 deletions docs/resources/airbyte_connection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "airbyte_connection Resource - aballiet-terraform-provider-airbyte-oss"
subcategory: ""
description: |-
Connection Resource
---

# airbyte_connection (Resource)

Connection Resource

## Example Usage

```terraform
resource "airbyte_connection" "my_connection" {
destination_id = "89bd9d8d-69a6-474e-8f46-7cc8796ed151"
namespace_format = "${SOURCE_NAMESPACE}"
source_id = "a05dfc2d-df7c-4c78-8a1b-a928fc816742"
status = "active"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `destination_id` (String)
- `source_id` (String)
- `status` (String) must be one of [active, inactive, deprecated]
Active means that data is flowing through the connection. Inactive means it is not. Deprecated means the connection is off and cannot be re-activated. the schema field describes the elements of the schema that will be synced.

### Optional

- `geography` (String) must be one of [auto, us, eu]
- `name` (String) Optional name of the connection
- `namespace_definition` (String) must be one of [source, destination, customformat]
Method used for computing final namespace in destination
- `namespace_format` (String) Used when namespaceDefinition is 'customformat'. If blank then behaves like namespaceDefinition = 'destination'. If "${SOURCE_NAMESPACE}" then behaves like namespaceDefinition = 'source'.
- `non_breaking_changes_preference` (String) must be one of [ignore, disable, propagate_columns, propagate_fully]
- `notify_schema_changes` (Boolean)
- `notify_schema_changes_by_email` (Boolean)
- `operation_ids` (List of String)
- `prefix` (String) Prefix that will be prepended to the name of each stream when it is written to the destination.
- `resource_requirements` (Attributes) optional resource requirements to run workers (blank for unbounded allocations) (see [below for nested schema](#nestedatt--resource_requirements))
- `schedule` (Attributes) if null, then no schedule is set. (see [below for nested schema](#nestedatt--schedule))
- `schedule_data` (Attributes) schedule for when the the connection should run, per the schedule type (see [below for nested schema](#nestedatt--schedule_data))
- `schedule_type` (String) must be one of [manual, basic, cron]
determine how the schedule data should be interpreted
- `source_catalog_id` (String)
- `sync_catalog` (Attributes) describes the available schema (catalog). (see [below for nested schema](#nestedatt--sync_catalog))

### Read-Only

- `breaking_change` (Boolean)
- `connection_id` (String)
- `workspace_id` (String)

<a id="nestedatt--resource_requirements"></a>
### Nested Schema for `resource_requirements`

Optional:

- `cpu_limit` (String)
- `cpu_request` (String)
- `memory_limit` (String)
- `memory_request` (String)


<a id="nestedatt--schedule"></a>
### Nested Schema for `schedule`

Required:

- `time_unit` (String) must be one of [minutes, hours, days, weeks, months]
- `units` (Number)


<a id="nestedatt--schedule_data"></a>
### Nested Schema for `schedule_data`

Optional:

- `basic_schedule` (Attributes) (see [below for nested schema](#nestedatt--schedule_data--basic_schedule))
- `cron` (Attributes) (see [below for nested schema](#nestedatt--schedule_data--cron))

<a id="nestedatt--schedule_data--basic_schedule"></a>
### Nested Schema for `schedule_data.basic_schedule`

Required:

- `time_unit` (String) must be one of [minutes, hours, days, weeks, months]
- `units` (Number)


<a id="nestedatt--schedule_data--cron"></a>
### Nested Schema for `schedule_data.cron`

Required:

- `cron_expression` (String)
- `cron_time_zone` (String)



<a id="nestedatt--sync_catalog"></a>
### Nested Schema for `sync_catalog`

Required:

- `streams` (Attributes List) (see [below for nested schema](#nestedatt--sync_catalog--streams))

<a id="nestedatt--sync_catalog--streams"></a>
### Nested Schema for `sync_catalog.streams`

Optional:

- `config` (Attributes) the mutable part of the stream to configure the destination (see [below for nested schema](#nestedatt--sync_catalog--streams--config))
- `stream` (Attributes) the immutable schema defined by the source (see [below for nested schema](#nestedatt--sync_catalog--streams--stream))

<a id="nestedatt--sync_catalog--streams--config"></a>
### Nested Schema for `sync_catalog.streams.config`

Required:

- `destination_sync_mode` (String) must be one of [append, overwrite, append_dedup]
- `sync_mode` (String) must be one of [full_refresh, incremental]

Optional:

- `alias_name` (String) Alias name to the stream to be used in the destination
- `cursor_field` (List of String) Path to the field that will be used to determine if a record is new or modified since the last sync. This field is REQUIRED if `sync_mode` is `incremental`. Otherwise it is ignored.
- `field_selection_enabled` (Boolean) Whether field selection should be enabled. If this is true, only the properties in `selectedFields` will be included.
- `primary_key` (List of List of String) Paths to the fields that will be used as primary key. This field is REQUIRED if `destination_sync_mode` is `*_dedup`. Otherwise it is ignored.
- `selected` (Boolean) If this is true, the stream is selected with all of its properties. For new connections, this considers if the stream is suggested or not
- `selected_fields` (Attributes List) Paths to the fields that will be included in the configured catalog. This must be set if `fieldSelectedEnabled` is set. An empty list indicates that no properties will be included. (see [below for nested schema](#nestedatt--sync_catalog--streams--config--selected_fields))
- `suggested` (Boolean) Does the connector suggest that this stream be enabled by default?

<a id="nestedatt--sync_catalog--streams--config--selected_fields"></a>
### Nested Schema for `sync_catalog.streams.config.suggested`

Optional:

- `field_path` (List of String)



<a id="nestedatt--sync_catalog--streams--stream"></a>
### Nested Schema for `sync_catalog.streams.stream`

Required:

- `name` (String) Stream's name.

Optional:

- `default_cursor_field` (List of String) Path to the field that will be used to determine if a record is new or modified since the last sync. If not provided by the source, the end user will have to specify the comparable themselves.
- `json_schema` (Attributes) Stream schema using Json Schema specs. (see [below for nested schema](#nestedatt--sync_catalog--streams--stream--json_schema))
- `namespace` (String) Optional Source-defined namespace. Airbyte streams from the same sources should have the same namespace. Currently only used by JDBC destinations to determine what schema to write to.
- `source_defined_cursor` (Boolean) If the source defines the cursor field, then any other cursor field inputs will be ignored. If it does not, either the user_provided one is used, or the default one is used as a backup.
- `source_defined_primary_key` (List of List of String) If the source defines the primary key, paths to the fields that will be used as a primary key. If not provided by the source, the end user will have to specify the primary key themselves.
- `supported_sync_modes` (List of String)

<a id="nestedatt--sync_catalog--streams--stream--json_schema"></a>
### Nested Schema for `sync_catalog.streams.stream.supported_sync_modes`


53 changes: 53 additions & 0 deletions docs/resources/airbyte_source.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "airbyte_source Resource - aballiet-terraform-provider-airbyte-oss"
subcategory: ""
description: |-
Source Resource
---

# airbyte_source (Resource)

Source Resource

## Example Usage

```terraform
resource "airbyte_source" "my_source" {
connection_configuration = "{ \"see\": \"documentation\" }"
name = "Cory Emmerich"
source_definition_id = "05929396-fea7-4596-ab10-faaa2352c595"
source_id = "5907aff1-a3a2-4fa9-8677-39251aa52c3f"
workspace_id = "5ad019da-1ffe-478f-897b-0074f15471b5"
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `connection_configuration` (String) Parsed as JSON.
The values required to configure the source. The schema for this must match the schema return by source_definition_specifications/get for the source.
- `name` (String)
- `source_definition_id` (String)
- `source_id` (String)
- `workspace_id` (String)

### Read-Only

- `exception_class_name` (String)
- `exception_stack` (List of String)
- `message` (String)
- `validation_errors` (Attributes List) (see [below for nested schema](#nestedatt--validation_errors))

<a id="nestedatt--validation_errors"></a>
### Nested Schema for `validation_errors`

Read-Only:

- `invalid_value` (String)
- `message` (String)
- `property_path` (String)


2 changes: 1 addition & 1 deletion examples/resources/airbyte_connection/resource.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ resource "airbyte_connection" "my_connection" {
destination_id = "89bd9d8d-69a6-474e-8f46-7cc8796ed151"
namespace_format = "${SOURCE_NAMESPACE}"
source_id = "a05dfc2d-df7c-4c78-8a1b-a928fc816742"
status = "active"
status = "deprecated"
}
1 change: 1 addition & 0 deletions files.gen
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ internal/sdk/pkg/models/shared/workspacereadlist.go
internal/sdk/pkg/models/shared/workspaceupdate.go
internal/sdk/pkg/models/shared/workspacegivefeedback.go
internal/sdk/pkg/models/shared/workspaceupdatename.go
internal/sdk/pkg/models/shared/security.go
USAGE.md
internal/provider/provider.go
examples/provider/provider.tf
Expand Down
2 changes: 1 addition & 1 deletion gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ generation:
singleTagPerOp: false
tagNamespacingDisabled: false
terraform:
version: 1.0.1
version: 1.0.2
author: aballiet
packageName: airbyte
14 changes: 13 additions & 1 deletion internal/provider/provider.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions internal/sdk/attempt.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1c81f15

Please sign in to comment.