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-rolegetattributes

Description

Returns the Amazon Resource Name (ARN), the IDID, and the assume policy for the specified role. For more information about ARNs, go to ARNs in Using IAM.

Syntax

iam-rolegetattributes -r ROLENAME

Options

Name Description Required

-r ROLENAME

Name of the role you want to get information about.

Type: String

Default: None

Yes

Output

The output lists the role's Amazon Resource Name (ARN), ID, and the associated assume policy.

Examples

The following example returns output for a role named myrole. The first line is the ARN, the second line is the role ID, and the last line is the policy that grants permission to Amazon EC2 to assume the role.

PROMPT> iam-rolegetattributes -r myrole
arn:aws:iam::123456789012:role/myrole
AROAJYXWUP72XVEXAMPLE
{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"Service":["ec2.amazonaws.com"]},"Action":["sts:AssumeRole"]}]}