Sync files from storage
Load recurring CSV feeds from an S3 bucket.
The S3 (direct) source copies files from a bucket into Switchboard. A resource describes one file feed: which objects to read and how to load them. For a single local file, use Create a model from a file.
Before you start
You need Builder, Admin, or a custom role with source editing access. Contact our support team to arrange access to your S3 bucket, including AWS permissions and role configuration. Continue with the connection details from that setup.
Connect the bucket
- Open Sources and select Add Data Source, then S3 (direct).
- Enter a Source name and select Continue.
- Enter Bucket and, if required, Region.
- Enter Access key ID and Secret access key. Alternatively, enter Role ARN and leave the keys blank.
- Enter External ID if the role requires one.
- Select Connect and check the connection result.
Configure a file feed
- Under Resources, select Add resource.
- Enter a Key prefix, such as
orders/. A prefix restricts which object names the source reads. - Choose Mode and Format from the tables below.
- Optionally enter a Key pattern. This regular expression must match the full object name.
- For New files, set primary keys that identify each row.
_s3_keyand_lineidentify a row within a file. - Review the resource schedule. Select Add resource.
- Select Synchronize now and check the resource's status.
| Mode | Behavior |
|---|---|
| Latest file | Reloads the dataset from the newest matching file each run. |
| All files | Reads every matching file each run. Use for a static set of files. |
| New files | Loads files that have not been loaded. Updates matching rows using the primary keys. |
| Format | Input |
|---|---|
| From the file extension | Infer the format from the object name. |
| CSV | A CSV file. |
| CSV, gzip-compressed | A compressed CSV file. |
| Zip holding one CSV | A ZIP archive containing one CSV. |
Configure dated feeds
In New files mode, Date partition describes a date within the object path, such as %Y/%m/%d.
Lookback days controls how many recent day paths each run lists. The default is 2.
Dedupe on names columns for removing duplicate rows within a run.
Keep the latest by selects the column that decides which duplicate to keep.
If it is blank, the last row read is kept.
The default resource schedule is daily at 05:00 UTC. Set it after the files arrive.
Verify the imported rows
The source loads file columns as text. Use a model to convert dates and numbers.
Rows also include _s3_key, _s3_last_modified, and _line for tracing the source file.
If the feed is empty, check the prefix, pattern, and file format.
Contact our support team for bucket access or permission errors.