Repository navigation
Description
The elasticloadbalancing endpoint serves only the 2015-12-01 (ELBv2) API. A classic
Load Balancer request reaches the same plugin, is decoded with v2's parameter names, and is
refused for a parameter the classic API does not have.
What substrate does
ELBPlugin.Name() returns elasticloadbalancing (emulator/elb_authz.go:13), which is the
correct endpoint prefix — AWS serves both API versions there and distinguishes them by the
Version parameter. But every handler behind it implements the 2015-12-01 shapes, and the
three action names the two versions share (CreateLoadBalancer, DescribeLoadBalancers,
DeleteLoadBalancer) are routed to the v2 handler unconditionally
(emulator/elb_plugin.go:47-52). req.Params["Version"] is never read anywhere.
createLoadBalancer reads req.Params["Name"] (emulator/elb_plugin.go:102):
name := req.Params["Name"]
if name == "" {
return nil, &AWSError{Code: "ValidationError", Message: "Name is required", HTTPStatus: http.StatusBadRequest}
}The classic API's parameter is LoadBalancerName. So aws elb create-load-balancer — the
classic CLI command — is refused with ValidationError: Name is required, naming a parameter
that does not exist in the API the caller was using. Listeners.member.N, which classic
requires, is not read either; AvailabilityZones.member.N is not read (v2's Subnets.member.N
is, and AZs are synthesised from it at :122-128).
What AWS documents
CreateLoadBalancer (2012-06-01) — "Creates a Classic Load Balancer":
-
Required:
LoadBalancerName("must have a maximum of 32 characters, must contain only
alphanumeric characters or hyphens, and cannot begin or end with a hyphen") and
Listeners.member.N(array ofListenerobjects). -
Optional:
AvailabilityZones.member.N,Scheme,SecurityGroups.member.N,
Subnets.member.N,Tags.member.N. -
Response Elements: "The following element is returned by the service. DNSName — The
DNS name of the load balancer." That is the whole result. There is no ARN:<CreateLoadBalancerResponse xmlns="http://elasticloadbalancing.amazonaws.com/doc/2012-06-01/"> <CreateLoadBalancerResult> <DNSName>my-vpc-loadbalancer-1234567890.us-east-1.elb.amazonaws.com</DNSName> </CreateLoadBalancerResult> ...
-
The sample request goes to
https://elasticloadbalancing.amazonaws.com/?Action=CreateLoadBalancer…&Version=2012-06-01
— same host as v2, differentVersion.Versionis what tells the two apart, and
substrate does not read it. -
Errors are classic's own set, several of which v2 does not have:
DuplicateLoadBalancerName,
InvalidScheme("You can only specify a scheme for load balancers in a VPC"),
SubnetNotFound,TooManyLoadBalancers,OperationNotPermitted,UnsupportedProtocol.
InvalidConfigurationRequestis 409, not 400.
The CloudFormation half
AWS::ElasticLoadBalancing::LoadBalancer has no arm in dispatchResource — it appears
nowhere in the Go source (only in docs/services.md and CHANGELOG.md) and falls through to
the generic stub. docs/services.md records the consequence for #827:
AWS::ElasticLoadBalancing::LoadBalancer(classic) — documented as the DNS name. The
classic load balancer has no deploy helper at all, so there is no DNS name to return.
So a template declaring a classic load balancer deploys a stub, and !Ref on it answers the
logical ID rather than the DNS name AWS documents.
Why one issue and not two
The DNS name Ref resolves to cannot exist until the classic API mints one, and the classic
API cannot mint one until it is routed and decoded separately from v2. Fixing the deploy helper
without the API version gives the deployer nothing correct to call — the same reason #827 left
this recorded rather than resolved.
Acceptance criteria
- The
Versionparameter (or an equivalent discriminator, decided and documented) routes a
2012-06-01 request to classic handlers and 2015-12-01 to the existing v2 handlers. Which
discriminator is used is stated indocs/services.md, since a request that omits
Versionhas to resolve to one of them and AWS's SDKs always send it. - Classic
CreateLoadBalancerdecodesLoadBalancerName,Listeners.member.N,
AvailabilityZones.member.N,Subnets.member.N,SecurityGroups.member.N,Schemeand
Tags.member.N, and answers a<CreateLoadBalancerResult>carrying onlyDNSName. -
LoadBalancerName's documented constraints are enforced (≤32 chars, alphanumeric or
hyphen, no leading or trailing hyphen), andListeners.member.Nbeing absent is refused. -
DuplicateLoadBalancerNameon a repeated name;InvalidConfigurationRequestcarries
409. - Classic
DescribeLoadBalancersreportsLoadBalancerDescriptions(classic's shape), not
v2'sLoadBalancers, and does not report an ARN. - Classic records are keyed so that a classic and a v2 load balancer of the same name
coexist, and neitherDescribeLoadBalancersreports the other's. - Which classic operations are in scope is stated: at minimum the create/describe/delete
trio plusAddTags/RemoveTags/DescribeTags;RegisterInstancesWithLoadBalancer,
CreateLoadBalancerListenersand the health-check operations are decided one way or the
other and recorded, not left silent. - A
deployELBClassicLoadBalancerhelper dispatchesAWS::ElasticLoadBalancing::LoadBalancer,
records the DNS name, and!Refon the type resolves to it — thedocs/services.md
"recorded rather than fixed" entry is then removed. - Tags written through the classic
AddTagsare readable through the Resource Groups
Tagging API and vice versa (cfn: the aws:cloudformation:* stamp covers EC2 only, so the rest of a stack is unstamped #765's standing rule), or the gap is filed.
Activity
scttfrdmn commentedon Sep 14, 2026
Moved to v0.116.0. The claim verifies exactly, and nothing in v0.115.0 changed the analysis except to file its two state-level findings separately so they are not lost. It moves because it is missing API surface rather than a wrong identifier, which is the theme v0.115.0 was cut around, and because Tier 1 alone is M.
Verified as filed
elb_plugin.gorequiresName, the v2 parameter, soaws elb create-load-balancer— which sendsLoadBalancerName— is refused. Two corrections:Params, and a test already assertsParams["Version"]survives. The discriminator is a plugin-side switch onreq.Params["Version"], andrefineAPIGatewayVersionis the in-tree precedent for two API versions behind one endpoint.Two findings filed separately
elbResourceKindFromARNclassifies bystrings.Contains(arn, ":loadbalancer/"), which matches a classic ARN too, andelbStateKeyPrefixthen scans thelb:prefix where v2 load balancers live. A classic and a v2 load balancer of the same name collide. The discrimination must be on ARN arity — the vendoredemulator/authzref/elasticloadbalancing.json(v1.4) gives classic as one segment afterloadbalancer/and v2 as three. This is now tagging: resolveARN has no elasticloadbalancing arm, so the Resource Groups Tagging API reaches no ELB resource #863, along with:resolveARNhas noelasticloadbalancingarm at all, so the Resource Groups Tagging API reaches no ELB resource today — v2 included. cfn: the aws:cloudformation:* stamp covers EC2 only, so the rest of a stack is unstamped #765's cross-readability rule is already unmet for ELBv2, which v0.115.0 states rather than silently inheriting.One gap this settles for free
The vendored reference resolves the unknown recorded at
elb_authz.go: every classic mutating action (andAddTags/RemoveTags) is scoped to the bareloadbalancerresource type, while the sevenDescribe*actions list no resource types — which vindicates the deliberate omission. That comment can cite the reference instead of recording an open question, and no authz-reference change is needed; only the plugin surface.One decision it will need, and AWS does not document it
Neither Common Parameters page states what an absent or unrecognised
Versiondoes. Defaulting to v2 preserves every existing test, so that is the answer — but it is substrate's reading, not AWS's, and must be recorded as such rather than implied by the code.Tier 1 (
CreateLoadBalancer,DescribeLoadBalancers,DeleteLoadBalancer,AddTags/RemoveTags/DescribeTags) is M; the full 29-action surface is XL. It reads as its own release.scttfrdmn commentedon Sep 15, 2026
Deferred out of v0.116.0 to v0.117.0. Three corrections to this issue's premises, verified against the tree at
bd1dca7, so the work needs no re-researching when it is picked up."All nine shared action names route to v2" — it is eight
DescribeAccountLimitsis absent from the action switch (elb_plugin.go:47-95) and falls through tounknownActionError, although substrate's own authorization data carries the action (authz_reference_gen.go:1424). So a caller can be authorized for it and then refused.Filed separately as #885, with both generations' shapes verified from the API references. The relevant finding for this issue: the two generations'
DescribeAccountLimitsdiffer in exactly one published sentence (NextMarkeris documented as an empty string when exhausted for classic, and as null for v2), and classic'sAPI_Limitenumerates threeNamevalues —classic-listeners,classic-load-balancers,classic-registered-instances— where v2's enumerates none. That is a per-generation difference in the API model itself, which is the pattern the rest of this issue has to handle.This is larger than M
Only
DeleteLoadBalanceris cheap. The three tag operations cannot reuseelb_tags.go:LoadBalancerNames.member.N, notResourceArnsTags.member.N.Key, notTagKeys.member.NelbMaxTagsPerResource = 50(elb_tags.go:38)And
DescribeLoadBalancersshares onlyLoadBalancerNameandDNSNamewith its v2 counterpart. It differs in the result wrapper, the list member name, a 16-member item shape, and the XML namespace. The wrapper name is load-bearing, not cosmetic: botocore looks it up and raisesKeyErroron a mismatch, whichdocs/services.md:7429-7437already records. So a near-miss here is not a soft fidelity gap, it is a client-side exception.Re-estimate before scheduling. The tag operations are three near-duplicates rather than three reuses, and
DescribeLoadBalancersis a second shape rather than a parameterization of the first.No authz-reference change is needed
The open question recorded at
elb_authz.go:55-60is resolved by AWS's vendored reference: all seven classicDescribe*actions carry an emptyResourceslist inauthzref/elasticloadbalancing.json, meaning AWS supports no resource-level permissions for them. Nothing to regenerate.Two pieces of existing machinery to use
elbChildARN'swantSegmentsparameter (elb_types.go:308-318) is already the arity discriminator between a classic and a v2 ARN, which is what tagging: resolveARN has no elasticloadbalancing arm, so the Resource Groups Tagging API reaches no ELB resource #863 needs from this issue.elbResolveTaggedResource(elb_tags.go:296-306) compares exact ARN equality, which is why tagging: resolveARN has no elasticloadbalancing arm, so the Resource Groups Tagging API reaches no ELB resource #863's collision does not exist yet and is the property to preserve when classic records start being written.elb_plugin.go:160is currently the only writer of alb:key.What v0.116.0 changed for this issue
#865 made
MemoryStateManager.Listreturn lexicographic order, so all fourteen ELBDescribe*sites are deterministic. Each was previously paging aMarker/PageSizecursor over Go's map hash seed — a cursor over an unstable order can skip or repeat a resource across pages, so this was a correctness fix rather than a determinism nicety. Any classicDescribeLoadBalancersadded here inherits it.feat(elb): DescribeAccountLimits answers, with seedable limits (#885)
feat(elb): DescribeAccountLimits answers, with seedable limits (#885)
feat(elb): DescribeAccountLimits answers, with seedable limits (#885) (…
scttfrdmn commentedon Sep 16, 2026
Moved to the v0.118.0 milestone, with one of its own findings closed out.
Discharged this release: #885.
DescribeAccountLimitsnow routes and its limits are seedable viaPOST/DELETE /v1/elb/account-limits. That closes the correction recorded against this issue duringv0.116.0 planning — eight of the nine shared action names routed to v2, not nine;
DescribeAccountLimitswas absent fromELBPlugin.HandleRequest's switch and fell through tounknownActionErrorwhile being grantable in the generated authorization reference. So a caller couldhold
elasticloadbalancing:DescribeAccountLimitsand be answeredInvalidAction. The names thatoperation reports for classic versus v2 are already split by generation in
docs/services.md, which isdirectly useful here.
Unchanged, and why it stays deferred: the issue is larger than the M it is labelled. Only
DeleteLoadBalanceris cheap. The three tag operations cannot reuseelb_tags.go: classic takesLoadBalancerNames.member.Nrather thanResourceArns,Tags.member.N.Keyrather thanTagKeys.member.N, and caps at 10 tags whereelbMaxTagsPerResourceis 50.DescribeLoadBalancersshares only
LoadBalancerNameandDNSNamewith v2 and differs in result wrapper, list member, the16-member item shape and the XML namespace — and the wrapper name is load-bearing, because botocore
looks it up and raises
KeyErroron a mismatch.Carried forward so it needs no re-researching: AWS's vendored reference resolves the open authorization
question — all seven classic
Describe*actions carry an emptyResourceslist — so noauthz-reference change is needed, and
elbChildARN'swantSegmentsparameter is already the ARNarity discriminator this work needs.
5 remaining items
scttfrdmn commentedon Sep 18, 2026
Moved to v0.120.0, and split into three tiers
v0.119.0 ships no part of this issue. It has carried an M label through three releases on reasoning that is now provably wrong, and the decision this release makes is to split it rather than schedule it again at the wrong size.
One correction to the comment above, and it is the important one
That comment records #863 as giving a classic load balancer "a second reader this issue previously did not have to think about" — true, but it understates what happened. #863 did not merely make the classic/v2 ARN collision avoidable; it pinned the opposite reading in a test.
elbResourceKindFromARN(emulator/elb_tags.go:207-235) deliberately leaves a classic ARN unclassified, and says so in the source:and
TestELBTagging_AClassicLoadBalancerARNIsRefused(emulator/tagging_elb_test.go:281-300) asserts the refusal over the wire, in both directions — ELBv2AddTagsand the tagging API — using a classic ARN whose name collides with a live v2 load balancer specifically so that a collision would be visible rather than merely possible.So this issue no longer adds a capability to a tree that is silent about classic load balancers. It must reverse a recorded reading and rewrite a test that exists to pin it. That is a different kind of change from routing a missing API, and it is why the size label was never right.
The three tiers
Each is independently shippable and each leaves the tree consistent. They must land in this order, because Tier 1a is what makes the classic record exist at all.
Tier 1a — the discriminator, the records, and the reversal. The arity discriminator (
elbChildARN'swantSegments: a one-segmentloadbalancer/<name>is classic, three segments is v2), the classic load-balancer record,CreateLoadBalancer/DescribeLoadBalancers/DeleteLoadBalancer, and theelbResourceKindFromARNreversal withTestELBTagging_AClassicLoadBalancerARNIsRefusedrewritten from "refused" to "classified as classic".DescribeLoadBalancersshares onlyLoadBalancerNameandDNSNamewith v2 — the result wrapper, list member, 16-member item shape and XML namespace all differ, and the wrapper name is load-bearing because botocore looks it up and raisesKeyErroron a mismatch.Tier 1b — the three classic tag operations and the scanner.
AddTags,RemoveTagsandDescribeTagson the 2012-06-01 API, which cannot reuseelb_tags.go: classic takesLoadBalancerNames.member.Nrather thanResourceArnsandTags.member.N.Keyrather thanTagKeys.member.N, and caps at 10 tags whereelbMaxTagsPerResourceis 50. Plus a fifth tagging scanner inGetResourcesand the persistedever_taggedflag, without which a classic record whose tags were all removed is indistinguishable from one never tagged (#938), and with #937's Region and account filtering applying unchanged.Tier 2 — the CloudFormation deploy helper, which is what removes the divergence recorded at
docs/services.md:1686.Also to decide in Tier 1b, carried from the comment above
ResourceTypeFilters=loadbalancerselects both generations under #936's anchored type-segment match. AWS's ownGetResourcesdoes report both, so the likely answer is yes — but it must be stated as a decision rather than fall out of a regex.Unchanged and still carried forward
All seven classic
Describe*actions carry an emptyResourceslist in AWS's vendored reference, so no authz-reference change is needed; #885 routedDescribeAccountLimitsand made its limits seedable; and #865 made all fourteen ELBDescribe*sites deterministic, which any classicDescribeLoadBalancersinherits.scttfrdmn commentedon Sep 19, 2026
Four premise corrections, posted before the Tier 1a PR opens
Everything below was verified against the tree at
0bc1fa4and against the 2012-06-01 APIreference. Three of the four change what Tier 1a does; the fourth changes why.
1. Tier 1a is L, not M. It is not "route three operations": it is a request-routing
discriminator on a member no handler in this plugin has ever read (the only
Params["Version"]read in the whole tree is
parser_test.go:492), a new record type with its own key space, a newXML document namespace, a 16-member response item with five nested shapes substrate has no type
for, and a reversal that moves seven assertion sites — not the two the tiering comment names:
elb_tags.go:186-192and:218-221,tagging_elb_test.go:281-300,tagging_arn_guards_test.go:199-206,elb_arn_shapes_test.go:175-188,elb_types.go:315-318,tagging_plugin.go:1945-1952, plusdocs/services.md:9767and:9806-9815.(
CHANGELOG.md:2290-2301is historical and is deliberately not rewritten.)2. The
KeyErrorclaim above is wrong, and the truth is worse. The comment argues the resultwrapper name is load-bearing "because botocore looks it up and raises
KeyErroron a mismatch".The wrapper is
DescribeLoadBalancersResultin both generations, so botocore finds exactlywhat it is looking for and decodes an empty list. A classic caller was not getting an error at
all — it was being told, with a 200, that it owns no classic load balancers. That is a silent wrong
answer, which is strictly worse than a decode failure, and it is the single strongest argument for
this issue.
3. The reversal must be caller-scoped, not global. ELBv2's
AddTagspage enumerates theresources it tags — "load balancers, target groups, listeners and rules" — and Classic is absent
from that list, with no published code for a wrong-generation ARN. So
elbResourceKindFromARNcannot simply start classifying a classic ARN: that would make ELBv2's three tag doors accept an
ARN AWS's own page does not list. What ships instead is a second classifier for the
generation-blind callers (the Resource Groups Tagging API, and CloudFormation's tag writers for the
same reason one step removed — a template names a resource type, not an API generation), while
ELBv2's three doors keep the existing classifier and keep answering
ValidationError/400. Thearity check #863 added is not loosened; it is what keeps a classic ARN off the
lb:prefix, and itdoes the work in both directions.
A consequence worth recording for Tier 2: CloudFormation's half has no reachable caller yet.
cfnELBStampableTypeslists the fourAWS::ElasticLoadBalancingV2::*types and the classic typehas no deploy helper, so a stack declaring one falls through to the generic stub and is not stamped
at all. The generation-blind resolver is written and documented where the decision belongs, so the
classic deploy helper is one entry in that map rather than a second tagging decision made later
under pressure.
4. What Tier 1a actually asserts, and the codes it answers. Verified against the published
pages: a classic ARN carries 1 resource segment against ELBv2's 3 (AWS's own Service
Authorization Reference, vendored at
emulator/authzref/elasticloadbalancing.json, so the aritydiscriminator is authoritative);
CreateLoadBalanceranswersDNSNamealone and publishestwelve errors of which
InvalidConfigurationRequest/409 is the one non-400;DescribeLoadBalancerstakesPageSize1–400 with a default of 400;LoadBalancerDescriptionhasexactly 16 members, including
VPCIdwhere ELBv2 spells itVpcId; and the namespace ishttp://elasticloadbalancing.amazonaws.com/doc/2012-06-01/.Eight of those sixteen members are absent rather than invented, each because the operation that
would set it is not routed.
PolicyNamesis emitted as an empty element, because AWS publishes itas one.
DuplicateListeneris not borrowed for two listeners claiming oneLoadBalancerPort—it is published on
CreateLoadBalancerListeners, an operation this one does not have, so the 409InvalidConfigurationRequestis the mapping and it is recorded as substrate's reading (#671).Side finding, filed separately: substrate's
elbXMLNS(elb_plugin.go:947) useshttps://where AWS publishes
http://. And one new divergence the classic work exposes: ELBv2'sDescribeAccountLimitssilently falls back on an out-of-rangePageSizewhere its own pagepublishes 1–400, while the new classic
DescribeLoadBalancersrefuses — one plugin answering twoways for the same published range.
Tiers 1b and 2 move to v0.121.0. This issue stays open; Tier 1a shipping does not close it.
feat(#844): the classic ELB API is routed by the Version a request ca…
scttfrdmn commentedon Sep 20, 2026
Reopened: this was closed by a negated keyword, not by a decision
Tier 1a shipped in #1146; Tiers 1b and 2 have not, so this issue is not complete.
It was closed automatically. #1146's body opens with "Part of #844 (Tier 1a). This does not close
#844 — Tiers 1b and 2 move to v0.121.0." GitHub does not parse the negation: it sees
close #844and closes it. So the sentence written specifically to keep this open is the thing that closed it,
three minutes after the Tier 1a premise corrections were posted and with no comment recording a
decision — which is what gives it away.
The lesson is narrower than "be careful with keywords": a closing keyword cannot be negated in
prose. To reference an issue without closing it, write the bare reference (
#844,part of #844)and never put
close/fixes/resolvesadjacent to the number in any form, however qualified.What actually shipped, and what remains
Shipped (Tier 1a, #1146): the
Versionrequest discriminator — the first read ofParams["Version"]anywhere outsideparser_test.go:492— the classic record and its key space, the2012-06-01XML namespace, the three classic operations, and the caller-scoped reversal that lets theResource Groups Tagging API and CloudFormation's tag writers classify a classic ARN while ELBv2's own
three tag doors keep refusing one with
ValidationError/400.Remaining, moved to v0.121.0 with this comment:
(the cap is 10 and substrate enforces ELBv2's 50, reachable today through the tagging API). Still
unfiled and belonging here:
RemoveTagstakesTags.member.NofTagKeyOnlyrather thanTagKeys.member.N, andDescribeTagscaps at 20 names. The "fifth scanner" this issue onceanticipated is not needed —
scanELBKind(tagging_plugin.go:1262-1310) is alreadyparameterised by kind, so the entries are one line each.
docs/services.md:2106-2108, not the:1686this issue's body cites.yet, because
cfnELBStampableTypeslists only the fourAWS::ElasticLoadBalancingV2::*types andthe classic type has no deploy helper, so a stack declaring one falls through to the generic stub
and is not stamped. That is Tier 2 scope, and until it lands the CFN arm is correct-but-unreached
rather than exercised.
Nothing in v0.120.0 after #1146 changed any of the above.
fix(#1148): a classic load balancer gets the ten tags its own page pu…
feat(#844): route the classic Elastic Load Balancing tag operations (#…
scttfrdmn commentedon Oct 1, 2026
Correction to AC8, before it is checked off. The criterion reads "records the DNS name, and
!Refon the type resolves to it", and
docs/services.mdcarried the same claim in its "recorded ratherthan fixed" list. AWS documents the opposite. From
aws-properties-ec2-elb.html(read 2026-10-01):The DNS name is
Fn::GetAtt DNSName, one of five published attributes — the others beingCanonicalHostedZoneName,CanonicalHostedZoneNameID,SourceSecurityGroup.GroupNameandSourceSecurityGroup.OwnerAlias.So there was never a
Refdivergence here to record or to fix, and #827's note about it was amisreading of the Template Reference rather than a real gap. Per #671 — only what the API model
states — substrate implements the published behaviour:
Refresolves to the load balancer name(which is the physical ID the default arm already answers, so
cfn_intrinsics.goneeded no change atall) and
GetAtt DNSNameresolves to the DNS name the classicDescribeLoadBalancersreports for thesame load balancer. The
docs/services.mdentry is deleted rather than amended.The four remaining attributes answer empty, stated as a #1013 absence: substrate mints no hosted
zone and no source security group for a classic load balancer, and a plausible-looking hosted-zone ID
in a stack
Outputis worse than a missing one because a consumer asserts against it happily.PR #1318 implements AC8 as corrected and asserts both values against each other, so neither can drift
into the other's.
feat(#844): deploy a classic load balancer from CloudFormation (#1318)