RustStack: A blazing-fast, lightweight, single-binary local AWS emulator written in Rust — designed as a high-performance alternative to LocalStack/Ministack.
RustStack delivers an ultra-fast, zero-dependency local AWS cloud emulator for testing, local development, and CI/CD pipelines.
- Blazing Performance: Sub-microsecond to single-digit microsecond latency across S3, SQS, SNS, EventBridge, SSM, SecretsManager, STS, and DynamoDB.
- Drop-in AWS Compatibility: Native support for standard AWS SDKs (Rust, Python
boto3, Node/JS, Go, Java), AWS CLI, and Terraform. - Pure Rust Native Architecture: Zero external dependencies, no Python runtime requirement in the codebase.
- Single Port Multiplexing: Seamlessly serves all 8 emulated AWS services over a unified port (default
4566) using SigV4 headers,Hostheader inspection,x-amz-target, query parameters, and URL path patterns. - State Management & Snapshots: Instant atomic cluster resets (
POST /_ruststack/state/reset), full cluster state serialization (GET/POST /_ruststack/state/dump), and instant state restoration (POST /_ruststack/state/load). - Chaos Engineering & Fault Injection Engine: Highly configurable latency jitter, probabilistic error rate simulation, rule expiration limits, and service/action-level failure injection (
/_ruststack/chaos/rules). - Performance Rating & CI Benchmarks: Every feature is measured with dedicated Criterion and load benchmarks integrated directly into GitHub Actions (GHA) with automated metric tracking and regression detection.
- Multi-Platform & Container Delivery: Multi-arch Linux & macOS binaries and official multi-arch Docker images on DockerHub (
ehlers320/ruststack).
+-----------------------+
| AWS Client / SDK / CLI |
+-----------+-----------+
| HTTP (Port 4566)
v
+-------------------------------+
| RustStack HTTP Gateway |
| (Axum / Hyper / Tokio) |
+---------------+---------------+
|
+----------------------------------------+----------------------------------------+
| | |
v v v
Chaos Engineering & Fault Injection Service Dispatcher State Control Plane
(/_ruststack/chaos/rules/enable) (Host / Auth Scope / Target / Path) (/_ruststack/state/reset/dump/load)
| v v v v v v v v |
| +---+ +---+ +--+ +--+ +--+ +--+ ++ +---+ v
+==> [Latency / Jitter / Err] |S3 | |SQS| |SN| |Ev| |SS| |Se| |S| |DD| <==== Snapshots / Reset
+---+ +---+ +--+ +--+ +--+ +--+ ++ +---+
Configurable dynamic fault injection engine with near-zero nanosecond overhead when idle:
{
"service": "dynamodb",
"action": "PutItem",
"probability": 0.5,
"error_status": 400,
"error_code": "ProvisionedThroughputExceededException",
"error_message": "Rate of requests exceeds the configured throughput.",
"latency_ms": 50,
"latency_jitter_ms": 10,
"limit_times": 5
}POST /_ruststack/chaos/rules: Register new chaos rule (returnsrule_id).GET /_ruststack/chaos/rules: List all active chaos rules and trigger statistics.DELETE /_ruststack/chaos/rules/{id}: Delete specific chaos rule.DELETE /_ruststack/chaos/rulesorPOST /_ruststack/chaos/reset: Clear all rules.POST /_ruststack/chaos/enable/POST /_ruststack/chaos/disable: Global killswitch.
Atomically clears in-memory state. Supports full cluster wipe or selective service resets:
{
"services": ["s3", "dynamodb"]
}Serializes the complete cluster snapshot across all 8 services into JSON (or writes to a file path):
{
"file_path": "/tmp/test-snapshot.json"
}Restores the complete cluster state directly from a JSON snapshot payload or file path:
{
"file_path": "/tmp/test-snapshot.json"
}- JSON Protocol: Modern AWS JSON 1.0 protocol (
x-amz-target: DynamoDB_20120810.*). - Table Operations:
CreateTable,DeleteTable,DescribeTable,ListTables,UpdateTable(supporting String, Number, Binary Partition Keys & Sort Keys,PAY_PER_REQUESTbilling mode, GSIs and LSIs). - Item Operations:
PutItem(withConditionExpression),GetItem(withProjectionExpression),DeleteItem,UpdateItem(withSET/REMOVEexpressions),BatchGetItem,BatchWriteItem. - Query & Scan Engine:
QuerywithKeyConditionExpression(=,<,<=,>,>=,BETWEEN,begins_with),ScanwithFilterExpression. - State Management: Full table definition and item collection snapshotting & restoration.
- Bucket Operations:
CreateBucket,DeleteBucket,ListBuckets,HeadBucket,GetBucketLocation. - Object Operations:
PutObject,GetObject(with byte rangesRange: bytes=start-end),HeadObject,DeleteObject,DeleteObjects,CopyObject. - Object Listing:
ListObjectsV2&ListObjectswith prefix, delimiter, and continuation tokens. - Multipart Uploads:
CreateMultipartUpload,UploadPart,CompleteMultipartUpload,AbortMultipartUpload,ListParts. - Bucket Notifications:
PutBucketNotificationConfigurationandGetBucketNotificationConfigurationwith instant in-memory event dispatching to SQS queues, SNS topics, and EventBridge default bus ons3:ObjectCreated:*,s3:ObjectCreated:Put,s3:ObjectCreated:Copy,s3:ObjectCreated:CompleteMultipartUpload, ands3:ObjectRemoved:Deletewith key prefix/suffix filtering. - State Management: Base64 encoded binary object and notification snapshotting & restoration.
- Dual Protocols: Query Protocol (form-urlencoded & query params) and AWS JSON 1.0 Protocol (
x-amz-target: AmazonSQS.*). - Dead-Letter Queues (DLQ): Automatic redrive policy execution when message receive counts exceed
maxReceiveCount, andListDeadLetterSourceQueues. - Message Operations:
SendMessage,SendMessageBatch,ReceiveMessage(with long polling & visibility timeout),DeleteMessage,DeleteMessageBatch,ChangeMessageVisibility. - Queue Types: Standard Queues and FIFO Queues (
.fifosuffix,MessageGroupId,MessageDeduplicationId, 5-minute deduplication window). - State Management: Queue attributes and in-flight/pending message queue snapshotting & restoration.
- Dual Protocols: Query Protocol and AWS JSON Protocol (
x-amz-target: AmazonSNS.*). - Topic Management:
CreateTopic,DeleteTopic,ListTopics,GetTopicAttributes,SetTopicAttributes. - Subscriptions & Fanout:
Subscribe,Unsubscribe,ListSubscriptions,ListSubscriptionsByTopic, automatic in-memory SQS fanout. - Delivery & Filtering: Standard AWS JSON Notification envelope or
RawMessageDelivery, with attributeFilterPolicymatching. - State Management: Topic definitions and subscriptions snapshotting & restoration.
- Event Buses:
CreateEventBus,DeleteEventBus,ListEventBuses,DescribeEventBus(with default bus). - Rule Engine:
PutRule,DeleteRule,ListRules,DescribeRule,EnableRule,DisableRule. - Pattern Matching: Content-based JSON rule matching (
source,detail-type, nesteddetail, prefix matching, anything-but, exists). - Target Dispatching: Automated dispatching to SQS queues and SNS topics on
PutEvents. - State Management: Rule definitions and target bindings snapshotting & restoration.
- Parameters:
PutParameter(with versioning),GetParameter,GetParameters,GetParametersByPath(hierarchical recursive scans),DeleteParameter,DeleteParameters,DescribeParameters. - State Management: Parameter values, histories, and types snapshotting & restoration.
- Secret Lifecycle:
CreateSecret,GetSecretValue,PutSecretValue,UpdateSecret,DeleteSecret(with force delete),DescribeSecret,ListSecrets,GetRandomPassword. - Versioning: Version stages (
AWSCURRENT,AWSPREVIOUS) and rotation tracking. - State Management: Secret definitions, versions, and staging labels snapshotting & restoration.
- Identity & Session:
GetCallerIdentity,AssumeRole,GetSessionTokensupporting Query and JSON 1.1 protocols.
[Step 1] (Completed) ---> [Step 2] (Completed) ---> [Step 3] (Completed)
- SSM Parameter Store - DynamoDB Engine - S3 Bucket Notifications
- Secrets Manager - KeyCondition & Scan - Pure Rust Compat Tests
- STS Identity Mock - 8 GHA Benchmarks Jobs - DockerHub Publishing
|
v
[Step 6] (Completed) <--- [Step 5] (Completed) <--- [Step 4] (Completed)
- Embedded Web Admin UI - Chaos Engineering - State Management & Snapshots
- ruststack-cli Commands (Latency/Fault Injection) (/_ruststack/state/dump/load)