Skip to main content

Create a Tigris Storage Buckets

Public buckets

By default, buckets are private. If you need to serve public assets like images or JavaScript files, create a public bucket:
You can also make a public bucket private.
Objects in a public bucket can be accessed by anyone without authentication. Public content is served from dedicated domains using the bucket name as a subdomain:
  • https://mybucket.t3.tigrisfiles.io/key-name (primary)
  • https://mybucket.t3.tigrisbucket.io/key-name
  • https://mybucket.t3.tigrisblob.io/key-name
No credentials or pre-signed URLs are needed. For production use, we recommend setting up a custom domain so your public URLs stay stable:
Then create a CNAME record for assets.example.com pointing to mybucket.t3.tigrisbucket.io. See the Tigris Custom Domain docs for full setup instructions and the Tigris Public Bucket docs for details on all available public domains.

Object Level Access Control

By default, all objects inherit the access control settings of the bucket they are in. If a bucket is private, all objects in it are also private and vice versa. However, you can make individual objects in a bucket public-read (or private) by setting an object level ACL on them. This lets you serve a public object from an otherwise private bucket, or a private object from an otherwise public bucket. For details on how to set this up see the Tigris Object ACL docs To verify that everything has gone well, we can check whether the appropriate secrets have been set for our app:

Connecting to the Bucket

The de-facto library for interacting with s3 storage is boto3, let’s add it to the project:
Now we can initialize the client:
The AWS credentials will be automatically extracted from the environment.
Let’s plug that into our app:
At this point you can interact with the bucket through the boto3 interface; refer to the docs for all the possibilities. When you re-deploy your app you should see a list of the buckets you have access to:
Take a look at the gist of this setup to get a full picture.