Managed AddonsObject Storage (S3)

Managed Object Storage

Managed Object Storage on Lizard is S3-compatible storage for uploads, assets, and backups. lizard add s3 creates a private bucket named default and five connection variables, from S3_ENDPOINT to S3_REGION. Use them with any AWS SDK and path-style addressing. Each Managed Object Storage addon can store up to 16 GiB, and you pay for the bytes you store. To serve files without authentication, make the bucket public from the dashboard’s S3 browser. For an overview and prices, see the Managed Object Storage page.

Provision

lizard add s3

The first Managed Object Storage addon is named s3, so references such as ${{s3.S3_ENDPOINT}} work immediately.

Environment variables

VariableDescription
S3_ENDPOINTS3-compatible endpoint URL
S3_DEFAULT_BUCKETThe auto-created bucket name (default)
S3_ACCESS_KEY_IDAccess key
S3_SECRET_ACCESS_KEYSecret key
S3_REGIONRegion

Connect a service

lizard secrets set \
  S3_ENDPOINT='${{s3.S3_ENDPOINT}}' \
  S3_DEFAULT_BUCKET='${{s3.S3_DEFAULT_BUCKET}}' \
  S3_ACCESS_KEY_ID='${{s3.S3_ACCESS_KEY_ID}}' \
  S3_SECRET_ACCESS_KEY='${{s3.S3_SECRET_ACCESS_KEY}}' \
  S3_REGION='${{s3.S3_REGION}}' \
  --service api
lizard redeploy --service api

Using an AWS SDK

The endpoint is S3-compatible. Set path-style addressing:

import { S3Client } from "@aws-sdk/client-s3";
 
const s3 = new S3Client({
  endpoint: process.env.S3_ENDPOINT,
  region: process.env.S3_REGION,
  forcePathStyle: true, // required
  credentials: {
    accessKeyId: process.env.S3_ACCESS_KEY_ID!,
    secretAccessKey: process.env.S3_SECRET_ACCESS_KEY!,
  },
});

Public files

Buckets are private by default. Once you make a bucket public, anyone can read its objects through either address:

  1. Gateway URL (shown in the dashboard):
    https://s3-<region>.onlizard.com/<addonId>/<bucket>/<key>
    <region> is the value of S3_REGION (eu-west-1 or us-east-1).
  2. Platform proxy (the dashboard host, with long-lived immutable cache headers):
    <dashboard-host>/api/s3/<addonId>/public/<bucket>/<key>

Once you make the default bucket public, anyone can read its objects at:

<dashboard-host>/api/s3/<addonId>/public/default/<key>

The S3 browser has two switches for each bucket. Public view lets anyone read its objects. Public edit lets anyone upload or delete them, so turn it on only for a bucket that anyone may change.

To share one object from a private bucket for a while, print a temporary link. It works without credentials until it expires (one hour by default, up to 7 days):

lizard s3 url report.pdf --expires 86400

Presigned URLs from an AWS SDK work too.

Browse objects

Open the S3 browser in the dashboard (lizard open) to upload and delete objects, create folders, and make buckets public or private. From the CLI, lizard s3 upload <file> uploads a file, lizard s3 list lists objects, and lizard s3 url <key> prints a temporary link; see lizard s3.

Bucket ACL changes (making a bucket public/private) require the dashboard; the CLI does not support them yet.

Storage limit

Each Managed Object Storage addon can store up to 16 GiB of objects, counting its default bucket and any others you create. Another addon (lizard add s3) gets its own 16 GiB. You pay for stored bytes, not a reserved size; lizard scale --storage does not change this limit.

See also

Updated