list-user-tags¶
Lists the tags that are attached to the specified IAM user. The returned list of tags is sorted by tag key.
Refer to AWS help for more information.
Note
The requester must have iam:ListUserTags permissions on the target users.
Synopsis¶
list-user-tags
--user-name <value>
[--max-items <value>]
[--starting-token <value>]
Options¶
--user-name (string)
The name of the IAM user to which you want to add tags.
This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters:
_,+,=,,,.,@, and-.
----max-items (integer)
The total number of items to return in the command’s output. If the total number of items available is more than the value specified, a
NextTokenis provided in the output. To resume pagination, provide theNextTokenvalue in thestarting-tokenargument of a subsequent command.Refer to Pagination in the AWS Command Line Interface User Guide for examples.
--starting-token (string)
A token to specify where to start paginating. This is the
NextTokenfrom a previously truncated response.Refer to Pagination in the AWS Command Line Interface User Guide for examples.
Examples¶
To list the tags of an IAM user
The following list-user-tags command retrieves the list of tags associated
with the IAM user named Alice.
aws iam list-user-tags --user-name Alice
Output example:
{
"Tags": [
{
"Key": "Department",
"Value": "Accounting"
},
{
"Key": "Cost Center",
"Value": "005"
}
],
"IsTruncated": false
}
Output¶
Tags -> (list)
The list of tags that are currently attached to the user. Each tag consists of a key name and an associated value. If no tags are attached to the specified user, the response contains an empty list.
(structure)
A structure that represents user-provided metadata that can be associated with an IAM user. Refer to Manage User Tags for more information about tagging.
Key-> (string)The key name that can be used to look up or retrieve the associated value, such as
DepartmentorCost Center.
Value-> (string)The value associated with this tag. For example, tags with a key name of
Departmentcould have values such asHuman ResourcesorAccounting. Typically, many resources have tags with the same key name but different values.
IsTruncated -> (boolean)
A flag that indicates whether there are more items to return. If your results
were truncated, you can make a subsequent pagination request using
the Marker request parameter to retrieve more items.
Note
IAM might return fewer than the MaxItems number of results even when
there are more results available. We recommend that you check IsTruncated
after every call to ensure that you receive all your results.
Marker -> (string)
When IsTruncated is true , this element is present and contains the value
to use for the Marker parameter in a subsequent pagination request.

