Skip to content

Commit f3c535e

Browse files
committed
fix: S3 connector field is computed_optional
- Updated 'recursive' field as computed_optional for S3 connector in provider-code-spec.json and destination resource schema. - Updated documentation to reflect changes in API key handling and added examples for source, destination, and workflow resources. - Ensured consistency in example configurations across various documentation files.
1 parent 3fad89c commit f3c535e

File tree

9 files changed

+143
-16
lines changed

9 files changed

+143
-16
lines changed

docs/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ description: |-
1313

1414
```terraform
1515
provider "unstructured" {
16-
# this is not a real key, but shown to demonstrate the length and pattern that Unstructured uses
17-
api_key = "TlMPUit8RRpouMypm2vQat1ViC1kvk"
16+
# API key should be set via environment variable UNSTRUCTURED_API_KEY
17+
# api_key = "your-api-key-here"
1818
19-
# this is the default base URL, but can be overridden if needed
20-
base_url = "https://platform.unstructuredapp.io/api/v1"
19+
# Endpoint can be overridden if needed, defaults to https://platform.unstructuredapp.io/api/v1
20+
# endpoint = "https://platform.unstructuredapp.io/api/v1"
2121
}
2222
```
2323

docs/resources/destination.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ description: |-
1616
resource "unstructured_destination" "example" {
1717
name = "example_s3_destination"
1818
19-
s3 {
19+
s3 = {
2020
remote_url = "s3://my-destination-bucket/"
2121
key = "aws-access-key-id"
2222
secret = "aws-secret-access-key"
@@ -364,6 +364,7 @@ Optional:
364364
- `anonymous` (Boolean)
365365
- `endpoint_url` (String)
366366
- `key` (String)
367+
- `recursive` (Boolean)
367368
- `secret` (String)
368369
- `token` (String)
369370

docs/resources/source.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ description: |-
1616
resource "unstructured_source" "example" {
1717
name = "example_s3_source"
1818
19-
s3 {
19+
s3 = {
2020
remote_url = "s3://my-source-bucket/"
2121
recursive = true
2222
anonymous = true

examples/provider/provider.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
provider "unstructured" {
2-
# this is not a real key, but shown to demonstrate the length and pattern that Unstructured uses
3-
api_key = "TlMPUit8RRpouMypm2vQat1ViC1kvk"
2+
# API key should be set via environment variable UNSTRUCTURED_API_KEY
3+
# api_key = "your-api-key-here"
44

5-
# this is the default base URL, but can be overridden if needed
6-
base_url = "https://platform.unstructuredapp.io/api/v1"
5+
# Endpoint can be overridden if needed, defaults to https://platform.unstructuredapp.io/api/v1
6+
# endpoint = "https://platform.unstructuredapp.io/api/v1"
77
}

examples/resources/unstructured_destination/resource.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
resource "unstructured_destination" "example" {
22
name = "example_s3_destination"
33

4-
s3 {
4+
s3 = {
55
remote_url = "s3://my-destination-bucket/"
66
key = "aws-access-key-id"
77
secret = "aws-secret-access-key"

examples/resources/unstructured_source/resource.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
resource "unstructured_source" "example" {
22
name = "example_s3_source"
33

4-
s3 {
4+
s3 = {
55
remote_url = "s3://my-source-bucket/"
66
recursive = true
77
anonymous = true
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Example workflow resource (assumes source and destination already exist)
2+
resource "unstructured_workflow" "example" {
3+
name = "example_workflow"
4+
workflow_type = "basic"
5+
6+
# These IDs should reference existing source and destination resources
7+
source_id = "existing-source-id"
8+
destination_id = "existing-destination-id"
9+
10+
workflow_nodes {
11+
name = "Partitioner"
12+
type = "partition"
13+
subtype = "vlm"
14+
settings = {
15+
"provider" = "anthropic"
16+
"provider_api_key" = null
17+
"model" = "claude-3-5-sonnet-20241022"
18+
"output_format" = "text/html"
19+
"prompt" = null
20+
"format_html" = true
21+
"unique_element_ids" = true
22+
"is_dynamic" = true
23+
"allow_fast" = true
24+
}
25+
}
26+
27+
workflow_nodes {
28+
name = "Image summarizer"
29+
type = "prompter"
30+
subtype = "openai_image_description"
31+
}
32+
33+
workflow_nodes {
34+
name = "Table summarizer"
35+
type = "prompter"
36+
subtype = "anthropic_table_description"
37+
}
38+
39+
workflow_nodes {
40+
name = "Chunker"
41+
type = "chunk"
42+
subtype = "chunk_by_title"
43+
settings = {
44+
"unstructured_api_url" = null
45+
"unstructured_api_key" = null
46+
"multipage_sections" = false
47+
"combine_text_under_n_chars" = 0
48+
"include_orig_elements" = false
49+
"new_after_n_chars" = 1500
50+
"max_characters" = 2048
51+
"overlap" = 160
52+
"overlap_all" = false
53+
"contextual_chunking_strategy" = "v1"
54+
}
55+
}
56+
57+
workflow_nodes {
58+
name = "Embedder"
59+
type = "embed"
60+
subtype = "azure_openai"
61+
settings = {
62+
"model_name" = "text-embedding-3-large"
63+
}
64+
}
65+
}

internal/resource_destination/destination_resource_gen.go

Lines changed: 62 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

provider-code-spec.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,11 +585,12 @@
585585
]}},
586586
{ "name": "s3", "single_nested": { "computed_optional_required": "optional", "attributes": [
587587
{ "name": "remote_url", "string": { "computed_optional_required": "required" } },
588-
{ "name": "anonymous", "bool": { "computed_optional_required": "optional" } },
588+
{ "name": "anonymous", "bool": { "computed_optional_required": "computed_optional" } },
589589
{ "name": "key", "string": { "computed_optional_required": "optional" } },
590590
{ "name": "secret", "string": { "computed_optional_required": "optional" } },
591591
{ "name": "token", "string": { "computed_optional_required": "optional" } },
592-
{ "name": "endpoint_url", "string": { "computed_optional_required": "optional" } }
592+
{ "name": "endpoint_url", "string": { "computed_optional_required": "optional" } },
593+
{ "name": "recursive", "bool": { "computed_optional_required": "computed_optional" } }
593594
]}},
594595
{ "name": "snowflake", "single_nested": { "computed_optional_required": "optional", "attributes": [
595596
{ "name": "account", "string": { "computed_optional_required": "required" } },

0 commit comments

Comments
 (0)