Buckets
Storage for files that works like S3. For anything your app should not keep on its own disk.
On this page
What it is
A bucket is storage for files. It speaks the S3 API, so your app writes to it with any S3 client. The files live outside the container and outside any single machine. They stay when you restart or delete the app.
A project has two kinds of storage that klickops runs for you: databases and buckets. A volume is a disk attached to one app. A bucket is a service that several apps can read and write.
When you'd use it
- User uploads, generated PDFs and exports. Anything a browser downloads later.
- Files that more than one app needs to see.
- Data that would make a volume grow without limit.
A bucket is not a filesystem. There are no real folders. You can't overwrite part of a file or append to it. If your code needs to jump around inside a file, use a volume.
Create one
- Open the project. Go to Buckets, then Add bucket.
- Give it a name and a size.
- Create it. It's ready in a few seconds, because no cluster has to start.
Connecting an app
Open the bucket and go to Access. You see the endpoint, region, bucket name, access key and secret key. That's everything an S3 client asks for. To give them to an app, click Use in app… on the bucket in the Vault under Connections. The app gets them as the standard AWS_* variables. Most S3 SDKs read them on their own.
The secret key works like every other secret in klickops. Only editors can read it. klickops shows it only when you ask for it, and never in a list.
Settings reference
| Setting | Default | What it does |
|---|---|---|
| Name | none | Names the bucket. You can't change it later. |
| Size | 10 GB | A hard limit for the bucket. On the free plan, each bucket can hold at most 1 GB. |
| Versioning | off | Keeps old versions when an object is overwritten. You can undo a bad write. |
| Lifecycle | off | Deletes objects automatically after a number of days. |
Limits and gotchas
- Versioning starts off and only works from the moment you turn it on. Turn it on before something important gets overwritten. It can't bring back older versions.
- Lifecycle deletes for good. An expiry rule is a scheduled deletion, and klickops doesn't ask again.
- Large buckets are slow to list. The Objects tab is for a quick look. Use an S3 client for millions of objects or bulk work.
- Your S3 client must sign
Content-Type. An upload that sends aContent-Typeheader without signing it gets 403AccessDenied, while listing and deleting work. The AWS SDKs for JavaScript (v3), Python and Go sign it. aws4fetch, aws-sdk-php before 3.385.3 and the MinIO clients overhttp://don't: leave the header out, or switch to one of those SDKs. A string body counts as a header too, because Node addstext/plainon its own, so send bytes. - Buckets are not part of the project's recovery points. The storage layer underneath keeps them durable.