Skip to content
v0.2.8-beta

S3

Object storage emulation.

Partial Support

Supported Operations

OperationStatusNotes
CreateBucketSupportedPath-style; honours LocationConstraint and signing region
DeleteBucketSupportedMust be empty
ListBucketsSupported
HeadBucketSupportedReturns x-amz-bucket-region header
PutObjectSupportedBasic put, no server-side encryption
GetObjectSupported
DeleteObjectSupported
ListObjectsSupported
CopyObjectSupportedHandles non-ASCII keys
HeadObjectSupported
CreateMultipartUploadSupportedMultipart upload initiation
UploadPartSupportedUpload individual parts
CompleteMultipartUploadSupportedAssemble uploaded parts
AbortMultipartUploadSupportedDiscard an in-progress upload
PutBucketNotificationConfigurationSupportedLambda notifications only
GetBucketNotificationConfigurationSupportedLambda notifications only

Examples

Using AWS SDK

JavaScript
javascript
import { S3Client, CreateBucketCommand, PutObjectCommand, GetObjectCommand } from "@aws-sdk/client-s3";

const s3 = new S3Client({
  endpoint: "http://127.0.0.1:4566",
  region: "us-east-1",
  credentials: { accessKeyId: "test", secretAccessKey: "test" }
});

// Create bucket
await s3.send(new CreateBucketCommand({ Bucket: "my-bucket" }));

// Put object
await s3.send(new PutObjectCommand({
  Bucket: "my-bucket",
  Key: "file.txt",
  Body: "Hello World"
}));

// Get object
const obj = await s3.send(new GetObjectCommand({
  Bucket: "my-bucket",
  Key: "file.txt"
}));

console.log(await obj.Body?.transformToString());

Access URL Format

S3 objects in Tarn use path-style URLs:

http://127.0.0.1:4566/_s3/{bucket}/{key}

Example:

bash
curl http://127.0.0.1:4566/_s3/my-bucket/file.txt

Additional Features

  • Multipart uploads
  • Bucket notification configuration for Lambda targets
  • Prefix and suffix filters on Lambda bucket notifications
  • CreateBucket parses LocationConstraint from the request body and rejects explicit us-east-1 (matching real AWS behaviour). When no body is sent, the signing region from the Authorization header is used.
  • HeadBucket returns the stored region in the x-amz-bucket-region response header
  • GetBucketLocation returns the region the bucket was created in

Known Limitations

  • Path-style only (no virtual-hosted style: bucket.s3.amazonaws.com)
  • No versioning
  • No lifecycle policies
  • No server-side encryption
  • No bucket policies or ACLs
  • Bucket notifications support Lambda targets only

Released under the Apache 2.0 License