Skip to content

ec2: filter values match exactly everywhere except DescribeInstanceTypeOfferings, where AWS documents wildcards for all of them #697

Closed

Description

@scttfrdmn

Filed out of #687. EC2's filtering guide documents wildcards in filter values generally,
not per operation:

Use the * wildcard to match zero or more characters. Use the ? wildcard to match zero
or one character. […] Escape a literal * or ? with a backslash.

Substrate honours them on DescribeInstanceTypeOfferings only — ec2FilterValueMatches and
ec2globMatch (emulator/ec2_instancetypes.go) exist and have one caller. Every other
filter site compares with containsStr, which is exact equality, so tag:Name=web-* matches
nothing and DescribeInstances reports no instances where real EC2 reports several. An empty
answer is the failure mode a wait loop cannot distinguish from "not created yet".

DescribeTags makes this concrete: AWS's own Example 4 on that operation's page filters on
?ebserver, so the wildcards are not incidental to the offerings catalog.

Notes

  • Wildcards apply to values, never to names — filter names are matched exactly and
    case-sensitively (ec2: three inconsistent unknown-filter-name behaviours, where real AWS refuses #687).
  • The guide contradicts itself on ?: the wildcard table says "zero or one character" and a
    later paragraph says "exactly one". ec2globMatch implements zero-or-one, from the table.
    Whichever is chosen must be stated as substrate's reading with the contradiction recorded.
  • The guide also documents limits substrate enforces nowhere: 50 filters per request, 200
    values in total, 255 characters per value. Worth deciding in the same change.

Acceptance criteria

  • Every EC2 filter match function routes value comparison through
    ec2FilterValueMatches rather than containsStr.
  • A table-driven test covering *, ?, a backslash-escaped literal, and
    case-sensitivity, on at least DescribeInstances (tags) and DescribeVolumes.
  • docs/services.md' "Two gaps, deliberately left standing" paragraph updated, and the
    wildcard table currently under "Offerings filters and wildcards" promoted to the shared
    filter section.

Activity

  1. added this to the v0.107.0 milestone on Aug 21, 2026
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions