v0.2.8-beta
S3
Object storage emulation.
Partial Support
Supported Operations
| Operation | Status | Notes |
|---|---|---|
| CreateBucket | Supported | Path-style; honours LocationConstraint and signing region |
| DeleteBucket | Supported | Must be empty |
| ListBuckets | Supported | |
| HeadBucket | Supported | Returns x-amz-bucket-region header |
| PutObject | Supported | Basic put, no server-side encryption |
| GetObject | Supported | |
| DeleteObject | Supported | |
| ListObjects | Supported | |
| CopyObject | Supported | Handles non-ASCII keys |
| HeadObject | Supported | |
| CreateMultipartUpload | Supported | Multipart upload initiation |
| UploadPart | Supported | Upload individual parts |
| CompleteMultipartUpload | Supported | Assemble uploaded parts |
| AbortMultipartUpload | Supported | Discard an in-progress upload |
| PutBucketNotificationConfiguration | Supported | Lambda notifications only |
| GetBucketNotificationConfiguration | Supported | Lambda 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.txtAdditional Features
- Multipart uploads
- Bucket notification configuration for Lambda targets
- Prefix and suffix filters on Lambda bucket notifications
CreateBucketparsesLocationConstraintfrom the request body and rejects explicitus-east-1(matching real AWS behaviour). When no body is sent, the signing region from theAuthorizationheader is used.HeadBucketreturns the stored region in thex-amz-bucket-regionresponse headerGetBucketLocationreturns 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