You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
EC2: the 50-tag-per-resource limit is unmodelled (TagLimitExceeded never fires) #469
TagLimitExceeded appears nowhere in emulator/. Substrate accepts an unbounded number of tags per resource; real EC2 caps it at 50 user tags.
#452 asked that reserved aws: tags not count against the limit. That is vacuously true today because the limit does not exist, which is why #452 shipped without it rather than claiming the exemption works.
The subtle half
Two rules have to land together or the model is wrong in a new way:
Overwriting an existing key at the limit still succeeds. Real AWS permits updating the value of a key already present on a resource that has 50 tags (reported at EC2 CreateTags throws TagLimitExceeded while updating existing tags getmoto/moto#8151). A check written as len(existing) + len(new) > 50 rejects that; it has to count the post-merge key set.
Acceptance criteria
A 51st user tag on CreateTags returns TagLimitExceeded with the real code, message and HTTP status — captured or corroborated, and its provenance stated plainly if it is not from the API model
Shipped in v0.86.0 (#485). One note on provenance, because it differs from #452's in a
way worth recording.
TagLimitExceeded is a documented code. EC2's client-error table lists it as "You've
reached the limit on the number of tags that you can assign to the specified resource."
That is a stronger claim than #452's reserved-key rejection, whose code came from
observed responses rather than the reference. Only the wire message here is weaker:
it is published nowhere, so substrate emits moto's string (The maximum number of Tags for a resource has been reached.) and the code comment says it comes from a
reimplementation rather than a captured response. Since SDKs dispatch on Error.Code,
the documented half is the half a consumer's error branch turns on.
Both of this issue's rules turned out to be one expression rather than two checks —
the count is over the post-merge key set, excluding aws:-prefixed keys:
aws: tags being exempt is load-bearing rather than pedantry. Substrate stamps aws:ec2:fleet-id on every fleet instance (EC2: CreateFleet does not apply the aws:ec2:fleet-id tag, so a fleet's instances can't be found #443), so a counter that included reserved
keys would refuse a fleet launch whose template names the full 50 user tags — a launch
real EC2 accepts. A fleet instance legally holds 51 tags.
Activity
test(ec2): cover the tag limit on every taggable resource type (#469)
fix(ec2): carry a launch template's tags and instance profile to the …
scttfrdmn commentedon Aug 2, 2026
Shipped in v0.86.0 (#485). One note on provenance, because it differs from #452's in a
way worth recording.
TagLimitExceededis a documented code. EC2's client-error table lists it as "You'vereached the limit on the number of tags that you can assign to the specified resource."
That is a stronger claim than #452's reserved-key rejection, whose code came from
observed responses rather than the reference. Only the wire message here is weaker:
it is published nowhere, so substrate emits moto's string (
The maximum number of Tags for a resource has been reached.) and the code comment says it comes from areimplementation rather than a captured response. Since SDKs dispatch on
Error.Code,the documented half is the half a consumer's error branch turns on.
Both of this issue's rules turned out to be one expression rather than two checks —
the count is over the post-merge key set, excluding
aws:-prefixed keys:aws:tags being exempt is load-bearing rather than pedantry. Substrate stampsaws:ec2:fleet-idon every fleet instance (EC2: CreateFleet does not apply the aws:ec2:fleet-id tag, so a fleet's instances can't be found #443), so a counter that included reservedkeys would refuse a fleet launch whose template names the full 50 user tags — a launch
real EC2 accepts. A fleet instance legally holds 51 tags.
nothing to the union. Written as
len(existing) + len(incoming)it would fail, andEC2 CreateTags throws TagLimitExceeded while updating existing tags getmoto/moto#8151 reports real AWS permitting it.
Both are mutation-tested: counting as the sum, and dropping the
aws:exemption, eachfail tests deliberately written to catch them.
This also closed a gap v0.85.0 had recorded as vacuous — the reserved-tag exemption now
has a limit to be exempt from.
Two restrictions from the same table remain unenforced, a key's 128-character maximum and
a value's 256: #490.
feat(ec2): enforce the documented tag key and value length limits (#490…