Test against real cloud SDKs
without a real cloud.
Point aws-sdk-go-v2, azure-sdk-for-go, or cloud.google.com/go at a local httptest server. ~10ms per call.
Don't rewrite your tests. Repoint them.
cloudemu ships HTTP servers that speak the real wire protocols of aws-sdk-go-v2, azure-sdk-for-go, and cloud.google.com/go. Point the SDK's endpoint at a local httptest.NewServer and your existing production code runs unchanged against an in-memory backend. No mocks. No Docker. No accounts.
import (
awsserver "github.com/stackshy/cloudemu/server/aws"
"github.com/aws/aws-sdk-go-v2/service/s3"
)
cloud := cloudemu.NewAWS()
ts := httptest.NewServer(awsserver.New(awsserver.Drivers{
S3: cloud.S3, DynamoDB: cloud.DynamoDB, EC2: cloud.EC2,
Lambda: cloud.Lambda, SQS: cloud.SQS,
}))
// Use the REAL aws-sdk-go-v2 client — only the endpoint changes.
client := s3.NewFromConfig(cfg, func(o *s3.Options) {
o.BaseEndpoint = aws.String(ts.URL)
o.UsePathStyle = true
})
client.PutObject(ctx, &s3.PutObjectInput{ /* ... */ })Two ways to use cloudemu
Same in-memory backend. Pick the surface that fits your test code.
Portable Go API
All providersCall cloudemu's Go interfaces directly. Every service in every domain is here from day one.
16 domains × 3 providers
cloud := cloudemu.NewAWS()
cloud.S3.PutObject(ctx, ...)
cloud.IAM.CheckPermission(ctx, ...)
cloud.SecretsManager.GetSecret(ctx, ...)Portable API docs →SDK-Compat HTTP Server
In progressPoint real aws-sdk-go-v2 / azure-sdk-for-go / cloud.google.com/go at a local httptest server.
7 domains × 3 providers · 27 more in progress
ts := httptest.NewServer(awsserver.New(...))
client := s3.NewFromConfig(cfg, /* ... */)
client.PutObject(ctx, ...) // real SDK, in-memory backendSDK-Compat docs →Why cloudemu?
Compare approaches to testing cloud-dependent code
| Feature | Real Cloud | LocalStack / Emulators | cloudemu |
|---|---|---|---|
| Cost | $$$ | $ | Free |
| Speed | Seconds | 100ms+ | ~10ms |
| Works Offline | |||
| Docker Required | |||
| Setup | Account + Credentials | Docker + Config | go get |
| Realistic Behavior | Partial | ||
| Multi-Cloud | |||
| Use real SDKs unchanged |
Beyond Basic Mocks
cloudemu reproduces real cloud behaviors so your tests catch real issues
Real Cloud SDKs
aws-sdk-go-v2, azure-sdk-for-go, and cloud.google.com/go work unchanged — point them at a local httptest.NewServer and your production code just runs.
Chaos Engineering
Inject service outages, latency spikes, probabilistic failures, and throttling in time-bounded windows. Retry and timeout paths get exercised every test run.
State Machines
VMs enforce valid lifecycle transitions. Illegal state changes return errors, just like real clouds.
Auto-Metrics
Launching a VM pushes CPU, Network, and Disk metrics to monitoring. Stop/terminate emit matching values.
Error Injection
Simulate failures deterministically: always, every Nth call, probabilistic, or first N calls.
Call Recording
Capture every API call with inputs, outputs, errors, and timing. Assert with fluent matchers.
Fake Clock
Control time for deterministic testing of TTL, deduplication windows, and alarm evaluation.
Zero Dependencies
Pure Go with no external dependencies. Only testify for tests. Works anywhere Go runs.
16 Service Categories
Every category is implemented for AWS, Azure, and GCP
Compute
Storage
Database
Serverless
Networking
Monitoring
IAM
DNS
Load Balancer
Message Queue
Notification
Event Bus
Container Registry
Cache
Secrets
Logging
Or use the Portable Go API
Same shape across AWS, Azure, and GCP — switch providers by changing one line
aws := cloudemu.NewAWS()
// Launch EC2 instances
instances, _ := aws.EC2.RunInstances(ctx, computedriver.InstanceConfig{
ImageID: "ami-0abcdef1234",
InstanceType: "t3.large",
Tags: map[string]string{"env": "production"},
}, 3)
// Create S3 bucket and upload
aws.S3.CreateBucket(ctx, "app-data")
aws.S3.PutObject(ctx, "app-data", "config.yaml",
[]byte("port: 8080"), "text/yaml", nil)
// Push metrics to CloudWatch
aws.CloudWatch.PutMetricData(ctx, []mondriver.MetricDatum{
{Namespace: "App", MetricName: "CPU", Value: 45.2},
})Ready to get started?
Install cloudemu and start testing your cloud code in seconds
MIT License · Requires Go 1.25+