Jump to Content

This API Documentation is now deprecated

We are excited to announce our new API Documentation.

Class ListRoleTagsCommandProtected

Lists the tags that are attached to the specified role. The returned list of tags is sorted by tag key. For more information about tagging, see Tagging IAM resources in the IAM User Guide.

Example

Use a bare-bones client and the command you need to make an API call.

import { IAMClient, ListRoleTagsCommand } from "@aws-sdk/client-iam"; // ES Modules import
// const { IAMClient, ListRoleTagsCommand } = require("@aws-sdk/client-iam"); // CommonJS import
const client = new IAMClient(config);
const input = { // ListRoleTagsRequest
RoleName: "STRING_VALUE", // required
Marker: "STRING_VALUE",
MaxItems: Number("int"),
};
const command = new ListRoleTagsCommand(input);
const response = await client.send(command);
// { // ListRoleTagsResponse
// Tags: [ // tagListType // required
// { // Tag
// Key: "STRING_VALUE", // required
// Value: "STRING_VALUE", // required
// },
// ],
// IsTruncated: true || false,
// Marker: "STRING_VALUE",
// };

Param

ListRoleTagsCommandInput

Returns

ListRoleTagsCommandOutput

See

Throws

NoSuchEntityException (client fault)

The request was rejected because it referenced a resource entity that does not exist. The error message describes the resource.

Throws

ServiceFailureException (server fault)

The request processing has failed because of an unknown error, exception or failure.

Throws

IAMServiceException

Base exception class for all service exceptions from IAM service.

Example

To list the tags attached to an IAM role

// The following example shows how to list the tags attached to a role.
const input = {
"RoleName": "taggedrole1"
};
const command = new ListRoleTagsCommand(input);
const response = await client.send(command);
/* response ==
{
"IsTruncated": false,
"Tags": [
{
"Key": "Dept",
"Value": "12345"
},
{
"Key": "Team",
"Value": "Accounting"
}
]
}
*/
// example id: to-list-the-tags-attached-to-an-iam-role-1506719238376

Hierarchy

Constructors

Properties

Methods

Constructors

Properties

Methods