S3-Compatible Storage

Store files, images, and documents using any S3-compatible object storage service including AWS S3, Scaleway Object Storage, MinIO, DigitalOcean Spaces, and more.

Setup

# .env
S3_ENDPOINT=https://s3.fr-par.scw.cloud
S3_ACCESS_KEY_ID=...
S3_SECRET_ACCESS_KEY=...
S3_BUCKET=my-bucket
S3_REGION=fr-par

Uploading files

capabilityId: s3-upload
provider:
  type: s3
  operation: upload

inputs:
  key:
    type: string
    description: "File path in bucket"
  file:
    type: file
  contentType:
    type: string
    optional: true
  metadata:
    type: object
    optional: true

outputs:
  url:
    type: string
  etag:
    type: string

Generating presigned URLs

capabilityId: s3-presigned-url
provider:
  type: s3
  operation: getPresignedUrl

inputs:
  key:
    type: string
  expiresIn:
    type: number
    default: 3600
    description: "Expiration in seconds"

outputs:
  url:
    type: string

Best practices

  • Use presigned URLs for secure, temporary access
  • Set appropriate CORS policies for browser uploads
  • Enable versioning for important files
  • Use lifecycle policies to archive old files
  • Organize files with a clear key structure