Skip to main content
Buckets provide cloud object storage for your application - think files, images, videos, documents, and other unstructured data.

What is a Bucket?

A bucket is object storage that:
  • Stores files - Any file type, any size
  • Configurable access - Set read, write, delete permissions
  • Scales automatically - No capacity planning needed
  • Works everywhere - Same interface locally and in production
Basic bucket definition
buckets:
  uploads:
    subtype: # your choice, from target platform
    access:
      api: [read, write, delete]
  profile-images:
    subtype: # your choice, from target platform
    access:
      api: [read, write]
      frontend: [read]

Bucket Configuration

Access Control

Grant services access to buckets:
buckets:
  uploads:
    subtype: # your choice, from target platform
    access:
      api: [read, write, delete]   # Full access
      worker: [read, delete]       # Read and delete only
      frontend: [read]             # Read-only
Permission Types:
  • read - Download/read files
  • write - Upload/write files
  • delete - Delete files
  • all - Shorthand for read, write, delete

Content Path (Static Files)

Deploy static files to a bucket:
buckets:
  frontend:
    subtype: # your choice, from target platform
    content_path: ./build  # Deploy React/Vue/Angular build

entrypoints:
  web:
    subtype: # your choice, from target platform
    routes:
      /: frontend  # Serve static files from bucket
When you deploy, files from ./build are uploaded to the bucket.

Using Buckets in Code

With Suga’s generated SDK:
  • Node.js
  • Python
  • Go
import { SugaClient } from './suga/client';

const suga = new SugaClient();

// Write file
await suga.uploads.write('path/to/file.txt', Buffer.from('data'));

// Read file
const data = await suga.uploads.read('path/to/file.txt');

// Delete file
await suga.uploads.delete('path/to/file.txt');

Suga Client Libraries

Learn how to access resources from your service code

Local Development

During suga dev, buckets are emulated using the filesystem:
.suga/
└── buckets/
    └── uploads/
        └── file.txt
You can:
  • View files in .suga/buckets/{bucket-name}/
  • Seed buckets by placing files there
  • Test bucket operations without cloud access

Local Development

Learn how to develop buckets locally with Suga

Learn More