Amazon S3
Synopsis
Amazon S3 device processes files from Amazon S3 buckets using SQS event notifications. Director polls an SQS queue at configured intervals to receive S3 object-created events, downloads the referenced objects, and processes them through DataStream pipelines. The device supports multiple file formats including JSON, JSONL, Parquet, and compressed archives.
Schema
- id: <numeric>
name: <string>
description: <string>
type: awss3
tags: <string[]>
pipelines: <pipeline[]>
status: <boolean>
properties:
region: <string>
endpoint: <string>
use_path_style: <boolean>
access_key_id: <string>
secret_access_key: <string>
session_token: <string>
queue_url: <string>
role_arn: <string>
bucket: <string>
object_size: <numeric>
timeout: <numeric>
file_name_filter: <string>
max_files_in_archive: <numeric>
max_size_archive_bytes: <numeric>
sqs_max_messages: <numeric>
sqs_visibility_timeout: <numeric>
sqs_wait_time_seconds: <numeric>
mode: <enum>
prefix: <string>
workers: <numeric>
event_split_rules: <string[]>
Configuration
The following fields are used to define the device:
Device
| Field | Required | Default | Description |
|---|---|---|---|
id | Y | - | Unique numeric identifier |
name | Y | - | Device name |
description | N | - | Optional description of the device's purpose |
type | Y | - | Device type identifier (must be awss3) |
tags | N | - | Array of labels for categorization |
pipelines | N | - | Array of preprocessing pipeline references |
status | N | true | Boolean flag to enable/disable the device |
AWS Connection
| Field | Required | Default | Description |
|---|---|---|---|
region | Y | - | AWS region where S3 bucket and SQS queue are located |
endpoint | N | - | Custom endpoint URL for the S3, SQS, and STS clients (e.g., LocalStack). Leave empty for standard AWS |
use_path_style | N | computed | Use path-style S3 addressing. Derived from endpoint when unset: false for an empty endpoint or an amazonaws.com host, true for any other endpoint — so a custom S3-compatible endpoint (MinIO, LocalStack, Ceph) gets path-style without configuration. Set it explicitly to override |
queue_url | Y | - | SQS queue URL that receives S3 event notifications |
access_key_id | Y* | - | AWS access key ID for static-credential authentication |
secret_access_key | Y* | - | AWS secret access key for static-credential authentication |
session_token | N | - | AWS session token for temporary credentials |
role_arn | N | - | AWS IAM role ARN to assume for cross-account access |
bucket | N | - | S3 bucket name. Used only for startup validation (HeadBucket when set, ListBuckets when empty); does not restrict event processing |
object_size | N | 100000000 | Maximum S3 object size in bytes to download (default: 100 MB) |
* = Conditionally required (see Authentication Methods below). access_key_id and secret_access_key must be provided together when using static credentials.
File Processing
| Field | Required | Default | Description |
|---|---|---|---|
timeout | N | 1 | queue mode only. Idle backoff in seconds when the queue is empty and long polling is off (sqs_wait_time_seconds: 0); with long polling on, SQS does the waiting and this value is not used (1-10) |
file_name_filter | N | ".*" | Regular expression filter for S3 object keys |
mode | N | queue | Ingestion mode: queue or poll. See Ingestion Modes |
prefix | N | - | Restrict ingestion to keys under this prefix. In poll mode it may carry date tokens |
workers | N | max(NumCPU/4, 1) | Concurrent download and decode workers, 1-64 |
max_files_in_archive | N | 100 | Maximum number of files to process from an archive. 0 or an empty value uses the default |
max_size_archive_bytes | N | 104857600 | Maximum total size of archive contents in bytes (100 MB). 0 or an empty value uses the default |
SQS Configuration
| Field | Required | Default | Description |
|---|---|---|---|
sqs_max_messages | N | 10 | Maximum messages to receive per poll (1-10) |
sqs_visibility_timeout | N | 300 | Message visibility timeout in seconds (0-43200) |
sqs_wait_time_seconds | N | 20 | Long polling wait time in seconds (0-20) |
Authentication Methods
The device supports multiple authentication methods:
- IAM role: Omit credentials to use the instance/task IAM role.
- Access keys: Provide
access_key_idandsecret_access_keyfor static credentials. - Role Assumption: Provide
role_arnto assume a different IAM role. - Temporary Credentials: Include
session_tokenalongside access keys for temporary security credentials.
Credential fields (access_key_id, secret_access_key, session_token, role_arn) support ${ENV_VAR} and $secret{...} token resolution.
Event Split Rules
| Field | Required | Default | Description |
|---|---|---|---|
event_split_rules | N | - | Ordered list of rule set keys that split each file into separate logs. See Event Split Rules |
In the console, the list is
The unit is the file, not the message. The Director checks the rules once for each file, against the start of the file after it is decompressed: as many bytes as the rule set's inspectBytes) allows. The first rule that matches splits the whole file as the Director reads it, so a large file is never held in memory whole. A condition reads the file's path, <bucket>/<key>, as source. A file that no rule matches is read as before: by the decoder for its extension, and the device's split_mode then splits each record. Each file inside an archive is matched on its own, and Parquet files are never matched. A file of an extension the device does not read, such as .csv, is refused before the rules are checked, so a matching rule does not make it readable. The device still acknowledges a file as a whole: its queue message, or its place in the listing, waits until all of the file's logs are delivered.
A Director reads the list from version 2.5.1. An older one ignores it and reads each file by its extension. The awss3replay device does not take the setting. Changing the list restarts the device; editing a rule set it uses does not.
Ingest Buffer
| Field | Required | Default | Description |
|---|---|---|---|
max_buffer_size | N | 128MB | Ingest buffer admission cap. Also sizes this listener's ingest buffers: 3/8 of this value at start, growing to at most 3x |
max_buffer_size is the ingest-buffer admission cap. Left unset it is 128MB, whose buffers take 48 MiB of heap per listener worker at start and grow to at most 384 MiB as bursts need the room — and with reuse: true a device runs one worker per listener. Size strings are binary, and 32MB and 32MiB are exact synonyms.
See Listener Memory Sizing for the arithmetic, the sizing table, and what happens when the cap is exhausted.
Details
Ingestion Modes
This device offers two ingestion modes, selected with mode:
mode | Behaviour |
|---|---|
queue | Default. The device consumes notifications from the bucket's event queue and fetches each object as it is announced. |
poll | The device lists the bucket on a schedule and ingests what it has not seen before. No queue is needed. |
Any other value fails with mode field not valid.
Poll mode suits a bucket with no notification wiring, and a historical backfill, since a listing can be bounded to a date range. It costs a list operation per cycle, so it is the wrong choice for a high-rate bucket that already has a queue.
Poll Mode Properties
These are read only when mode: poll is set.
| Field | Required | Default | Description |
|---|---|---|---|
interval | N | 60 | Seconds between list cycles. When cron is set as well, a cycle starts when either is due. The default applies only when cron is unset |
cron | N | - | Cron expression for the list cycle. Alone, it is the only schedule; with interval, a cycle starts when either is due. An invalid expression is logged and the interval schedule is used instead |
workers | N | max(NumCPU/4, 1) | Concurrent download and decode workers, 1–64 |
max_retries | N | 0 | Consecutive cycles an object may fail transiently before the poller gives up on it and moves the cursor past it. 0 means never give up |
start_date | N | - | Lower bound of the listing window. Accepts Unix seconds, RFC 3339, a timestamp without an offset (read in timezone), or a relative expression. Unset or negative means the whole bucket |
end_date | N | - | Upper bound, exclusive. Unset means unbounded; a negative value is an error, and a value at or before start_date is rejected |
timezone | N | UTC | Zone used to interpret an offset-less start_date or end_date |
The Cursor
Poll mode keeps a since-cursor so a restart or a cluster failover does not re-ingest what it already has. The cursor is scoped to the listing target — the bucket and prefix together — so changing either starts a fresh one.
A stored cursor takes precedence over start_date, but only while the window is unchanged: editing start_date, end_date or prefix discards the cursor and re-evaluates the new window. A bounded window that has been fully drained stops listing and idles until the window changes.