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:

Roadmap

This page tracks the ELBv2 surface that has shipped. Subsequent batches will land target groups + targets + health, listeners + rules, listener attributes + trust stores + capacity reservations, and finally an in-process HTTP router so requests to the LB DNS name actually route to registered targets.

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