Repository navigation
Description
IAM tags are stored but never rendered. TagUser/TagRole merge them onto the entity record
(emulator/iam_plugin.go:2197-2219, :2345-2401) and IAMUser.Tags/IAMRole.Tags persist them
(emulator/iam_types.go:19-42), but no read operation reports them:
iamUserXMLFields(emulator/iam_xml.go:76-98) emits no<Tags>memberiamRoleXMLFields(emulator/iam_xml.go:117-176) emits no<Tags>member
So GetUser, GetRole, ListUsers, ListRoles, CreateUser and CreateRole all report a user
or role with no tags, where AWS publishes a Tags member on every one of those responses. The
tags are readable only through ListUserTags/ListRoleTags, which are the two operations that
already call iamTagListXML (emulator/iam_xml.go:347) — so the renderer exists and is simply not
reached from the entity shapes.
The observable consequence is a consumer that tags a role at create time and then reads the role
back: CreateRole accepts and stores Tags.member.N (#639 fixed the wire decoding), and GetRole
answers as though it had stored nothing. A CDK or Terraform run that reconciles what it asked for
against what it reads back sees a permanent drift.
Two adjacent gaps in the same area, worth deciding in the same piece of work rather than separately:
IAMGroup(iam_types.go:46-52) andIAMPolicy(iam_types.go:55-67) have noTagsfield at
all, so there is nowhere for a policy's or group's tags to go.TagPolicy,UntagPolicy,ListPolicyTags,TagInstanceProfile,UntagInstanceProfileand
ListInstanceProfileTagsare not implemented — absent from theHandleRequestswitch
(iam_plugin.go:54-212).
Found while surveying the IAM authorization door for #770; deliberately not folded into that
release, which is about the resource an IAM request is authorized against rather than what the
response reports.
Acceptance criteria
-
GetUser,GetRole,ListUsers,ListRoles,CreateUserandCreateRolereport aTags
member, in the shape the IAM API reference documents for each response - A tag set through
TagUser/TagRoleis visible through the entity read, not only through
ListUserTags/ListRoleTags— asserted end to end rather than at the renderer - An untagged entity reports what AWS reports for one (an absent member, not an empty list) —
cited, since the two are different on the wire - Whether
IAMGroup/IAMPolicygain aTagsfield, and whether the six unimplemented
tagging operations are in scope, is decided in this issue rather than left implicit -
docs/services.md's IAM section states what carries tags and what does not
Activity
scttfrdmn commentedon Sep 11, 2026
Planned for v0.112.0. The fourth criterion — decide what is in scope rather than leaving it implicit
— is settled here, against the API reference and the User Guide.
What gets a
Tagsmember on a readGetUser,CreateUser,GetRole,CreateRole,CreateServiceLinkedRole,GetPolicy,CreatePolicy,GetInstanceProfile,CreateInstanceProfile— omitted entirely when the entityhas no tags.
Tagsis documentedRequired: NoonAPI_User,API_Role,API_PolicyandAPI_InstanceProfile; every reference sample response for an untagged entity omits the element; andCreateInstanceProfile's sample proves omission is deliberate rather than sample-trimming byrendering its required empty list as
<Roles/>while carrying no<Tags>at all. So substratemust not emit
<Tags></Tags>here — which meansiamTagListXML(emulator/iam_xml.go:347), whosewrapper is unconditional, stays as it is for
ListUserTags/ListRoleTags(whereTagsis arequired response element) and is guarded at the entity-shape call sites.
What does not — and this corrects the issue text above
The list shapes must not report tags. AWS says so on the operation pages, verbatim
(https://docs.aws.amazon.com/IAM/latest/APIReference/API_ListRoles.html; the same note appears on
ListUsers,ListPoliciesandListInstanceProfiles):So the first criterion's inclusion of
ListUsersandListRolesis wrong and will not beimplemented: those two report no tags, deliberately, and a test asserts it with the note quoted.
GetGroup's nestedUserslist and the roles nested inside instance-profile shapes(
iamRoleMembersXML,iam_xml.go:393) are excluded on the same grounds.This forces the real shape of the work:
iamUserXMLFieldsandiamRoleXMLFieldsare each shared bya single-entity shape and a listing shape, so they must be split rather than extended.
IAMGroupandIAMPolicyIAMPolicygainsTags, and so doesIAMInstanceProfile. Both data types document themember, both creates accept
Tags.member.N, andauthz_reference_gen.go:1476-1537alreadypublishes
iam:TagPolicy/UntagPolicy/ListPolicyTagsand the three instance-profileequivalents with the right resource types.
IAMGroupgains nothing. Four independent citations: AWS'sGroupdata type documents noTagsmember; the Actions index contains noTagGroup,UntagGrouporListGroupTags; thevendored Service Reference snapshot publishes no
iam:*Grouptagging action (so a table row forone would fail iam: authorize against the resource a request names, not arn:aws:iam::<acct>:* #770's every-row-matches-what-AWS-publishes test); and the User Guide is explicit
(https://docs.aws.amazon.com/IAM/latest/UserGuide/id_tags.html): "You can tag most IAM resources,
but not groups, assumed roles, access reports, or hardware-based MFA devices."
The six unimplemented operations
In scope:
TagPolicy,UntagPolicy,ListPolicyTags,TagInstanceProfile,UntagInstanceProfile,ListInstanceProfileTags— as parallels of the existing user/role handlers,plus
Tags.member.Ndecoding onCreatePolicyandCreateInstanceProfileand sixiamAuthzOperationResourcerows.Out of scope, with reasons:
TagGroup/UntagGroup/ListGroupTagsdo not exist; andTagMFADevice,TagSAMLProvider,TagOpenIDConnectProvider,TagServerCertificateand theirpartners have nothing to tag, because those entities are not modelled at all.
Split out of this issue
Two adjacent findings are filed separately rather than folded in, because each turns a request
substrate accepts today into one it refuses (or removes a member a consumer reads today) and so earns
its own compatibility note:
aws:-prefix or empty-key rejection, andtagUser/tagRolecomparing keys case-sensitively where AWS documents user and role tag keys ascase-insensitive.
PermissionsBoundaryon the list shapes (excluded bythe note quoted above) and under-report
PasswordLastUsed,DescriptionandIsAttachable.fix(iam): an entity read reports its tags (#796) (#811)
feat(iam): the six tagging operations for policies and instance profi…