🦀 100% Pure In-Memory Rust • Drop-in LocalStack & Moto Alternative

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.

What it is & isn't: RustStack is a local AWS cloud emulator for integration tests and CI — not an S3 client or file sync tool (like s5cmd or rclone).
2.2 MiB
Idle Memory (RSS)
177.9x lighter than LocalStack (398.5 MiB)
230 ms
Container Cold Start
12.0x faster startup than LocalStack (2.77s)
~1.4 µs
In-Memory p50 Latency
390,000+ ops/s on S3, DynamoDB, STS & SSM
38.0 MB
Docker Image Size
31.7x smaller than LocalStack (1,204 MB)

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: PutObject triggers 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 / REMOVE shard 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 via POST /_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.
Your Test Suite / Application (boto3, aws-sdk-rust, aws-sdk-go-v2, @aws-sdk/client-*, Terraform, AWS CLI) │ AWS_ENDPOINT_URL=http://localhost:4566 ▼ ┌─────────────────────────────────────────────────────────────────────────────────────────┐ │ ⚡ RustStack Single Static Binary (`ruststack-server` — Tokio + Axum + DashMap) │ │ │ │ ┌───────────────────────────────────────────────────────────────────────────────────┐ │ │ │ Chaos & Fault Injection Middleware (Latency/Jitter, HTTP 503/400 Error Overrides) │ │ │ └─────────────────────────────────────────┬─────────────────────────────────────────┘ │ │ ▼ │ │ ┌───────────────────────────────────────────────────────────────────────────────────┐ │ │ │ Multi-Protocol Router (X-Amz-Target | Action= Query | S3 Host/Path | REST-JSON) │ │ │ └──────┬──────────────────────┬───────────────────────┬──────────────────────┬──────┘ │ │ ▼ ▼ ▼ ▼ │ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ │ │ Storage/DB │ │ Messaging │ │ Security/ID │ │ Compute/Ops │ │ │ │ • S3 │───────▶│ • SQS + DLQ │◀────────│ • STS │ │ • Lambda │ │ │ │ • DynamoDB │ CDC │ • SNS Fanout│ │ • IAM │ │ •SSM/Secrets│ │ │ │ • RDS/Redis │───────▶│ •EventBridge│ │ • KMS (AES) │ │ •Logs/Metrics│ │ │ │ • Athena/OS │ │ • Kinesis │ │ • Cognito │ │ •37 Services│ │ │ └─────────────┘ └─────────────┘ └─────────────┘ └─────────────┘ │ │ │ │ ┌───────────────────────────────────────────────────────────────────────────────────┐ │ │ │ Control Plane: `/_ruststack/ui/` | `/_ruststack/state/{dump,load,reset}` | Health │ │ │ └───────────────────────────────────────────────────────────────────────────────────┘ │ └─────────────────────────────────────────────────────────────────────────────────────────┘

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

⚡ RustStack2.2 MiB
MiniStack33.7 MiB
LocalStack 3.8398.5 MiB

Container Cold-Start Time 12.0x Faster

⚡ RustStack230.5 ms
MiniStack1,685.8 ms
LocalStack 3.82,770.1 ms

Docker Image Size 31.7x Smaller

⚡ RustStack38.0 MB
MiniStack175.9 MB
LocalStack 3.81,204.1 MB

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.

.github/workflows/integration.yml — Service Container
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
.github/workflows/integration.yml — Zero-Docker Static musl Binary (~10ms start)
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
Terminal — Docker & AWS CLI
# 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/
Testcontainers — Python (boto3) & Go
# 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")
Deterministic State Reset & Chaos Engineering Fault Injection
# 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:

Amazon S3ruststack-s3
Create/Delete/ListBuckets, Put/Get/Head/Copy/DeleteObject, Multipart Uploads, Range Requests, Bucket Notifications (→ SQS/SNS/EventBridge), Path & Virtual-Host routing.
Amazon DynamoDB & Streamsruststack-dynamodb
Create/Update/DescribeTable, GSIs/LSIs, Put/Get/Update/DeleteItem, Condition/Projection/FilterExpressions, Query, Scan, BatchGet/WriteItem, DynamoDB Streams CDC.
Amazon SQSruststack-sqs
Query & JSON 1.0 protocols, Standard & FIFO queues (.fifo), Dead-Letter Queue (DLQ) redrive, SendMessageBatch, ReceiveMessage long polling, VisibilityTimeout.
Amazon SNSruststack-sns
Create/Delete/ListTopics, Subscribe/Unsubscribe, Publish & PublishBatch, instant in-memory SQS fanout with FilterPolicy & RawMessageDelivery.
Amazon EventBridgeruststack-eventbridge
CreateEventBus, PutRule, content-based JSON pattern matching (prefix, anything-but, exists), PutEvents with automated SQS & SNS target dispatching.
Amazon STSruststack-sts
GetCallerIdentity (Terraform & SDK bootstrap), AssumeRole, GetSessionToken.
AWS IAMruststack-iam
Roles, Policies, Users, AccessKeys, AttachRolePolicy, PutRolePolicy, pre-seeded AWS managed policies (AdministratorAccess, AmazonS3FullAccess, etc.).
AWS KMSruststack-kms
CreateKey, DescribeKey, Aliases (alias/aws/s3, alias/aws/dynamodb), authenticated Encrypt, Decrypt, GenerateDataKey (AES-128 & AES-256).
SSM Parameter Storeruststack-ssm
PutParameter (versioned), GetParameter, GetParameters, DeleteParameters, hierarchical GetParametersByPath (recursive String, StringList, SecureString).
AWS Secrets Managerruststack-secretsmanager
CreateSecret, GetSecretValue, PutSecretValue, UpdateSecret, DeleteSecret, multi-version staging (AWSCURRENT, AWSPREVIOUS), GetRandomPassword.
AWS Lambdaruststack-lambda
Create/Get/List/Update/DeleteFunction, Invoke (RequestResponse, Event, DryRun), CreateEventSourceMapping for DynamoDB & Kinesis streams.
Amazon Kinesis Streamsruststack-kinesis
Create/Delete/DescribeStream, PutRecord, PutRecords with deterministic MD5 shard hashing, GetShardIterator, GetRecords.
CloudWatch Logsruststack-logs
Create/Delete/DescribeLogGroups & LogStreams, PutLogEvents, GetLogEvents, FilterLogEvents with pattern matching.
CloudWatch Metrics & Alarmsruststack-cloudwatch
PutMetricData, ListMetrics, GetMetricData, GetMetricStatistics (Average, Sum, Min, Max), PutMetricAlarm, DescribeAlarms, SetAlarmState.
Amazon SESruststack-ses
VerifyEmailIdentity, VerifyDomainIdentity, SendEmail, SendRawEmail (MIME parsing), local inspection outbox, GetSendQuota.
Amazon Cognito IDPruststack-cognito
Create/Describe/ListUserPools, CreateUserPoolClient, AdminCreateUser, AdminGetUser, AdminInitiateAuth, ListUsers.
API Gateway REST (v1)ruststack-apigateway
CreateRestApi, CreateResource, PutMethod, PutIntegration, CreateDeployment, CreateStage.
API Gateway HTTP/WS (v2)ruststack-apigatewayv2
CreateApi (HTTP & WEBSOCKET), CreateRoute, CreateIntegration, CreateDeployment, CreateStage.
AWS Step Functionsruststack-stepfunctions
Create/Describe/Update/DeleteStateMachine, StartExecution, DescribeExecution, GetExecutionHistory.
AWS CloudFormationruststack-cloudformation
Create/Update/Delete/DescribeStacks, GetTemplate, DescribeStackResources, DescribeStackEvents.
Amazon Route 53ruststack-route53
Create/Get/List/DeleteHostedZone, ChangeResourceRecordSets, ListResourceRecordSets (A, AAAA, CNAME, TXT, MX, SRV).
Amazon ECRruststack-ecr
Create/Describe/DeleteRepository, RepositoryPolicy, PutImage, BatchGetImage, DescribeImages.
Amazon ECSruststack-ecs
Create/DescribeCluster, RegisterTaskDefinition, CreateService, RunTask, ListTasks.
Amazon EC2 & VPCruststack-ec2
Run/Describe/Start/Stop/TerminateInstances, Create/DescribeVpc, CreateSubnet, CreateSecurityGroup.
Elastic Load Balancing v2ruststack-elbv2
Create/Describe/DeleteLoadBalancer (ALB/NLB), CreateTargetGroup, RegisterTargets, CreateListener.
Amazon RDSruststack-rds
Create/Describe/Modify/DeleteDBInstance (Postgres, MySQL, Aurora), DBSubnetGroups, DBParameterGroups.
Amazon ElastiCacheruststack-elasticache
Create/Describe/ModifyCacheCluster (Redis & Memcached), CreateReplicationGroup.
Amazon Redshiftruststack-redshift
Create/Describe/Modify/Reboot/DeleteCluster, warehouse endpoints & parameter groups.
Amazon OpenSearchruststack-opensearch
Create/Describe/Update/DeleteDomain, DescribeDomainConfig, ListDomainNames.
Amazon Athenaruststack-athena
Start/Get/StopQueryExecution, GetQueryResults, WorkGroups, NamedQueries.
Amazon Bedrockruststack-bedrock
ListFoundationModels, GetFoundationModel, InvokeModel (Claude, Titan, Llama mock inference responses).
EventBridge Pipesruststack-pipes
Create/Describe/List/Start/Stop/Update/DeletePipe routing between SQS, DynamoDB Streams, Kinesis & SNS.
Amazon MSK (Kafka)ruststack-msk
Create/Describe/List/DeleteCluster, GetBootstrapBrokers.
AWS AppSyncruststack-appsync
CreateGraphqlApi, CreateApiKey, StartSchemaCreation, CreateDataSource, GraphQL execution engine.
AWS Certificate Managerruststack-acm
Request/Describe/List/Get/DeleteCertificate, automated DNS & Email validation records.
AWS WAFv2ruststack-wafv2
Create/Get/List/Update/DeleteWebACL, CreateIPSet, CreateRuleGroup.
AWS Organizationsruststack-organizations
Create/DescribeOrganization, ListRoots, CreateOrganizationalUnit, CreateAccount, Service Control Policies (SCPs).

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.