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
fakecloudPoint 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
- All three load balancer types.
application,network, andgateway—Typeis honored, ARN prefix follows AWS conventions (app/,net/,gwy/), DNS names are deterministic per LB. - Real Smithy validation. Name length (1-32), allowed characters (alphanumeric + hyphens),
internal-prefix rejection,SchemeandIpAddressTypeenum constraints — all checked exactly as AWS does, returningValidationErrorwith the same shape. - Idempotent
CreateLoadBalancer. Re-creating with the same name returns the existing load balancer instead of throwing — matches AWS's documented idempotency. - Tags work across every taggable resource.
AddTags/RemoveTags/DescribeTagsoperate on load balancers, target groups, listeners, rules, and trust stores. DescribeAccountLimitsreturns the AWS-published default limits for application/network/gateway LBs, target groups, targets per LB/AZ/group, listeners, rules, certificates, trust stores, and revocation entries.DescribeSSLPoliciesreturns predefined ALB security policies (ELBSecurityPolicy-TLS13-1-2-2021-06,ELBSecurityPolicy-FS-1-2-Res-2020-10, etc.) with the exact protocol + cipher lists AWS publishes.
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-balancersIntrospection endpoints
For tests that need to assert on load balancer state without going through the AWS SDK:
GET /_fakecloud/elbv2/load-balancers— list all load balancersGET /_fakecloud/elbv2/target-groups— list all target groupsGET /_fakecloud/elbv2/listeners— list all listenersGET /_fakecloud/elbv2/rules— list all listener rules
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.