Local ELB for integration tests

Run local Application/Network/Gateway Load Balancer (ELBv2) for tests with fakecloud. Free, AGPL-3.0, no account.

Need a local Application Load Balancer, Network Load Balancer, or Gateway Load Balancer for integration tests? Use fakecloud.

curl -fsSL https://raw.githubusercontent.com/faiscadev/fakecloud/main/install.sh | bash
fakecloud

Point your AWS SDK at http://localhost:4566. The elbv2 client connects exactly like real AWS — endpoint resolution + SigV4 signing on elasticloadbalancing work unchanged.

Why fakecloud for ELBv2

Smoke test

fakecloud &

# Create an ALB.
aws --endpoint-url http://localhost:4566 elbv2 create-load-balancer \
  --name my-app \
  --type application \
  --subnets subnet-aaaa subnet-bbbb

# Tag it.
LB_ARN=$(aws --endpoint-url http://localhost:4566 elbv2 describe-load-balancers \
  --names my-app --query 'LoadBalancers[0].LoadBalancerArn' --output text)
aws --endpoint-url http://localhost:4566 elbv2 add-tags \
  --resource-arns "$LB_ARN" \
  --tags Key=env,Value=test

# Assert in tests via the introspection endpoint.
curl http://localhost:4566/_fakecloud/elbv2/load-balancers

Introspection endpoints

For tests that need to assert on load balancer state without going through the AWS SDK:

Status

ELBv2 control plane is fully implemented (ALB/NLB/GWLB CRUD, target groups + targets + health probes, listeners, rules, certificates, attributes, capacity reservations, mTLS trust stores + revocations, SSL policies, resource policies, tags). ALB has an in-process HTTP data plane for rule matching, target routing, fixed-response, redirect, and sticky sessions, with WAFv2 inspection wired in. NLB and GWLB are control-plane only.

Open an issue if you have a specific ELBv2 use case to prioritize.