DocsAWS 101BlogServices

ALB / ELBv2

Application / Network Load Balancers v2 — load balancers, target groups, listeners, rules. Data-plane routes requests by host/path.

Query (form-encoded) multi-tenant 34 operations

Quick start

import boto3
elb = boto3.client("elbv2", endpoint_url="http://localhost:4566",
                   region_name="us-east-1",
                   aws_access_key_id="test", aws_secret_access_key="test")
elb.create_load_balancer(Name="lb", Subnets=["subnet-1"], Type="application")

Supported operations

34 operations exposed by this service as of MiniStack 1.5.44. Extracted directly from the handler dispatch in the source module.

AddListenerCertificates AddTags CreateListener CreateLoadBalancer CreateRule CreateTargetGroup DeleteListener DeleteLoadBalancer DeleteRule DeleteTargetGroup DeregisterTargets DescribeListenerAttributes DescribeListenerCertificates DescribeListeners DescribeLoadBalancerAttributes DescribeLoadBalancers DescribeRules DescribeTags DescribeTargetGroupAttributes DescribeTargetGroups DescribeTargetHealth ModifyListener ModifyListenerAttributes ModifyLoadBalancerAttributes ModifyRule ModifyTargetGroup ModifyTargetGroupAttributes RegisterTargets RemoveListenerCertificates RemoveTags SetIpAddressType SetRulePriorities SetSecurityGroups SetSubnets

CloudFormation

The CloudFormation engine provisions these resource types via this service:

AWS::ElasticLoadBalancingV2::Listener AWS::ElasticLoadBalancingV2::ListenerRule AWS::ElasticLoadBalancingV2::LoadBalancer AWS::ElasticLoadBalancingV2::TargetGroup

See CloudFormation engine for intrinsic support and lifecycle details.

Known limitations

  • Health checks are stored but never executed — every registered target is always reported healthy.
  • Cross-zone load balancing settings are accepted but have no effect (there are no zones).
  • Targets get X-Forwarded-For (per routing.http.xff_header_processing.mode), X-Forwarded-Proto, X-Forwarded-Port and X-Amzn-Trace-Id as AWS sets them; routing.http.xff_client_port.enabled is not modelled.
  • The data plane finds a load balancer by its DNSName, by <name>.alb.localhost, or through a public Route 53 A/AAAA alias record targeting it (exact or wildcard, the most specific name winning), so one ALB can serve many hostnames such as *.alb.localhost.
  • `authenticate-cognito` sends the browser to the user pool domain's `/oauth2/authorize` (`https://<prefix>.auth.<region>.amazoncognito.com` or the custom domain), as AWS does, so that hostname must reach MiniStack, as for Cognito's `iss`.

Source

  • ministack/services/alb.py

Read the source to verify the ops list above — dispatch tables and handler functions are the ground truth.