Object storage

Create a private S3-compatible bucket for uploads and files, and use it from a service with the AWS SDK.

A Dekka bucket speaks the S3 API, so the AWS SDKs and most S3 libraries work with it. Buckets are private, and only services you connect to a bucket can read or write its objects.

Create a bucket

On the canvas, choose Add, then Object storage, give the bucket a name and choose Create bucket. Public buckets aren't available yet, so to serve a file to browsers, have a service read it from the bucket and return it.

Object storage in your organisation counts against one allowance: 250 MiB on Free, 2 GiB on Starter and 10 GiB on Growth.

Use a bucket from a service

Connect the service to the bucket, and it receives S3_ENDPOINT, S3_BUCKET, S3_ACCESS_KEY_ID and S3_SECRET_ACCESS_KEY. Use path-style requests.

import { S3Client, PutObjectCommand } from "@aws-sdk/client-s3";

const credentials = {
  accessKeyId: process.env.S3_ACCESS_KEY_ID!,
  secretAccessKey: process.env.S3_SECRET_ACCESS_KEY!,
};

const s3 = new S3Client({
  endpoint: process.env.S3_ENDPOINT,
  region: "auto",
  forcePathStyle: true,
  credentials,
});

await s3.send(new PutObjectCommand({ Bucket: process.env.S3_BUCKET, Key: "hello.txt", Body: "Hello from Dekka" }));
import os
import boto3
from botocore.config import Config

s3 = boto3.client(
    "s3",
    endpoint_url=os.environ["S3_ENDPOINT"],
    aws_access_key_id=os.environ["S3_ACCESS_KEY_ID"],
    aws_secret_access_key=os.environ["S3_SECRET_ACCESS_KEY"],
    config=Config(s3={"addressing_style": "path"}),
)

s3.put_object(Bucket=os.environ["S3_BUCKET"], Key="hello.txt", Body=b"Hello from Dekka")

Each connected service gets keys scoped to this one bucket, so a leaked key can't reach anything else.

Delete a bucket

Disconnect every service, then choose Delete bucket from the bucket's menu and type its name. This deletes every object in it, and objects in buckets aren't backed up.