S3¶
AWS S3 and S3-compatible object storage (MinIO, DigitalOcean Spaces, etc.). Use it for file uploads, backups, static assets, or any object storage workflow.
Configuration¶
connector "s3" {
type = "s3"
bucket = env("S3_BUCKET")
region = env("AWS_REGION")
access_key = env("AWS_ACCESS_KEY_ID")
secret_key = env("AWS_SECRET_ACCESS_KEY")
# For MinIO or other S3-compatible storage
endpoint = "http://localhost:9000"
use_path_style = true
}
| Option | Type | Default | Description |
|---|---|---|---|
driver |
string | — | Must be s3 |
bucket |
string | — | S3 bucket name |
region |
string | — | AWS region |
access_key |
string | — | AWS access key ID |
secret_key |
string | — | AWS secret access key |
endpoint |
string | — | Custom endpoint for S3-compatible storage |
use_path_style |
bool | false |
Use path-style URLs (required for MinIO) |
Operations¶
| Operation | Direction | Description |
|---|---|---|
read |
read | Read an object |
write |
write | Write an object |
list |
read | List objects by prefix |
delete |
write | Delete an object |
exists |
read | Whether an object is there |
head |
read | An object's size, type and last modification |
stat |
read | The same, under the other name |
copy |
write | Copy an object within the bucket |
move |
write | Copy it and remove the original |
presign_get |
read | A link that carries its own permission to read |
presign_put |
write | The same, to upload |
read and write are what a flow's from and to use; all of them can be
asked for by name from a step, where the object is named by key:
step "link" {
connector = "objects"
operation = "presign_get"
params = { key = "input.filename", expires_in = "3600" }
}
Example¶
flow "upload_file" {
from {
connector = "api"
operation = "POST /upload"
}
to {
connector = "s3"
operation = "write"
target = "uploads/"
}
}
flow "download_file" {
from {
connector = "api"
operation = "GET /files/:key"
}
to { connector = "s3" }
}
See the s3 example for a complete working setup.
Full configuration reference: See S3 in the Configuration Reference.