Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions,
see Getting Started with Amazon Web Services in China
(PDF).
The following code examples show how to use ListUserTags
.
- CLI
-
- Amazon CLI
-
To list the tags attached to a user
The following list-user-tags
command retrieves the list of tags associated with the specified IAM user.
aws iam list-user-tags \
--user-name alice
Output:
{
"Tags": [
{
"Key": "Department",
"Value": "Accounting"
},
{
"Key": "DeptID",
"Value": "12345"
}
],
"IsTruncated": false
}
For more information, see Tagging IAM resources in the Amazon IAM User Guide.
- PowerShell
-
- Tools for PowerShell
-
Example 1: This example fetches the tag associated with the user.
Get-IAMUserTagList -UserName joe
For a complete list of Amazon SDK developer guides and code examples, see
Using IAM with an Amazon SDK.
This topic also includes information about getting started and details about previous SDK versions.