lizard s3

Upload and list objects in a Managed Object Storage bucket, and print temporary download links.

Usage

lizard s3 upload <file> [flags]
lizard s3 list [flags]
lizard s3 url <key> [flags]

All three commands work on the project’s only S3 addon and its default bucket unless you pass --addon and --bucket. Add the addon first with lizard add s3.

Subcommands

lizard s3 upload <file>

Upload a local file. Prints the key, ETag, size, and a URL when the bucket is public. The default bucket is private; make a bucket public from the S3 browser in the dashboard.

upload sends the whole file through the Lizard API in one request, up to 150 MB. For larger files, use an S3 client with the addon’s credentials; see Managed Object Storage.

FlagDescription
--addon <name>S3 addon name or ID (default: the project’s only S3 addon)
--bucket <name>Target bucket (default default)
--key <key>Object key (default: the file’s name)
--content-type <type>Content-Type header (default: guessed from the file extension)
-p, --project <id>Project name, slug, or ID

lizard s3 url <key>

Print a temporary download link for an object. Anyone with the link can download the object until it expires, even from a private bucket, with no credentials. With --json it prints url, key, bucket, expiresIn and expiresAt.

FlagDescription
--addon <name>S3 addon name or ID (default: the project’s only S3 addon)
--bucket <name>Bucket (default default)
--expires <seconds>How long the link works, in seconds (default 3600, max 604800 = 7 days)
-p, --project <id>Project name, slug, or ID

lizard s3 list

List objects in a bucket (alias ls).

FlagDescription
--addon <name>S3 addon name or ID
--bucket <name>Bucket to list (default default)
--prefix <prefix>Only keys under this prefix
-p, --project <id>Project name, slug, or ID

Each account can store up to 16 GiB across its addons. Storage is billed by stored bytes at $0.0135 per GB-month.

Examples

Upload a file

lizard s3 upload ./logo.png --key assets/logo.png

Share a private file for a day

lizard s3 url assets/logo.png --expires 86400

List objects under a prefix

lizard s3 list --prefix assets/

Use a second S3 addon

lizard s3 upload ./backup.tar.gz --addon s3-autumn-bear

See also

Updated