Skip to content

EC2: DescribeInstanceTypes ignores Filter.N entirely #495

Closed

Description

@scttfrdmn

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

Acceptance criteria

  • DescribeInstanceTypes with Name=instance-type,Values=m5.xlarge returns only
    m5.xlarge; with Values=c5* returns every c5 family 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 in docs/services.md, not left implicit.
  • The TODO(#N) in describeInstanceTypes is removed.

Activity

  1. added
    type: bug
    priority: low
    on Aug 2, 2026
  2. scttfrdmn commented on Aug 22, 2026

    @scttfrdmn
    OwnerAuthor

    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) calls ec2CheckInstanceTypesExist on InstanceType.N before filtering, so a named-but-nonexistent instance type answers InvalidInstanceType rather than an empty set.
    • The same handler runs ec2InstanceTypeFilterSpec().check, so an unrecognised filter name is refused rather than silently matching nothing.
    • docs/services.md:2964 records the coverage in the matrix.
    • No live TODO(#495) directive remains anywhere in the tree.

    Nothing in milestone 93's work changed this analysis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: ec2priority: lowtype: bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions