Local AWS Emulator for 37 Services with a 2.2 MiB Footprint
Run S3, DynamoDB, SQS, SNS, STS, IAM, KMS, EventBridge, Secrets Manager, and 28 more AWS services locally or in CI. Delivered as a single zero-dependency static binary or 38 MB multi-arch Docker image. Point any AWS SDK or CLI at AWS_ENDPOINT_URL=http://localhost:4566.
s5cmd or rclone).
Why We Built RustStack: Zero-JVM, Zero-Python Cloud Emulation
Traditional AWS emulators bundle Python interpreters, JVM runtimes, Node.js processes, and gigabytes of dependencies inside a heavy container. RustStack rethinks local cloud emulation from first principles as a single, lock-free async Rust binary.
🔌 Single-Port AWS Protocol Multiplexer
Every AWS service uses slightly different wire conventions. RustStack inspects incoming HTTP headers, X-Amz-Target, query parameters, and hostnames on port 4566 to route requests in sub-microseconds:
- REST-XML & Virtual-Host/Path Routing: Amazon S3, Route 53
- AWS JSON 1.0 / 1.1: DynamoDB, KMS, EventBridge, SSM, Secrets Manager, Logs
- AWS Query (form-urlencoded): STS, IAM, SQS, SNS, RDS, ElastiCache, EC2
- REST-JSON: Lambda, API Gateway v1/v2, AppSync, Bedrock, Pipes
⚡ Cross-Service Reactive Event Bus
Cloud-native integration tests don't test services in isolation — they test event-driven pipelines. RustStack wires all 37 crates together in memory with zero network hops:
- S3 Bucket Notifications:
PutObjecttriggers instant delivery to SQS queues, SNS topics, and EventBridge buses. - SNS → SQS Fanout: FilterPolicy matching and raw message delivery across subscribed queues.
- DynamoDB Streams CDC: Real-time
INSERT/MODIFY/REMOVEshard capture. - EventBridge & Pipes: Content-based JSON rule matching routed directly to target services.
🧪 Built for Deterministic CI & Chaos Testing
Instead of restarting containers between tests, RustStack exposes an instant HTTP control plane on /_ruststack/* and an embedded dark-mode Web Admin UI:
- Atomic State Reset (
<1ms): Wipe all 37 services or selected services between test cases viaPOST /_ruststack/state/reset. - State Snapshots: Export and restore entire multi-service cluster state as JSON.
- Chaos Fault Injection: Inject
ProvisionedThroughputExceededException,503 SlowDown, or latency jitter per service/action.
Resource & Cold-Start Benchmark: RustStack vs. LocalStack vs. MiniStack
Continuously measured on GitHub Actions runners via automated Testcontainers benchmarks (Testcontainers/rust-measure-alternatives).
Idle Memory Footprint (RSS) 177.9x Lighter
Container Cold-Start Time 12.0x Faster
Docker Image Size 31.7x Smaller
Use RustStack in GitHub Actions, Docker, or Testcontainers
Point any AWS SDK (Python boto3, Go aws-sdk-go-v2, JS/TS @aws-sdk/*, Rust aws-sdk-*) or the AWS CLI at RustStack by setting AWS_ENDPOINT_URL=http://localhost:4566.
jobs:
integration-test:
runs-on: ubuntu-latest
services:
ruststack:
image: ehlers320/ruststack:latest
ports:
- 4566:4566
options: >-
--health-cmd "wget -qO- http://localhost:4566/_ruststack/health || exit 1"
--health-interval 2s
--health-timeout 2s
--health-retries 5
env:
AWS_ENDPOINT_URL: http://localhost:4566
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
AWS_DEFAULT_REGION: us-east-1
steps:
- uses: actions/checkout@v4
- name: Run integration tests against local AWS emulator
run: |
aws s3 mb s3://my-ci-bucket
pytest
jobs:
integration-test:
runs-on: ubuntu-latest
env:
AWS_ENDPOINT_URL: http://localhost:4566
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
AWS_DEFAULT_REGION: us-east-1
steps:
- uses: actions/checkout@v4
- name: Start RustStack static binary
run: |
curl -fsSL https://github.com/ehlerst/ruststack/releases/latest/download/ruststack-x86_64-unknown-linux-musl.tar.gz \
| sudo tar xz -C /usr/local/bin
ruststack start --port 4566 &
for i in $(seq 1 20); do
curl -sf http://localhost:4566/_ruststack/health && break
sleep 0.1
done
- name: Run test suite
run: cargo test
# 1. Start RustStack container (or run static binary `ruststack start --port 4566`)
docker run -d --name ruststack -p 4566:4566 ehlers320/ruststack:latest
# 2. Point AWS CLI & SDKs at localhost:4566
export AWS_ENDPOINT_URL=http://localhost:4566
export AWS_ACCESS_KEY_ID=test
export AWS_SECRET_ACCESS_KEY=test
export AWS_DEFAULT_REGION=us-east-1
# 3. Use S3, DynamoDB, SQS, KMS, Secrets Manager immediately
aws s3 mb s3://my-bucket
aws s3 cp README.md s3://my-bucket/README.md
aws sqs create-queue --queue-name orders-queue
aws dynamodb list-tables
# 4. Open Embedded Dark-Mode Web Admin UI
open http://localhost:4566/_ruststack/ui/
# Python Testcontainers + boto3
import boto3
from testcontainers.core.container import DockerContainer
from testcontainers.core.waiting_utils import wait_for_logs
with DockerContainer("ehlers320/ruststack:latest").with_exposed_ports(4566) as container:
endpoint = f"http://{container.get_container_host_ip()}:{container.get_exposed_port(4566)}"
s3 = boto3.client(
"s3",
endpoint_url=endpoint,
aws_access_key_id="test",
aws_secret_access_key="test",
region_name="us-east-1",
)
s3.create_bucket(Bucket="test-bucket")
# Atomically reset all 37 services (or specific services) between tests in <1ms
curl -X POST http://localhost:4566/_ruststack/state/reset \
-H "Content-Type: application/json" \
-d '{"services": ["s3", "dynamodb", "sqs"]}'
# Export / Restore full cluster state snapshot
curl http://localhost:4566/_ruststack/state/dump > cluster-snapshot.json
curl -X POST http://localhost:4566/_ruststack/state/load -d @cluster-snapshot.json
# Inject 50% DynamoDB ProvisionedThroughputExceededException to test SDK retry backoff
curl -X POST http://localhost:4566/_ruststack/chaos/rules \
-H "Content-Type: application/json" \
-d '{
"service": "dynamodb",
"action": "PutItem",
"probability": 0.5,
"error_status": 400,
"error_code": "ProvisionedThroughputExceededException"
}'
All 37 Emulated AWS Services
Every service is implemented natively in memory-safe Rust and multiplexed on port 4566. Filter by service name, crate, or API operation below:
Everything You Need to Know About RustStack
What is RustStack and how does it compare to LocalStack and Moto?
RustStack is a single-binary local AWS cloud emulator written in 100% pure Rust. Unlike LocalStack (which requires a heavy Python/JVM container using ~398.5 MiB idle memory and ~2.77s startup) or Moto (Python-based), RustStack starts in ~230ms, consumes 2.2 MiB of idle RAM (177x lighter), and ships as a 38 MB Docker image or standalone static binary.
How do I point my AWS SDK or Terraform at RustStack?
Set the standard environment variable AWS_ENDPOINT_URL=http://localhost:4566 along with dummy credentials (AWS_ACCESS_KEY_ID=test, AWS_SECRET_ACCESS_KEY=test, AWS_DEFAULT_REGION=us-east-1). All modern AWS SDKs (Python boto3, Go aws-sdk-go-v2, Node.js @aws-sdk/*, Rust aws-sdk-*, and the AWS CLI v2) natively honor AWS_ENDPOINT_URL.
Is RustStack an S3 client or file sync CLI tool?
No. RustStack is an AWS server/cloud emulator for local development and integration tests (like LocalStack or Moto) — not an S3 transfer/sync CLI client like s5cmd or rclone.
Does RustStack persist data across restarts or support resetting state between tests?
Yes! By default, RustStack runs purely in memory for maximum speed and lets you reset state between tests in under 1 millisecond via POST http://localhost:4566/_ruststack/state/reset. If you want persistence across restarts, pass --data-dir ./data or set RUSTSTACK_DATA_DIR=/data to automatically load and save state snapshots.