Repository navigation
Description
ELBPlugin.HandleRequest's action switch (emulator/elb_plugin.go:47-95) has no DescribeAccountLimits arm, so the call falls to unknownActionError — although substrate's own authorization data already carries the action (emulator/authz_reference_gen.go:1424, "elasticloadbalancing:DescribeAccountLimits": {}) and AWS publishes the operation for both generations.
So a caller can be authorized for an action substrate then refuses to perform. It is also the one shared action name of the nine that does not route anywhere — a correction to #844, whose body says all nine route to v2.
What AWS publishes — verified from both API references
Both generations take the same two request parameters and return the same two elements:
Classic (elasticloadbalancing-2012-06-01) |
v2 (elasticloadbalancingv2-2015-12-01) |
|
|---|---|---|
Marker |
"The marker for the next set of results. (You received this marker from a previous call.)" String, not required | identical wording |
PageSize |
Integer, "Minimum value of 1. Maximum value of 400.", not required | identical |
Limits.member.N |
Array of Limit |
Array of Limit |
NextMarker |
"The marker to use when requesting the next set of results. If there are no additional results, the string is empty." | "If there are additional results, this is the marker for the next set of results. Otherwise, this is null." |
| Errors | CommonErrors only — the page publishes no operation-specific error |
same |
Note the NextMarker sentence differs between the two generations: classic documents an empty string when exhausted, v2 documents null. That is a published difference, not a paraphrase, and it belongs in whatever renders it.
Limit (API_Limit) is Max (String — not an integer) and Name (String), both optional. The two generations differ on whether the names are enumerated:
- Classic's
API_Limitenumerates exactly three: "The possible values are:classic-listeners,classic-load-balancers,classic-registered-instances". - v2's
API_Limitenumerates none — it says only "The name of the limit." and points at the three quota user guides (Application, Network, Gateway Load Balancers). So the v2 name set is not published on the API reference page; any list of them is taken from a user guide, and must be labelled as such rather than presented as the API model.
PageSize 1–400 matches elbMaxPageSize territory already in the plugin for the other Describes, and Marker matches the existing cursor pattern — so pagination reuses what is there.
The interesting design question
Substrate has no quota model. The limits are constants, not derived from state, which means this operation reports numbers that no part of substrate enforces. Two readings, and the issue should settle which before implementing:
- Report AWS's default quotas as constants. A caller reading a limit gets a plausible number, and a caller that computes headroom against it gets an answer substrate will then not enforce — a value that does not come from where it appears to, which is the exact defect class v0.116.0 was spent removing.
- Report the limits and make them seedable, so a test can drive a consumer's "approaching my quota" path — which is the reason a caller polls this operation at all. This fits the house seeding pattern (
POST/DELETE /v1/elb/...keyed by limit name or"*") and turns a decorative constant into something a test can use.
(2) is the better fit for substrate's stated purpose, and it is barely more work than (1) — the constants become the default seed value. Whichever is chosen, docs/services.md must record that no operation enforces these numbers.
Which generation is answered follows whatever #844 decides about dispatch: today the plugin serves v2 shapes under both API versions, so until classic dispatch exists there is one handler, and its Limit.Name set should be the v2 one.
Acceptance criteria
-
DescribeAccountLimitsdispatches, is authorized againstelasticloadbalancing:DescribeAccountLimits(already in the authz data — no authz-reference change), and answersLimits.member.NplusNextMarker. -
PageSizeis honoured with the documented 1–400 range, and a value outside it is handled the way substrate's other ELB paginators handle theirs — consistently, whichever that is. -
Markerround-trips over a stable order, so a paged walk returns each limit exactly once. This depends on the deterministicListorder shipped in state: MemoryStateManager.List returns keys in Go map order, so 111 call sites answer differently run to run #865. -
Maxis rendered as a string, perAPI_Limit. - The limit names are recorded with their provenance: classic's three are enumerated on
API_Limit; v2's are not published there and come from the quota user guides. - The quota-enforcement question above is settled on the issue, and the answer recorded in
docs/services.md— including, explicitly, that nothing in substrate enforces the number it reports. - If seedable: a control-plane endpoint following the established pattern, and a test that seeds a low limit and reads it back over the wire.
- Behavioural test through
StartTestServerand a real wire call, asserting on raw XML — the member set and the wrapper name, since botocore raisesKeyErroron a wrapper mismatch (docs/services.md:7429-7437).
Found while auditing #844's claim that all nine shared action names route to v2; eight do.
Activity
scttfrdmn commentedon Sep 15, 2026
Settling the design question before implementing: option 2 — the limits are reported and seedable, with AWS's published defaults as the default seed value.
The reasoning is the one this issue already states, and it is the release theme applied to itself. Substrate enforces no ELB quota anywhere, so a constant reported here is a number that does not come from where it appears to. Option 1 hands a caller computing headroom an answer substrate will then not enforce; option 2 turns the same constant into the thing a caller polls this operation for — driving its own "approaching my quota" path — at essentially the same cost, since the constants become the default.
Consequences to carry into the PR:
POST/DELETE /v1/elb/account-limits, keyed by limit name or the"*"wildcard, specific-then-wildcard resolution.ec2FleetShortfall(emulator/ec2_fleet_control.go:14-46) is the shape to copy: a namespace constant, a key builder,resolveXtrying the specific key then"*", and the two control handlers.docs/services.mdmust state explicitly that nothing in substrate enforces the number this operation reports, seeded or defaulted. That sentence is the whole point of choosing option 2 honestly rather than presenting a plausible constant.Limit.Nametakes the v2 set.API_Limitenumerates exactly three (classic-listeners,classic-load-balancers,classic-registered-instances); v2'sAPI_Limitenumerates none — it says only "The name of the limit" and points at the three Load Balancer quota user guides. So every v2 name substrate reports is taken from a user guide, not from the API model, and the doc comment says so. That distinction is exactly the kind this project has been recording release over release; do not present a user-guide list as the published API model.NextMarker's documented semantics differ between generations — classic publishes an empty string when exhausted, v2 publishes null. Since the handler answers v2 shapes, it follows v2, and the difference is recorded against the day classic dispatch arrives (elb: the classic (2012-06-01) Elastic Load Balancing API is unrouted, so aws elb create-load-balancer is refused for a v2 parameter name #844).Maxrenders as a String, perAPI_Limit. It is the kind of member a caller's code will try to treat as an integer, so the raw-XML assertion matters.No authorization-reference change is needed:
elasticloadbalancing:DescribeAccountLimitsis already present with an empty resource list (emulator/authz_reference_gen.go:1424), so the handler needs only itsp.authorize(...)line — which is the whole reason this was authorizable-but-undispatched in the first place.feat(elb): DescribeAccountLimits answers, with seedable limits (#885)
test(elb): cover the account-limit store-failure paths (#885)
feat(elb): DescribeAccountLimits answers, with seedable limits (#885)
test(elb): cover the account-limit store-failure paths (#885)