Skip to main content

Creating a Bucket

To upload your data to Tigris, you must first create a bucket. When you create a bucket, you must choose a bucket name. After you create a bucket, you cannot change the bucket name. Buckets are global, and Tigris automatically stores the data close to your users. If your users move to a different region, the data moves with them.

The user that creates the bucket owns it. You can upload any number of objects to a bucket.

Buckets and the objects in them are private and can be accessed only via access keys that you explicitly grant access permissions to.

Bucket location

When you create a bucket, you can choose the location type for the bucket. The location type controls where your data is stored and how it is replicated across regions. For more information on location types, please see the bucket locations documentation: Bucket Locations.

The default location type is global. To select a different location type with the S3 API, see Creating a bucket in a specific location.

Bucket tier

When you create a bucket, you can set the default object tier for all objects uploaded to it. The default tier can be one of the following:

  • Standard
  • Infrequent Access
  • Archive
  • Archive instant retrieval

The default tier can be overridden at the object level. You can also change the bucket's default tier after creation from Bucket Settings; the change applies only to new objects. For more information, see the Storage Tiers guide.

Creating a bucket using the Dashboard

To create a bucket using the Tigris Dashboard, follow these steps:

  1. Go to storage.new.
  2. Enter a unique bucket name. (Rules)
  3. Choose the bucket location type.
  4. Choose the default tier for the bucket.
  5. Click Create Bucket.

Create Tigris Bucket

Creating a bucket using the AWS CLI

Assuming you have the AWS CLI configured as shown in the AWS CLI guide, you can create a bucket as follows:

aws s3api --endpoint-url https://t3.storage.dev create-bucket --bucket foo-bucket
$ aws s3api --endpoint-url https://t3.storage.dev create-bucket --bucket foo-bucket
{
"Location": "/foo-bucket"
}

Creating a bucket in a specific location

To select a location type, set LocationConstraint in the create bucket request. The value selects the location type:

Location typeLocationConstraint valueExample
GlobalOmit the value, or use autoauto
Single-regionOne region codeiad
Dual-regionTwo region codes, separated by ,iad,sjc
Multi-regionOne geography name: usa or eurusa

The region codes are in the Regions Reference.

To create a single-region bucket in Ashburn, Virginia:

aws s3api --endpoint-url https://t3.storage.dev create-bucket \
--bucket foo-bucket \
--create-bucket-configuration '{"LocationConstraint":"iad"}'

For a different location type, replace the value with iad,sjc or usa. Use the JSON form shown above: the shorthand form of --create-bucket-configuration splits the value on each comma.

Write the value in lower case, with no space after a comma, and do not repeat a region. Tigris rejects any other value with HTTP 400 InvalidArgument.

info

Some S3 clients put their configured region into LocationConstraint automatically. Set the client region to auto so that it does not conflict with the bucket location. See Regions.

If your SDK cannot set LocationConstraint, send the same value in the X-Tigris-Regions header. The header takes precedence over LocationConstraint.

Creating a bucket using flyctl

To create a bucket for one of your Fly apps, run the following command in the directory where your Fly app is located:

fly storage create

This will create a bucket and set the required environment variables for you.

$ fly storage create
? Choose a name, use the default, or leave blank to generate one: demo-bucket
Your project (demo-bucket) is ready. See details and next steps with:

Setting the following secrets on ot-demo:
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
BUCKET_NAME
AWS_ENDPOINT_URL_S3

Secrets are staged for the first deployment

If you want to create a bucket that is not associated with a Fly app, you can run the same command outside of a Fly app directory.

$ fly storage create
? Select Organization: Ovais Tariq (personal)
? Choose a name, use the default, or leave blank to generate one:
Your project (polished-thunder-5646) is ready. See details and next steps with:

Set one or more of the following secrets on your target app.
AWS_ENDPOINT_URL_S3: https://t3.storage.dev
AWS_ACCESS_KEY_ID: xxxxxxxxxxxxxxxxxxxx
AWS_SECRET_ACCESS_KEY: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
BUCKET_NAME: polished-thunder-5646