Skip to main content

Bucket snapshots and forks

This page covers how to enable and use snapshots and forks on your Tigris buckets. For an overview of the concepts, see Snapshots and Forks.

Snapshots and forks are opt-in features. To enable them on a bucket, you must set a special header at creation time.

Enabling snapshots and forks

To enable snapshots and forks, set the X-Tigris-Enable-Snapshot: true header when creating the bucket.

Example using the Go SDK github.com/aws/aws-sdk-go-v2/service/s3:

func createBucketWithSnapshotEnabled(ctx context.Context, client *s3.Client, bucketName string) error {
_, err := client.CreateBucket(ctx, &s3.CreateBucketInput{Bucket: aws.String(bucketName)}, func(options *s3.Options) {
options.APIOptions = append(options.APIOptions, http.AddHeaderValue("X-Tigris-Enable-Snapshot", "true"))
})
return err
}

Creating a snapshot

Snapshots are created with the same CreateBucket API call, with an additional header: X-Tigris-Snapshot: true.

Snapshot name can optionally be specified as part of that header (with semicolon separator), e.g., X-Tigris-Snapshot: true; name=test snapshot name.

The version of the snapshot created is returned in the X-Tigris-Snapshot-Version header of the response.

Example using the Go SDK github.com/aws/aws-sdk-go-v2/service/s3:

func createBucketSnapshot(ctx context.Context, client *s3.Client, bucketName string, snapshotName string) (string, error) {
resp, err := client.CreateBucket(ctx, &s3.CreateBucketInput{Bucket: aws.String(bucketName)}, func(options *s3.Options) {
options.APIOptions = append(options.APIOptions, http.AddHeaderValue("X-Tigris-Snapshot", fmt.Sprintf("true; name=%s", snapshotName)))
})
if err != nil {
return "", err
}
rawResp := middleware.GetRawResponse(resp.ResultMetadata).(*http.Response)
return rawResp.Header.Get("X-Tigris-Snapshot-Version"), nil
}

Listing snapshots

Snapshots are listed with the same ListBuckets API call, with an additional header: X-Tigris-Snapshot: <BUCKET_NAME>.

To list snapshots for a bucket, make a list buckets request and set the X-Tigris-Snapshot header to the bucket name, e.g., X-Tigris-Snapshot: test-bucket.

Example using the Go SDK github.com/aws/aws-sdk-go-v2/service/s3:

func listSnapshotsForBucket(ctx context.Context, client *s3.Client, bucketName string) (*s3.ListBucketsOutput, error) {
return client.ListBuckets(ctx, &s3.ListBucketsInput{}, func(options *s3.Options) {
options.APIOptions = append(options.APIOptions, http.AddHeaderValue("X-Tigris-Snapshot", bucketName))
})
}

Example list snapshots response

The response will contain the list of snapshots for the bucket including the name and creation date of the snapshot. The response format is S3-compatible. Name tag here showing snapshot version with the name if added during snapshot creation time.

<ListAllMyBucketsResult>
<Buckets>
<Bucket>
<Name>1751631910196672425; name=my first snapshot</Name>
<CreationDate>2025-07-04T12:25:10.19667705Z</CreationDate>
</Bucket>
<Bucket>
<Name>1751631910169675092</Name>
<CreationDate>2025-07-04T12:25:10.16968055Z</CreationDate>
</Bucket>
<Bucket>
<Name>1751631910140685342; name=another snapshot</Name>
<CreationDate>2025-07-04T12:25:10.141025675Z</CreationDate>
</Bucket>
</Buckets>
<ContinuationToken>1751631910140685342</ContinuationToken>
</ListAllMyBucketsResult>

Creating a forked bucket

Forks are also created via the CreateBucket API, specifying a source bucket (and optionally a snapshot).

To create a bucket which is a fork of another bucket, specify the X-Tigris-Fork-Source-Bucket: <BUCKET_NAME> header where <BUCKET_NAME> is the name of the bucket you want to use as the fork source.

Add the X-Tigris-Fork-Source-Bucket-Snapshot: <SNAPSHOT_VERSION> header (e.g. X-Tigris-Fork-Source-Bucket-Snapshot: 1751631910140685342) if you want to use a specific snapshot of the source bucket for the fork. If this header is not set, then a new snapshot of the source bucket will be created at the current time and used for creating the fork bucket.

Example using the Go SDK github.com/aws/aws-sdk-go-v2/service/s3:

func createBucketFork(ctx context.Context, client *s3.Client, bucketName string) error {
_, err := client.CreateBucket(ctx, &s3.CreateBucketInput{Bucket: aws.String(bucketName)}, func(options *s3.Options) {
options.APIOptions = append(options.APIOptions, http.AddHeaderValue("X-Tigris-Fork-Source-Bucket", "source-bucket"))
})
return err
}

Retrieving snapshot and fork info for a bucket

Information related to snapshots and forks for an existing bucket can be retrieved by making a HeadBucket request. The response of the request will include custom Tigris headers with the details:

  • The X-Tigris-Enable-Snapshot header will always be present and will be set to "true" for snapshot-enabled buckets.
  • X-Tigris-Fork-Source-Bucket and X-Tigris-Fork-Source-Bucket-Snapshot will only be set for fork buckets and will contain the source bucket name and snapshot versions respectively.
  • X-Tigris-Is-Fork-Parent will only be present for source buckets that have forks and will be set to "true".

Note: These are not standard AWS S3 headers, and in order to retrieve them, the raw HTTP response will need to be used. Here is an example for checking whether snapshot is enabled for a bucket:

Example using the Go SDK github.com/aws/aws-sdk-go-v2/service/s3:

func hasSnapshotEnabled(ctx context.Context, client *s3.Client, bucketName string) (bool, error) {
resp, err := client.HeadBucket(ctx, &s3.HeadBucketInput{Bucket: aws.String(bucketName)})
if err != nil {
return false, err
}
rawResp := middleware.GetRawResponse(resp.ResultMetadata).(*http.Response)
return rawResp.Header.Get("X-Tigris-Enable-Snapshot") == "true", nil
}

Listing and retrieving objects from a snapshot

Objects can be listed in a snapshot with the same ListObjectsV2 API call, with an additional header: X-Tigris-Snapshot-Version: SNAPSHOT_VERSION. Similarly, specific versions of an object in a particular snapshot can be retrieved with the same GetObject API call and header. The same approach also applies to HeadObject requests.

Below is an example of retrieving an object from a snapshot:

Example using the Go SDK github.com/aws/aws-sdk-go-v2/service/s3:

func getObjectFromSnapshot(ctx context.Context, client *s3.Client, bucket string, object string, snapshotVersion string) (*s3.GetObjectOutput, error) {
return client.GetObject(ctx, &s3.GetObjectInput{Bucket: aws.String(bucket), Key: aws.String(object)}, func(options *s3.Options) {
options.APIOptions = append(options.APIOptions, http.AddHeaderValue("X-Tigris-Snapshot-Version", snapshotVersion))
})
}
note

Check out the examples in the tigris-boto3-ext repo for more details on how to use the snapshot and forking feature with the Python boto3 SDK.

Using a forked bucket

Forked buckets behave the same as regular buckets, and you can use the usual tooling (AWS CLI or SDK) to work with them.

The only restriction is that the source bucket cannot be deleted while forked buckets depend on it.

Authorization

Snapshot and fork operations on existing buckets are limited to users who are bucket owners, organization admins, or have ReadOnly (or Editor) access to the buckets. This includes all operations mentioned above, such as creating a snapshot, creating a fork from a specific source bucket, or listing objects in a snapshot.