Skip to content

Commit c0c8774

Browse files
authored
S3 connectors: if using AWS STS, must specify access key, secret access key, and STS token (not just STS token) (#599)
1 parent 26e25b8 commit c0c8774

File tree

11 files changed

+20
-8
lines changed

11 files changed

+20
-8
lines changed

snippets/destination_connectors/s3.sh.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@ unstructured-ingest \
1616
s3 \
1717
--remote-url $AWS_S3_URL \
1818
--key $AWS_ACCESS_KEY_ID \
19-
--secret $AWS_SECRET_ACCESS_KEY
19+
--secret $AWS_SECRET_ACCESS_KEY \
20+
--token $AWS_STS_TOKEN # If using AWS STS token.
2021
```

snippets/destination_connectors/s3.v2.py.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ if __name__ == "__main__":
4141
destination_connection_config=S3ConnectionConfig(
4242
access_config=S3AccessConfig(
4343
key=os.getenv("AWS_ACCESS_KEY_ID"),
44-
secret=os.getenv("AWS_SECRET_ACCESS_KEY")
44+
secret=os.getenv("AWS_SECRET_ACCESS_KEY"),
45+
token=os.getenv("AWS_STS_TOKEN", None), # If using AWS STS token.
4546
)
4647
),
4748
uploader_config=S3UploaderConfig(remote_url=os.getenv("AWS_S3_URL"))

snippets/destination_connectors/s3_rest_create.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ curl --request 'POST' --location \
1515
1616
# For AWS STS token authentication:
1717
"token": "<token>",
18+
"key": "<key>",
19+
"secret": "<secret>",
1820
1921
"remote_url": "<remote_url>",
2022
"endpoint_url": "<endpoint-url>",

snippets/destination_connectors/s3_sdk.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ with UnstructuredClient(api_key_auth=os.getenv("UNSTRUCTURED_API_KEY")) as clien
2121
secret="<secret>",
2222

2323
# For AWS STS token authentication:
24+
key="<key>",
25+
secret="<secret>",
2426
token="<token>",
2527

2628
remote_url="<remote_url>",

snippets/general-shared-text/s3-api-placeholders.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
- `<name>` (_required_) - A unique name for this connector.
2-
- For AWS access key ID with AWS secret access key authentication:
2+
- For AWS access key ID with AWS secret access key authentication, or for AWS STS token authentication:
33

44
- `<key>` - The AWS access key ID for the authenticated AWS IAM user (_required_).
55
- `<secret>` - The AWS secret access key corresponding to the preceding AWS access key ID (_required_).

snippets/general-shared-text/s3-cli-api.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ The following environment variables:
1515

1616
- `AWS_ACCESS_KEY_ID` - The AWS access key ID for the authenticated AWS IAM user, represented by `--key` (CLI) or `key` (Python).
1717
- `AWS_SECRET_ACCESS_KEY` - The corresponding AWS secret access key, represented by `--secret` (CLI) or `secret` (Python).
18-
- `AWS_TOKEN` - If required, the AWS STS session token for temporary access, represented by `--token` (CLI) or `token` (Python).
18+
- `AWS_STS_TOKEN` - If required, the AWS STS session token for temporary access, represented by `--token` (CLI) or `token` (Python).
1919

2020
- If the bucket has anonymous access enabled for reading from the bucket, set `--anonymous` (CLI) or `anonymous=True` (Python) instead.

snippets/general-shared-text/s3-platform.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Fill in the following fields:
33
- **Name** (_required_): A unique name for this connector.
44
- **Bucket URI** (_required_): The URI for the bucket or folder, formatted as `s3://my-bucket/` (if the files are in the bucket's root) or `s3://my-bucket/my-folder/`.
55
- **Recursive** (source connector only): Check this box to access subfolders within the bucket.
6-
- **AWS Key**: For secret authentication, the AWS access key ID for the authenticated AWS IAM user.
7-
- **AWS Secret Key**: For secret authentication, the AWS secret access key corresponding to the preceding AWS access key ID.
8-
- **Token**: For token authentication, the AWS STS session token for temporary access.
6+
- **AWS Key**: For secret or token authentication, the AWS access key ID for the authenticated AWS IAM user.
7+
- **AWS Secret Key**: For secret or token authentication, the AWS secret access key corresponding to the preceding AWS access key ID.
8+
- **STS Token**: For token authentication, the AWS STS session token for temporary access.
99
- **Custom URL**: A custom URL, if connecting to a non-AWS S3 bucket.

snippets/source_connectors/s3.sh.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ unstructured-ingest \
99
--download-dir $LOCAL_FILE_DOWNLOAD_DIR \
1010
--key $AWS_ACCESS_KEY_ID \
1111
--secret $AWS_SECRET_ACCESS_KEY \
12+
--token $AWS_STS_TOKEN \ # If using AWS STS token.
1213
--partition-by-api \
1314
--api-key $UNSTRUCTURED_API_KEY \
1415
--partition-endpoint $UNSTRUCTURED_API_URL \

snippets/source_connectors/s3.v2.py.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ if __name__ == "__main__":
2424
source_connection_config=S3ConnectionConfig(
2525
access_config=S3AccessConfig(
2626
key=os.getenv("AWS_ACCESS_KEY_ID"),
27-
secret=os.getenv("AWS_SECRET_ACCESS_KEY")
27+
secret=os.getenv("AWS_SECRET_ACCESS_KEY"),
28+
token=os.getenv("AWS_STS_TOKEN", None) # If using AWS STS token.
2829
)
2930
),
3031
partitioner_config=PartitionerConfig(

snippets/source_connectors/s3_rest_create.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ curl --request 'POST' --location \
1818
1919
# For AWS STS token authentication:
2020
"token": "<token>",
21+
"key": "<key>",
22+
"secret": "<secret>",
2123
2224
"remote_url": "<remote_url>",
2325
"endpoint_url": "<endpoint-url>",

0 commit comments

Comments
 (0)