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

Description

Lists one specific policy or all the policies attached to the specified group. If no policies are attached to the group, the action still succeeds. You can paginate the results using the MaxItems and Marker options.

Syntax

iam-grouplistpolicies -g GROUPNAME [-p POLICYNAME] [-v]

Options

Name Description Required

-g GROUPNAME

Name of the group the policy is attached to.

Type: String

Default: None

Yes

-p POLICYNAME

Name of the policy document to display.

Type: String

Default: None

No

-v

Displays the contents of the resulting policies (in addition to the policy names).

Type: String

No

-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 contains the contents of the specific policy you requested, or it contains the names of the policies attached to the specified group (and optionally the contents of each).

Examples

The following example request displays the policy named AdminRoot, which is attached to the group named Admins.

PROMPT> iam-grouplistpolicies -g Admins -p AdminRoot -v
{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Action":["*"],"Resource":["*"]}]}

The following example request displays the names of all the policies attached to the group named Managers. You could optionally have the output display the contents of the policies by including the -v option.

PROMPT> iam-grouplistpolicies -g Managers
KeyPolicy
AnotherManagerGroupPolicy