AWS Identity and Access Management
CLI 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...

iam-instanceprofilelistforrole

Description

Lists all the instance profiles associated with a given role. You can paginate the results using the MaxItems and Marker options.

For more information about instance profiles, see About Instance Profiles in Using AWS Identity and Access Management. Working with roles is described in Working with Roles.

Syntax

iam-instanceprofilelistforroles -r ROLENAME

Options

Name Description Required

-r ROLENAME

The role that you want to list the associated instance profiles for.

Type: String

Yes

-i MAXITEMS

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

Type: String

Default: None

No

-m MARKER

Use this 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

Default: None

No

Output

The output lists the Amazon Resource Names (ARNs) for the instance profiles that are associated with the specified role. For more information about ARNs, go to ARNs in Using AWS Identity and Access Management.

Example

The following example lists all the instance profiles associated with the role myrole.

PROMPT> iam-instanceprofilelistforrole -r myrole 
arn:aws:iam::123456789012:instance-profile/division_abc/subdivision_xyz/myinstanceprofile
IsTruncated: false