AWS Identity and Access Management
API Reference (API Version 2010-05-08)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Did this page help you?  Yes | No |  Tell us about it...

ListRolePolicies

Description

Lists the names of the policies associated with the specified role. If there are none, the action returns an empty list.

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

Request Parameters

For information about the common parameters that all actions use, see Common Parameters.

Marker

Use this parameter only when paginating results, and only in a subsequent request after you've received a response where the results are truncated. Set it to the value of the Marker element in the response you just received.

Type: String

Length constraints: Minimum length of 1. Maximum length of 320.

Required: No

MaxItems

Use this parameter only when paginating results to indicate the maximum number of user names you want in the response. If there are additional user names beyond the maximum you specify, the IsTruncated response element is true. This parameter is optional. If you do not include it, it defaults to 100.

Type: Integer

Required: No

RoleName

The name of the role to list policies for.

Type: String

Length constraints: Minimum length of 1. Maximum length of 64.

Required: Yes

Response Elements

The following elements are returned in a ListRolePoliciesResult structure.

IsTruncated

A flag that indicates whether there are more policy names to list. If your results were truncated, you can make a subsequent pagination request using the Marker request parameter to retrieve more policy names in the list.

Type: Boolean

Marker

If IsTruncated is true, this element is present and contains the value to use for the Marker parameter in a subsequent pagination request.

Type: String

PolicyNames

A list of policy names.

Type: String list

Errors

For information about the errors that are common to all actions, see Common Errors.

NoSuchEntity

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

HTTP Status Code: 404

Examples

Sample Request

https://iam.amazonaws.com/
?Action=ListRolePolicies
&MaxItems=100
&RoleName=S3Access
&Version=2010-05-08
&AUTHPARAMS
      

Sample Response

<ListRolePoliciesResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
  <ListRolePoliciesResult>
    <PolicyNames>
      <member>CloudwatchPutMetricPolicy</member>
      <member>S3AccessPolicy</member>
    </PolicyNames>
    <IsTruncated>false</IsTruncated>
  </ListRolePoliciesResult>
  <ResponseMetadata>
    <RequestId>8c7e1816-99f0-11e1-a4c3-27EXAMPLE804</RequestId>
  </ResponseMetadata>
</ListRolePoliciesResponse>