Skip to content

Commit

Permalink
Rework provider using generated Polytomic SDK (#263)
Browse files Browse the repository at this point in the history
This commit is a significant refactor of the Polytomic terraform
provider to use the official Polytomic Go SDK. This allows us to
support more connection types without the overhead of maintaining a
bespoke API client.

Additionally, rather than generating Connection resources and
datasources using a YAML definition we now read the connection type
JSON Schemas from Polytomic and generate connection types based on
that.
  • Loading branch information
nyergler authored Dec 20, 2024
1 parent ed9b439 commit ea9c033
Show file tree
Hide file tree
Showing 779 changed files with 46,385 additions and 15,446 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b
- uses: hashicorp/setup-terraform@v3
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7
with:
go-version-file: "go.mod"
Expand Down
2 changes: 1 addition & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
POLYTOMIC_DEPLOYMENT_URL ?= app.polytomic-local.com:8443
POLYTOMIC_DEPLOYMENT_URL ?= https://app.polytomic-local.com:8443

default: testacc

Expand Down
7 changes: 5 additions & 2 deletions docs/data-sources/affinity_connection.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,18 @@ data "polytomic_affinity_connection" "affinity" {
### Optional

- `configuration` (Attributes) (see [below for nested schema](#nestedatt--configuration))
- `force_destroy` (Boolean) Indicates whether dependent models, syncs, and bulk syncs should be cascade deleted when this connection is destroy. This only deletes other resources when the connection is destroyed, not when setting this parameter to `true`. Once this parameter is set to `true`, there must be a successful `terraform apply` run before a destroy is required to update this value in the resource state. Without a successful `terraform apply` after this parameter is set, this flag will have no effect. If setting this field in the same operation that would require replacing the connection or destroying the connection, this flag will not work. Additionally when importing a connection, a successful `terraform apply` is required to set this value in state before it will take effect on a destroy operation.
- `name` (String)
- `organization` (String)

### Read-Only

- `id` (String) The ID of this resource.
- `name` (String)

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

Read-Only:

- `user` (String)


8 changes: 6 additions & 2 deletions docs/data-sources/airtable_connection.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,19 @@ data "polytomic_airtable_connection" "airtable" {
### Optional

- `configuration` (Attributes) (see [below for nested schema](#nestedatt--configuration))
- `force_destroy` (Boolean) Indicates whether dependent models, syncs, and bulk syncs should be cascade deleted when this connection is destroy. This only deletes other resources when the connection is destroyed, not when setting this parameter to `true`. Once this parameter is set to `true`, there must be a successful `terraform apply` run before a destroy is required to update this value in the resource state. Without a successful `terraform apply` after this parameter is set, this flag will have no effect. If setting this field in the same operation that would require replacing the connection or destroying the connection, this flag will not work. Additionally when importing a connection, a successful `terraform apply` is required to set this value in state before it will take effect on a destroy operation.
- `name` (String)
- `organization` (String)

### Read-Only

- `id` (String) The ID of this resource.
- `name` (String)

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

Read-Only:

- `connected_user` (String)
- `oauth_token_expiry` (String)


5 changes: 2 additions & 3 deletions docs/data-sources/amplitude_connection.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,17 @@ data "polytomic_amplitude_connection" "amplitude" {
### Optional

- `configuration` (Attributes) (see [below for nested schema](#nestedatt--configuration))
- `force_destroy` (Boolean) Indicates whether dependent models, syncs, and bulk syncs should be cascade deleted when this connection is destroy. This only deletes other resources when the connection is destroyed, not when setting this parameter to `true`. Once this parameter is set to `true`, there must be a successful `terraform apply` run before a destroy is required to update this value in the resource state. Without a successful `terraform apply` after this parameter is set, this flag will have no effect. If setting this field in the same operation that would require replacing the connection or destroying the connection, this flag will not work. Additionally when importing a connection, a successful `terraform apply` is required to set this value in state before it will take effect on a destroy operation.
- `name` (String)
- `organization` (String)

### Read-Only

- `id` (String) The ID of this resource.
- `name` (String)

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

Required:
Read-Only:

- `api_key` (String)

Expand Down
85 changes: 85 additions & 0 deletions docs/data-sources/api_connection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
# generated by https://github.com/fbreckle/terraform-plugin-docs
page_title: "polytomic_api_connection Data Source - terraform-provider-polytomic"
subcategory: "Connections"
description: |-
HTTP API Connection
---

# polytomic_api_connection (Data Source)

HTTP API Connection

## Example Usage

```terraform
data "polytomic_api_connection" "api" {
id = "aab123aa-27f3-abc1-9999-abcde123a4aa"
}
```

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

### Optional

- `configuration` (Attributes) (see [below for nested schema](#nestedatt--configuration))
- `organization` (String)

### Read-Only

- `id` (String) The ID of this resource.
- `name` (String)

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

Read-Only:

- `auth` (Attributes) (see [below for nested schema](#nestedatt--configuration--auth))
- `body` (String)
- `headers` (String)
- `healthcheck` (String) Path to request when checking the health of this connection. No health check will be performed if left empty.
- `parameters` (String)
- `url` (String)

<a id="nestedatt--configuration--auth"></a>
### Nested Schema for `configuration.auth`

Read-Only:

- `basic` (Attributes) (see [below for nested schema](#nestedatt--configuration--auth--basic))
- `header` (Attributes) (see [below for nested schema](#nestedatt--configuration--auth--header))
- `oauth` (Attributes) (see [below for nested schema](#nestedatt--configuration--auth--oauth))

<a id="nestedatt--configuration--auth--basic"></a>
### Nested Schema for `configuration.auth.basic`

Read-Only:

- `password` (String)
- `username` (String)


<a id="nestedatt--configuration--auth--header"></a>
### Nested Schema for `configuration.auth.header`

Read-Only:

- `name` (String)
- `value` (String)


<a id="nestedatt--configuration--auth--oauth"></a>
### Nested Schema for `configuration.auth.oauth`

Read-Only:

- `auth_style` (Number)
- `client_id` (String)
- `client_secret` (String)
- `extra_form_data` (String)
- `scopes` (String)
- `token_endpoint` (String)


37 changes: 37 additions & 0 deletions docs/data-sources/apollo_connection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
# generated by https://github.com/fbreckle/terraform-plugin-docs
page_title: "polytomic_apollo_connection Data Source - terraform-provider-polytomic"
subcategory: "Connections"
description: |-
Apollo.io Connection
---

# polytomic_apollo_connection (Data Source)

Apollo.io Connection

## Example Usage

```terraform
data "polytomic_apollo_connection" "apollo" {
id = "aab123aa-27f3-abc1-9999-abcde123a4aa"
}
```

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

### Optional

- `configuration` (Attributes) (see [below for nested schema](#nestedatt--configuration))
- `organization` (String)

### Read-Only

- `id` (String) The ID of this resource.
- `name` (String)

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


43 changes: 43 additions & 0 deletions docs/data-sources/appstoreconnect_connection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
# generated by https://github.com/fbreckle/terraform-plugin-docs
page_title: "polytomic_appstoreconnect_connection Data Source - terraform-provider-polytomic"
subcategory: "Connections"
description: |-
App Store Connect Connection
---

# polytomic_appstoreconnect_connection (Data Source)

App Store Connect Connection

## Example Usage

```terraform
data "polytomic_appstoreconnect_connection" "appstoreconnect" {
id = "aab123aa-27f3-abc1-9999-abcde123a4aa"
}
```

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

### Optional

- `configuration` (Attributes) (see [below for nested schema](#nestedatt--configuration))
- `organization` (String)

### Read-Only

- `id` (String) The ID of this resource.
- `name` (String)

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

Read-Only:

- `issuer_id` (String)
- `private_key_id` (String)
- `vendor_number` (String)


3 changes: 1 addition & 2 deletions docs/data-sources/asana_connection.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,12 @@ data "polytomic_asana_connection" "asana" {
### Optional

- `configuration` (Attributes) (see [below for nested schema](#nestedatt--configuration))
- `force_destroy` (Boolean) Indicates whether dependent models, syncs, and bulk syncs should be cascade deleted when this connection is destroy. This only deletes other resources when the connection is destroyed, not when setting this parameter to `true`. Once this parameter is set to `true`, there must be a successful `terraform apply` run before a destroy is required to update this value in the resource state. Without a successful `terraform apply` after this parameter is set, this flag will have no effect. If setting this field in the same operation that would require replacing the connection or destroying the connection, this flag will not work. Additionally when importing a connection, a successful `terraform apply` is required to set this value in state before it will take effect on a destroy operation.
- `name` (String)
- `organization` (String)

### Read-Only

- `id` (String) The ID of this resource.
- `name` (String)

<a id="nestedatt--configuration"></a>
### Nested Schema for `configuration`
Expand Down
3 changes: 1 addition & 2 deletions docs/data-sources/ascend_connection.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,12 @@ data "polytomic_ascend_connection" "ascend" {
### Optional

- `configuration` (Attributes) (see [below for nested schema](#nestedatt--configuration))
- `force_destroy` (Boolean) Indicates whether dependent models, syncs, and bulk syncs should be cascade deleted when this connection is destroy. This only deletes other resources when the connection is destroyed, not when setting this parameter to `true`. Once this parameter is set to `true`, there must be a successful `terraform apply` run before a destroy is required to update this value in the resource state. Without a successful `terraform apply` after this parameter is set, this flag will have no effect. If setting this field in the same operation that would require replacing the connection or destroying the connection, this flag will not work. Additionally when importing a connection, a successful `terraform apply` is required to set this value in state before it will take effect on a destroy operation.
- `name` (String)
- `organization` (String)

### Read-Only

- `id` (String) The ID of this resource.
- `name` (String)

<a id="nestedatt--configuration"></a>
### Nested Schema for `configuration`
Expand Down
41 changes: 41 additions & 0 deletions docs/data-sources/attio_connection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
# generated by https://github.com/fbreckle/terraform-plugin-docs
page_title: "polytomic_attio_connection Data Source - terraform-provider-polytomic"
subcategory: "Connections"
description: |-
Attio Connection
---

# polytomic_attio_connection (Data Source)

Attio Connection

## Example Usage

```terraform
data "polytomic_attio_connection" "attio" {
id = "aab123aa-27f3-abc1-9999-abcde123a4aa"
}
```

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

### Optional

- `configuration` (Attributes) (see [below for nested schema](#nestedatt--configuration))
- `organization` (String)

### Read-Only

- `id` (String) The ID of this resource.
- `name` (String)

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

Read-Only:

- `workspace_name` (String)


43 changes: 43 additions & 0 deletions docs/data-sources/awsathena_connection.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
# generated by https://github.com/fbreckle/terraform-plugin-docs
page_title: "polytomic_awsathena_connection Data Source - terraform-provider-polytomic"
subcategory: "Connections"
description: |-
AWS Athena Connection
---

# polytomic_awsathena_connection (Data Source)

AWS Athena Connection

## Example Usage

```terraform
data "polytomic_awsathena_connection" "awsathena" {
id = "aab123aa-27f3-abc1-9999-abcde123a4aa"
}
```

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

### Optional

- `configuration` (Attributes) (see [below for nested schema](#nestedatt--configuration))
- `organization` (String)

### Read-Only

- `id` (String) The ID of this resource.
- `name` (String)

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

Read-Only:

- `aws_user` (String)
- `outputbucket` (String) A pre-existing bucket (folder optional) that AWS can use to store query results. ex: s3://polytomic-athena-results/customer-dataset
- `region` (String)


7 changes: 4 additions & 3 deletions docs/data-sources/awsopensearch_connection.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,20 @@ data "polytomic_awsopensearch_connection" "awsopensearch" {
### Optional

- `configuration` (Attributes) (see [below for nested schema](#nestedatt--configuration))
- `force_destroy` (Boolean) Indicates whether dependent models, syncs, and bulk syncs should be cascade deleted when this connection is destroy. This only deletes other resources when the connection is destroyed, not when setting this parameter to `true`. Once this parameter is set to `true`, there must be a successful `terraform apply` run before a destroy is required to update this value in the resource state. Without a successful `terraform apply` after this parameter is set, this flag will have no effect. If setting this field in the same operation that would require replacing the connection or destroying the connection, this flag will not work. Additionally when importing a connection, a successful `terraform apply` is required to set this value in state before it will take effect on a destroy operation.
- `name` (String)
- `organization` (String)

### Read-Only

- `id` (String) The ID of this resource.
- `name` (String)

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

Required:
Read-Only:

- `aws_access_key_id` (String)
- `aws_user` (String)
- `endpoint` (String)
- `region` (String)

Expand Down
Loading

0 comments on commit ea9c033

Please sign in to comment.