Use Cases
Real-world scenarios where LocalEmu accelerates development and testing. Each guide includes complete, working code you can copy and use immediately.
End-to-End Image Pipeline
A complete serverless image processing pipeline: S3 upload → Lambda (Pillow thumbnail) → SNS → CloudWatch. Eight Terraform resources, two integration tests (real 512x384 PNG round trip + SNS delivery via ephemeral SQS subscription + CloudWatch metric), green in 4.28 s on LocalEmu. Uses pip --platform to build Linux wheels cross-platform, no Docker needed.
Services: S3, Lambda, SNS, SQS, CloudWatch, IAM, Terraform, Pillow
End-to-End REST API
A five-route CRUD notes service on API Gateway v2 + Lambda + DynamoDB, running end-to-end on LocalEmu. Thirteen Terraform resources, three HTTP integration tests (seven-call CRUD lifecycle + two edges), full round-trip in about 11 s (tests green in 2.82 s). Same Terraform targets real AWS with one argument change. Surfaced and fixed a LocalEmu API Gateway v2 integration-URI bug along the way.
Services: API Gateway v2, Lambda, DynamoDB, IAM, Terraform, pytest
End-to-End Event-Driven Microservice
An SNS → SQS → Lambda fan-out with a FilterPolicy, two consumers and a shared DynamoDB sink, shipped via a single CloudFormation template. Thirteen resources, two integration tests covering filter policy + payload preservation, green in 5.22 s on LocalEmu. Surfaces the real LocalEmu-vs-AWS rule you need to know about inline ZipFile code (handler must start with index. because AWS stores inline code as index.py).
Services: SNS, SQS, Lambda, DynamoDB, IAM, CloudFormation, pytest
End-to-End Batch ETL
A Step Functions Standard workflow that parses a CSV from S3 and fan-outs a Map state over the rows, validating and loading each into DynamoDB, with per-row Catch so bad rows don't kill the batch. Nine Terraform resources, two integration tests (data plane + control plane), green in 5.86 s on LocalEmu. Highlights the IAM propagation tax you only meet on real AWS.
Services: Step Functions, Lambda, S3, DynamoDB, IAM, Terraform, pytest
End-to-End Scheduled Job
An hourly EventBridge Scheduler → Lambda → Secrets Manager + DynamoDB audit trail, shipped with Terraform. Thirteen resources, three integration tests that don't wait for the clock (GetSchedule for plumbing, direct Lambda invoke for behaviour), green in 2.02 s on LocalEmu. Surfaced and fixed a real LocalEmu DynamoDB bug: FilterExpression on a primary-key attribute is now rejected with the exact AWS ValidationException message.
Services: EventBridge Scheduler, Lambda, Secrets Manager, DynamoDB, IAM, Terraform, pytest
Idempotent Payment Ledger
The Stripe-style payment API pattern: Idempotency-Key header + DynamoDB TransactWriteItems doing payer debit, payee credit, two ledger rows, and the idempotency record in one atomic shot. Sixteen Terraform resources, nine integration tests including a five-way concurrent-debit race (exactly one winner, never overdraws), green in 2.98 s on LocalEmu. Surfaced a real LocalEmu EventBridge bug that was hiding behind a botocore retry.
Services: API Gateway v2, Lambda, DynamoDB Transactions, EventBridge, SQS, IAM, Terraform, pytest
Deterministic LLM Gateway
A deterministic LLM gateway: input guardrail, semantic cache (top-1 cosine on embeddings), generation, output guardrail, async LLM-as-judge for quality drift. Nineteen Terraform resources, six integration tests, full round-trip green on LocalEmu in under two minutes (12.62 s for the tests). A fixture-driven LLMClient + module-scope DI wiring make every assertion exact, not statistical. Surfaced a LocalEmu CloudWatch SQLite self-heal bug along the way.
Services: API Gateway v2, Lambda, Bedrock, DynamoDB, EventBridge, SQS, CloudWatch metrics, IAM, Terraform, pytest
Real-time S3 Public-Access Guardrail
The event-driven security pattern every enterprise runs: CloudTrail → EventBridge → Lambda auto-remediating any S3 bucket that just became public. Eleven Terraform resources, seven tests including a real end-to-end hero test that creates a public bucket and lets the full pipeline remediate it (no direct Lambda invoke). Green in 2.23 s on LocalEmu. Surfaced and fixed a LocalEmu CloudTrail ARN-vs-name mismatch along the way.
Services: CloudTrail, EventBridge, Lambda, S3, DynamoDB, SNS, IAM, Terraform, pytest
CI/CD Pipeline Testing
Run your full AWS integration test suite in CI without AWS credentials. Test suites go from 12-15 minutes to 4-6 minutes. Complete GitHub Actions workflow included.
Services: GitHub Actions, pytest, S3, SQS, DynamoDB, Lambda
Local Development Workflow
Develop against AWS services on your laptop with instant feedback. Typical stacks deploy in seconds instead of minutes (see the end-to-end tutorials for measured round-trips). Keep state across restarts with PERSISTENCE=1.
Services: Docker Compose, boto3, S3, DynamoDB, SQS, Secrets Manager
Terraform Infrastructure Testing
Write and test Terraform configurations locally. Run plan/apply/destroy cycles in seconds instead of minutes. Switch between LocalEmu and real AWS with variable files.
Services: Terraform, S3, DynamoDB, SQS, Lambda, IAM
Event-Driven Microservices
Test distributed systems locally. Build SNS/SQS fan-out patterns, S3 event notifications, SQS-triggered Lambda pipelines, and verify end-to-end message flow.
Services: SNS, SQS, Lambda, S3, DynamoDB, Secrets Manager
Replacing Dev AWS Accounts
Dev and test AWS accounts are a persistent line item; LocalEmu's direct cloud cost is zero. Page covers the cost categories a dev account accrues, published case studies from the local-emulation pattern (via LocalStack, because LocalEmu has not yet published its own), a plain cost-comparison table, and a sizing heuristic you can apply to your own team.
Services: All services (cost analysis)
OpenSearch Full-Text Search
Run real OpenSearch clusters locally with Docker. Index documents, run full-text queries with Lucene scoring, test aggregations. Complete walkthrough with real output.
Services: OpenSearch, Elasticsearch, Docker
RDS Docker Databases
Run real PostgreSQL and MySQL databases locally through the RDS API. Each instance gets its own Docker container. Connect with psql, mysql, or any database driver.
Services: RDS, PostgreSQL, MySQL, MariaDB, Docker
EC2 Docker Instances
Launch real Docker containers as EC2 instances. SSH in with key pairs, run user data scripts, manage instance lifecycle with stop/start/terminate. Full SSM session support.
Services: EC2, SSM, Docker, SSH, Security Groups, IMDS
Transit Gateway + VPC Peering
Enterprise-style multi-VPC network: 4 VPCs, one Transit Gateway hub joining three spokes, one VPC peering to the mgmt VPC. 10-assertion connectivity matrix including the non-transitive deny that peering enforces. Verified end-to-end in ~50 s.
Services: VPC, Transit Gateway, VPC Peering, EC2, SSM, Route Tables, Security Groups
IAM Least-Privilege Mutation Testing
Mechanical proof that an IAM policy is minimum-viable. A Lambda touches 6 services; a 'golden' policy grants one Sid per action; then each Sid is removed in turn and the Lambda must fail with AccessDenied on exactly the expected action. 6/6 mutations green in ~15 s. Infeasible on real AWS (IAM propagation latency); fast in-process on LocalEmu.
Services: IAM, Lambda, S3, DynamoDB, KMS, SSM, Secrets Manager, SNS, STS
Step Functions Saga with Fault Injection
A 4-step order saga (reserve → charge → ship → notify) with cascading compensations. Each forward state's Catch jumps to the compensation for the previous successful step, which chains down to undo every side-effect. Three failure scenarios are injected and the final DynamoDB state is asserted empty. Verified end-to-end in ~30 s.
Services: Step Functions, Lambda, DynamoDB, SNS, IAM, STS
Chaos Resilience Drill
Prove your retry/backoff/latency-budget envelope holds. The same resilient-writer Lambda is run three times, calm-mode, 30% DynamoDB throttling, 300ms fixed latency, and the demo reports ok/retries/p50/p95/p99 plus a zero-data-loss assertion. 50/50 each scenario; throttle mode fires 26 retries and pushes p95 75ms→513ms. Inner-loop chaos drill impossible to run on real AWS this cheaply.
Services: Lambda, DynamoDB, IAM, LocalEmu chaos (SIMULATE_THROTTLING, SIMULATE_LATENCY)
Kinesis Data Streams
Stream events locally with real Kinesis APIs. Create streams, put records, consume with shard iterators, scale shards, and trigger Lambda functions. Pure Python, no Docker needed.
Services: Kinesis, Lambda, Event Source Mapping
ECS Docker Containers
Run real Docker containers from ECS task definitions. Create clusters, register tasks with nginx or Python images, run them, and see actual containers with port mappings on your machine.
Services: ECS, Docker, Task Definitions, RunTask, StopTask
EKS Kubernetes Clusters
Run a real Kubernetes cluster from the EKS API. k3s starts in Docker, you get a real kubeconfig, real kubectl access, deploy pods, scale deployments, and manage the full lifecycle.
Services: EKS, k3d, k3s, Kubernetes, kubectl, Docker
Throttling Simulation
Test retry logic against real AWS throttling errors. DynamoDB ProvisionedThroughputExceededException, S3 SlowDown, SQS OverLimit, Lambda TooManyRequestsException. Configurable per-service rates.
Services: DynamoDB, S3, SQS, Lambda, SNS, Kinesis, EC2
Latency Simulation
Add realistic per-service network latency to API responses. Gaussian jitter matching real AWS: DynamoDB ~8ms, S3 ~50ms, Lambda Invoke ~150ms. Test timeout handling and performance budgets.
Services: DynamoDB, S3, SQS, Lambda, EC2, IAM, STS, KMS
Lambda Cold Starts
Simulate Lambda cold start behavior. First invocation pays the configured LAMBDA_COLD_START_DELAY; subsequent invocations skip the sleep until the function goes idle. Per qualified-ARN tracking, 5-minute default idle timeout (matching AWS), provisioned concurrency skips the delay entirely.
Services: Lambda, IAM
Cognito JWT Authentication
Create user pools, sign in users, and get real RS256-signed JWTs. Full JWKS and OIDC discovery endpoints. Verify tokens with any standard JWT library. No AWS account needed.
Services: Cognito, JWT, OIDC, JWKS, boto3