Skip to content

kinesis: AddTagsToStream enforces no per-stream tag quota, and AWS's reference publishes two different limits #965

Closed

Description

@scttfrdmn

AddTagsToStream enforces no per-stream tag quota, and AWS's own reference disagrees with itself about what the quota is.

Found while implementing #954, which recorded the disagreement in docs/services.md and deliberately left it unenforced — the change under review was the tag cursor, and enforcing a limit is a refusal a consumer can observe.

The disagreement, verified

API_AddTagsToStream publishes Tags as a map, "Map Entries: Maximum number of 200 items", and API_ListTagsForStream publishes its response Tags as an array, "Array Members: Minimum number of 0 items. Maximum number of 200 items."

The prose on the same two pages says 50:

  • API_AddTagsToStream: "you can assign up to 50 tags to a data stream".
  • API_ListTagsForStream / the tagging prose: "you can add up to 50 tags per resource".

So the shape constraint (200) and the documented quota (50) differ by a factor of four on pages that sit beside each other. The 50 is the service quota; the 200 is the wire shape's own limit, which a request must satisfy before the quota is even consulted. Both are real, they are simply different limits — and substrate enforces neither.

What substrate does

addTagsToStream (kinesis_plugin.go) merges whatever it is given. A request with 300 tags succeeds, and ListTagsForStream then answers an array longer than its own published maximum — substrate emitting a response its own reference says cannot exist.

The decision this needs, before any code

Which limit substrate enforces is a judgement, not a lookup, and it should be settled on the issue rather than in a diff:

  • 200, the shape maximum. Refusing at 201 is defensible from the request shape alone, and a shape violation is the kind of thing an emulator is unambiguously entitled to refuse.
  • 50, the service quota. This is what a real account does, and it is the limit a consumer's error handling would have been written against. AWS publishes LimitExceededException/400 on API_AddTagsToStream — "the requested resource exceeds the maximum number allowed" — which is exactly the shape of a quota refusal.
  • Both, at different codes. 201 tags in one request is a shape violation; 51 tags accumulated across two accepted requests is a quota violation. These are distinguishable states and a consumer testing its retry path may care which it hit.

Note that the quota is a property of the stream, not of the request, so it must be checked against the merged result rather than against len(input.Tags) — two requests of 30 tags each must be refused on the second. #954's cursor work means the stored tag set is already read in this handler, so the count is available.

Substrate models no tag quota for any service today (SSM is noted the same way in docs/services.md), so whatever is decided here is the precedent for the rest.

Acceptance criteria

Activity

  1. added this to the v0.118.0 milestone on Sep 17, 2026
  2. added
    type: bug
    on Sep 17, 2026
  3. added a commit that references this issue on Sep 18, 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

    type: bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions