Jump to Content

Class ListRolesCommandProtected

Lists the IAM roles that have the specified path prefix. If there are none, the operation returns an empty list. For more information about roles, see Working with roles.

IAM resource-listing operations return a subset of the available attributes for the resource. For example, this operation does not return tags, even though they are an attribute of the returned object. To view all of the information for a role, see GetRole.

You can paginate the results using the MaxItems and Marker parameters.

Example

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

import { IAMClient, ListRolesCommand } from "@aws-sdk/client-iam"; // ES Modules import
// const { IAMClient, ListRolesCommand } = require("@aws-sdk/client-iam"); // CommonJS import
const client = new IAMClient(config);
const command = new ListRolesCommand(input);
const response = await client.send(command);

Param

ListRolesCommandInput

Returns

ListRolesCommandOutput

See

Throws

ServiceFailureException (server fault)

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

Hierarchy

Constructors

Properties

middlewareStack: MiddlewareStack<ListRolesCommandInput, ListRolesCommandOutput>

Methods