Repository navigation
Description
Nine routed EC2 describes publish MaxResults and NextToken and implement neither. Each answers its whole listing and discards both parameters, which is the state #917 removed from the other nine EC2 describes over three parts. #917 stopped where it did deliberately — its scope was the operations already carrying a paginator plus the ones whose listings a consumer walks most often — and its final act was to count what remained rather than leave the count implied. This is that count.
Of the three states a published parameter can be in — implemented, absent and refused, or accepted and ignored — these nine are in the third, which is the worst: a consumer's paging loop terminates on its first response against substrate and first executes for real against an account large enough to page, with no test covering it, and a NextToken from anywhere else is answered with the whole listing again rather than refused.
The audit was done against the dispatch switch (emulator/ec2_plugin.go:72-266, the only EC2 router) crossed with each operation's own AWS API reference page. All sixteen pages were read; none returned an empty body.
The nine
| Operation | Dispatch | MaxResults valid range, verbatim |
|---|---|---|
DescribeInstanceStatus |
ec2_plugin.go:84 |
Type Integer, no Valid Range line. Its page is the one of the nine that states the prohibition outright: "You cannot specify this parameter and the instance IDs parameter in the same request." |
DescribeInternetGateways |
ec2_plugin.go:115 |
Valid Range: Minimum value of 5. Maximum value of 1000. |
DescribeRouteTables |
ec2_plugin.go:125 |
Valid Range: Minimum value of 5. Maximum value of 100. |
DescribeNatGateways |
ec2_plugin.go:201 |
Valid Range: Minimum value of 5. Maximum value of 1000. |
DescribeInstanceTypes |
ec2_plugin.go:209 |
Valid Range: Minimum value of 5. Maximum value of 100. |
DescribeInstanceTypeOfferings |
ec2_plugin.go:211 |
Valid Range: Minimum value of 5. Maximum value of 1000. |
DescribeSpotPriceHistory |
ec2_plugin.go:213 |
Type Integer, no Valid Range line |
DescribeLaunchTemplates |
ec2_plugin.go:218 |
Valid Range: Minimum value of 1. Maximum value of 200. — "This value can be between 1 and 200." |
DescribeFleets |
ec2_plugin.go:233 |
Type Integer, no Valid Range line |
Every one of them reads neither parameter today: outside ec2_describetags.go, ec2_launchtemplate_versions.go, ec2_pagination.go and ec2_plugin.go the strings MaxResults and NextToken do not appear in the EC2 files at all, and inside ec2_plugin.go every occurrence is in one of the paginating handlers. So this is silent acceptance rather than partial handling.
What is not in scope, recorded so the count is not read as larger than it is
Seven other routed Describe* operations publish neither parameter, and their handlers are correct as written: DescribeKeyPairs, DescribePlacementGroups, DescribeAvailabilityZones, DescribeAddresses, DescribeRegions, and the two single-attribute reads DescribeInstanceAttribute and DescribeSnapshotAttribute. Nothing to do at any of them.
This also corrects a figure docs/services.md carried from #917's first part: "roughly twenty other describes published both parameters and implemented neither". Against the routed set the number is nine, and the correction lands with this issue.
Acceptance criteria
- All nine paginate on the shared helpers
ec2MaxResults,ec2NextTokenOffsetandec2Page(emulator/ec2_pagination.go), so the count of paginator implementations stays at two — the flat one andec2PageReservations— rather than rising. - The published range is applied per operation, not harmonised: 5–1000 at
DescribeInternetGateways,DescribeNatGatewaysandDescribeInstanceTypeOfferings; 5–100 atDescribeRouteTablesandDescribeInstanceTypes; 1–200 atDescribeLaunchTemplates; andec2MinUnpublishedMaxResultswithec2NoMaxResultsCeilingat the three that publish no bound —DescribeInstanceStatus,DescribeSpotPriceHistoryandDescribeFleets— per ec2: an invalid block device mapping is accepted instead of refused with InvalidBlockDeviceMapping #671's rule that only what the API model states is modelled.DescribeLaunchTemplatesis the only one whose published floor is 1 rather than 5. - A
MaxResultsoutside the applicable range is refused withInvalidParameterValue/400 rather than clamped, and aNextTokensubstrate did not issue is refused, both before any state is read. -
ec2RefuseIDsWithMaxResultsis applied where the operation takes an ID list.DescribeInstanceStatusis the one of the nine whose own page repeats the service-wide rule, so it applies verbatim there; at the others it rests on the Query Requests page's service-wide statement, as it already does at the nine converted operations. - An absent
MaxResultsanswers the whole listing with no token element, unchanged from today's behaviour at all nine. - A full final page carries no token.
-
docs/services.mdrecords the conversions, and the "roughly twenty" figure in One offset paginator, shared is corrected to the verified nine. - Tests are wire-level and walk each listing to exhaustion, comparing the walk element-for-element against the unpaginated answer.
Splitting this by page family rather than doing all nine at once is reasonable — the three with no published bound are one group, the four 5-bounded ones another, and DescribeLaunchTemplates sits alone.
Activity
feat(pagination): the two cursors outside EC2 that published both hal…
scttfrdmn commentedon Sep 18, 2026
Verified this issue against
mainbefore starting. The nine are the right nine, all nine still read neither parameter, the seven excluded operations are correctly excluded, and every published range in the table reproduces. Four corrections and one finding that makes the work smaller than the issue implies.The finding: there is no signature obstacle here, unlike #1025
All nine handlers already take
*AWSRequest:DescribeInstanceStatusec2_plugin.go:84ec2_plugin.go:1443DescribeInternetGateways:115:2199DescribeRouteTables:125:2389DescribeNatGateways:201:5633DescribeInstanceTypes:209:5815DescribeInstanceTypeOfferings:211:5901DescribeSpotPriceHistory:213:5991DescribeLaunchTemplates:221:6354DescribeFleets:236ec2_fleet.go:795So each conversion is confined to its own handler: no call site changes, nothing to sequence, and the nine are independent of each other. That is the opposite of #1025's shape, where the cost was the signatures and the six had to land two at a time. The suggested split by page family is still the right one, but for review size rather than necessity.
Two dispatch line numbers have drifted, and one handler is in another file
DescribeLaunchTemplatesdispatches at:221, not:218, andDescribeFleetsat:236, not:233. The other seven are exact. The switch runs to:276, not:266as the audit note says.More usefully:
describeFleetsis not inec2_plugin.goat all — it isec2_fleet.go:795. A sweep that greps only the router's file will convert eight and miss one.The "roughly twenty" correction is half done, and the remaining half is in the code
The issue says the figure lands with it.
docs/services.mdwas already corrected under #917's own audit — the sentence atdocs/services.md:8596now reads "audited, rather than the 'roughly twenty' this paragraph used to estimate", and the nine remaining operations are already tabulated there with their verified published ranges (which is where the ranges in this issue's table were confirmed against).What survives is
ec2_pagination.go:12: "Roughly twenty other describes publish MaxResults and NextToken and implemented neither", in the file comment that exists precisely to state the count once. Correcting that comment — and the "from two to twenty" sentence two lines below it — is what remains of that criterion.The test table cannot express these ranges as it stands
ec2PagedOp(ec2_pagination_test.go:47) carries apublished boolcolumn, documented as true when the page publishes "Valid Range: Minimum value of 5. Maximum value of 1000." That was sufficient for #917's nine, where every publishing page published the same pair of numbers. It is not sufficient here: 5–100 appears at two of the nine while a sibling publishes 5–1000, andDescribeLaunchTemplatespublishes 1–200 — a floor of 1 rather than 5, the only one in the set. A boolean would force the three ranges to collapse into one, which is exactly the harmonisation the second acceptance criterion forbids.So the column becomes a min/max pair, with the unpublished case expressed as
ec2MinUnpublishedMaxResults/ec2NoMaxResultsCeilingrather than aspublished: false. That is a change to the existing nine operations' rows too, so it is worth doing in the first of the split PRs rather than the last.Every helper the first acceptance criterion names exists and is unchanged:
ec2MaxResults(ec2_pagination.go:94),ec2NextTokenOffset(:126),ec2Page(:159),ec2PageReservations(:189),ec2RefuseIDsWithMaxResults(:244), and the two unpublished-bound constants at:56and:60.feat(ec2): three describes with no published MaxResults range page (#…
feat(ec2): five describes with a published 5-floor range page (#1024) (…
feat(ec2): DescribeLaunchTemplates pages, the last of #1024's sixteen (…
docs(#1092): the #917 figure, corrected everywhere it was shipped (#1218