Repository navigation
Description
Found while fixing #485.
describeInstanceTypes (emulator/ec2_plugin.go) reads InstanceType.N but never
parses Filter.N, so every documented filter is silently ignored — a caller asking
for, say, Name=instance-type,Values=c5* or
Name=vcpu-info.default-vcpus,Values=4 gets the whole catalog back with HTTP 200.
This is the same shape as #485 item 2 (the offerings operation ignored its
instance-type filter), and it matters for the same reason: an ignored filter turns
a narrowing query into an unconditional success, so a caller cannot tell "everything
matched" from "the filter was not applied".
#485 deliberately did not fix it, because the two operations are not symmetric.
DescribeInstanceTypeOfferings documents exactly two filter names
(instance-type, location) and both are answerable from the seeded catalog, so
#485 implemented both and refuses an unrecognised third. DescribeInstanceTypes
documents roughly 60, nearly all over response fields the seeded catalog does not
carry at all — ebs-info.*, network-info.*, instance-storage-info.*,
hypervisor, nitro-*, and so on. Implementing the handful that are modellable and
ignoring the rest would leave the defect in place for most inputs; refusing the rest
would refuse filters real AWS accepts.
What a fix needs to decide
- Which filters the catalog can answer today:
instance-type(with the documented
c5*wildcard, which EC2: DescribeInstanceTypes returns empty instead of InvalidInstanceType, and DescribeInstanceTypeOfferings ignores the instance-type filter #485 already implements asec2FilterValueMatches),
vcpu-info.default-vcpus,memory-info.size-in-mib,
processor-info.supported-architecture,supported-usage-class,
current-generation. - What to do with a documented filter over an unmodelled field. Refusing it is a
divergence (real AWS accepts it); ignoring it is the defect this issue is about.
A third option is to widenec2InstanceTypeInfofar enough to answer them, which
is a much larger change and would need a source for every field. - Whether an undocumented filter name should be refused. EC2: DescribeInstanceTypes returns empty instead of InvalidInstanceType, and DescribeInstanceTypeOfferings ignores the instance-type filter #485 established
ec2InvalidFilterErrorfor exactly that on the offerings operation.
Acceptance criteria
-
DescribeInstanceTypeswithName=instance-type,Values=m5.xlargereturns only
m5.xlarge; withValues=c5*returns everyc5family member. - A numeric filter (
vcpu-info.default-vcpus) narrows the result set. - The decision on documented-but-unmodellable filter names is recorded in the code
comment and indocs/services.md, not left implicit. - The
TODO(#N)indescribeInstanceTypesis removed.
Activity
feat(ec2): a filter spec per never-parsed describe (#695) (#722)
scttfrdmn commentedon Aug 22, 2026
Closing: fully resolved by v0.107.0's #695 work. Verified against the code rather than the release notes, all four acceptance criteria:
describeInstanceTypes(emulator/ec2_plugin.go:5314-5326) callsec2CheckInstanceTypesExistonInstanceType.Nbefore filtering, so a named-but-nonexistent instance type answersInvalidInstanceTyperather than an empty set.ec2InstanceTypeFilterSpec().check, so an unrecognised filter name is refused rather than silently matching nothing.docs/services.md:2964records the coverage in the matrix.TODO(#495)directive remains anywhere in the tree.Nothing in milestone 93's work changed this analysis.
chore: every TODO(#N) cites an open issue (#829) (#830)