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:https://mybucket.t3.tigrisfiles.io/key-name(primary)https://mybucket.t3.tigrisbucket.io/key-namehttps://mybucket.t3.tigrisblob.io/key-name
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:The AWS credentials will be automatically extracted from the environment.
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: