Sign inSign up

ehlers320/ruststack

By ehlers320

โ€ขUpdated 17 days ago

โšก Ultra-fast local AWS emulator in Rust: 1.6MB memory, 500ms startup & 20x lighter than LocalStack

Image
0

4.1K

ehlers320/ruststack repository overview

โ โšก RustStack

Ultra-fast, lightweight local AWS cloud emulator written in 100% pure Rust.
Drop-in replacement for LocalStack and MiniStack with a 1.6 MB memory footprint, sub-millisecond latency, and 500ms cold-start startup.

GitHub License Docker Pulls Multi-Arch


โ โšก Resource & Startup Benchmark

Measured on standard GitHub Actions runners (ubuntu-latest):

Local Cloud StackDocker ImageImage SizeAvg Startup TimeMin Startup TimeIdle Memory (RSS)Idle CPU
โšก RustStack (Winner)ehlers320/ruststack:latest30.7 MB216.2 ms199.3 ms1.9 MiB0.00%
MiniStackministackorg/ministack:latest175.9 MB1,685.8 ms1,567.2 ms33.7 MiB0.00%
LocalStacklocalstack/localstack:3.8.11,204.1 MB2,770.1 ms2,668.0 ms398.5 MiB0.04%
โ ๐Ÿš€ Key Advantages
  • Memory Footprint: 17.7x lighter than MiniStack (1.9 MiB vs 33.7 MiB) and 209.7x lighter than LocalStack (398.5 MiB).
  • Cold-Start Readiness: 7.8x faster startup (216.2 ms vs 1,685.8 ms).
  • Image Size: 30.7 MB (down from 92.9 MB, 5.7x smaller than MiniStack and 39.2x smaller than LocalStack).

โ ๐Ÿš€ Quick Start

โ 1. Run with Docker CLI
docker run -d --name ruststack -p 4566:4566 ehlers320/ruststack:latest
โ 2. Docker Compose
services:
  ruststack:
    image: ehlers320/ruststack:latest
    container_name: ruststack
    ports:
      - "4566:4566"
    volumes:
      - ./ruststack-data:/data
    environment:
      - SERVICES=s3,sqs,sns,events,ssm,secretsmanager,sts,dynamodb,kms,logs,iam,cloudwatch,ses,kinesis,lambda
      - DEFAULT_REGION=us-east-1
      - ACCOUNT_ID=000000000000
      - RUSTSTACK_DATA_DIR=/data
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:4566/_ruststack/health"]
      interval: 5s
      timeout: 2s
      retries: 3

โ ๐Ÿ–ฅ๏ธ Embedded Web Admin UI

RustStack includes a zero-dependency, dark-mode visual administration dashboard served directly on port 4566:

๐Ÿ‘‰ Open http://localhost:4566/_ruststack/ui/ in your browser to:

  • Browse S3 Buckets & Objects
  • Inspect DynamoDB Tables, Key Schemas, Items & CDC Streams
  • View SQS Queues, Messages & DLQ Redrive Policies
  • Explore SNS Topics & Subscriptions
  • Inspect SSM Parameters & Secrets Manager Secrets
  • Manage KMS Customer & AWS Managed Master Keys & Aliases
  • Inspect CloudWatch Log Groups & Streams
  • Inspect IAM Roles, Policies, Users & Access Keys
  • Monitor CloudWatch Metrics & Alarms
  • Inspect SES Sent Emails Outbox & Verified Identities
  • View Kinesis Shards & Ingested Data Streams
  • Inspect Lambda Functions & Event Source Mappings
  • Interactively build Chaos Engineering rules & manage State Snapshots

โ ๐Ÿงช Testcontainers Integration

โ Go
req := testcontainers.ContainerRequest{
    Image:        "ehlers320/ruststack:latest",
    ExposedPorts: []string{"4566/tcp"},
    WaitingFor:   wait.ForHTTP("/_ruststack/health").WithPort("4566/tcp"),
}
container, err := testcontainers.GenericContainer(ctx, testcontainers.GenericContainerRequest{
    ContainerRequest: req,
    Started:          true,
})
โ Python
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 ruststack:
    endpoint = f"http://{ruststack.get_container_host_ip()}:{ruststack.get_exposed_port(4566)}"
    # Pass endpoint to boto3 clients
โ Node / TypeScript
import { GenericContainer, Wait } from "testcontainers";

const container = await new GenericContainer("ehlers320/ruststack:latest")
  .withExposedPorts(4566)
  .withWaitStrategy(Wait.forHttp("/_ruststack/health", 4566))
  .start();

โ ๐Ÿ“ฆ Supported AWS Services

All services multiplex across the single port 4566:

ServiceProtocolKey Features Supported
Amazon S3REST XML / Path & Virtual-HostBuckets, Objects, Multipart Uploads, Range Requests, S3 Bucket Notifications -> SQS/SNS/EventBridge
Amazon DynamoDBAWS JSON 1.0Tables, PAY_PER_REQUEST, Put/Get/Delete/UpdateItem, ConditionExpressions, Query (KeyConditions), Scan (FilterExpressions), Batch Operations
Amazon SQSQuery & JSON 1.0Standard & FIFO Queues, DLQ Redrive Policies, Long Polling, Visibility Timeouts, Batch Operations
Amazon SNSQuery & JSONTopics, Subscriptions, Automatic Zero-Latency SQS Fanout, Filter Policies, RawMessageDelivery
Amazon EventBridgeAWS JSON 1.1Custom & Default Buses, JSON Pattern Matching Rules, SQS & SNS Target Dispatching
Amazon SSMAWS JSON 1.1Parameter Store (String, StringList, SecureString), Automatic Versioning, GetParametersByPath Recursive Trees
Secrets ManagerAWS JSON 1.1Secret Lifecycle, Version Staging (AWSCURRENT, AWSPREVIOUS), GetSecretValue
Amazon STSQuery & JSON 1.1GetCallerIdentity, AssumeRole, GetSessionToken
AWS KMSAWS JSON 1.1CreateKey, DescribeKey, ListKeys, CreateAlias, ListAliases, Encrypt, Decrypt, GenerateDataKey (AES-128/256)
CloudWatch LogsAWS JSON 1.1CreateLogGroup, CreateLogStream, PutLogEvents, GetLogEvents, FilterLogEvents
AWS IAMQuery & JSON 1.1CreateRole, GetRole, DeleteRole, ListRoles, CreatePolicy, AttachRolePolicy, CreateUser, CreateAccessKey

โ ๐ŸŒช๏ธ Chaos Engineering & Fault Injection

Inject simulated network delays, error rates, and failure conditions on the fly:

# Inject DynamoDB ProvisionedThroughputExceededException
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"
  }'

# Inject 150ms latency with 50ms jitter on SQS
curl -X POST http://localhost:4566/_ruststack/chaos/rules \
  -H "Content-Type: application/json" \
  -d '{
    "service": "sqs",
    "latency_ms": 150,
    "latency_jitter_ms": 50
  }'

# Clear all chaos rules
curl -X POST http://localhost:4566/_ruststack/chaos/reset

โ ๐Ÿ’พ State Snapshots, Reset & Auto-Disk Persistence

# Export cluster snapshot JSON
curl http://localhost:4566/_ruststack/state/dump > state.json

# Restore cluster state from snapshot
curl -X POST http://localhost:4566/_ruststack/state/load \
  -H "Content-Type: application/json" \
  -d @state.json

# Atomically reset cluster state (all services or selective)
curl -X POST http://localhost:4566/_ruststack/state/reset
โ Auto-Disk Persistence

Mount a local directory to preserve cluster state across container restarts:

docker run -d -p 4566:4566 \
  -v $(pwd)/ruststack-data:/data \
  -e RUSTSTACK_DATA_DIR=/data \
  ehlers320/ruststack:latest

โ โš™๏ธ Environment Variables

VariableDefaultDescription
PORT4566Listening HTTP port
HOST0.0.0.0Bind host address
SERVICESs3,sqs,sns,events,ssm,secretsmanager,sts,dynamodb,kmsComma-separated list of enabled services
DEFAULT_REGIONus-east-1Default AWS region
ACCOUNT_ID000000000000Default AWS Account ID
RUSTSTACK_DATA_DIRNoneDirectory path for auto-saving & auto-loading cluster state
PERSISTENCEfalseEnable automatic disk persistence

โ ๐Ÿ“„ License

Licensed under either of Apache License, Version 2.0โ  or MIT licenseโ  at your option.

Tag summary

Content type

Image

Digest

sha256:aadec7010โ€ฆ

Size

15 MB

Last updated

17 days ago

docker pull ehlers320/ruststack