Use ListGroupPolicies with an Amazon SDK or command line tool - Amazon Identity and Access Management
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Use ListGroupPolicies with an Amazon SDK or command line tool

The following code examples show how to use ListGroupPolicies.

CLI
Amazon CLI

To list all inline policies that are attached to the specified group

The following list-group-policies command lists the names of inline policies that are attached to the IAM group named Admins in the current account.

aws iam list-group-policies \ --group-name Admins

Output:

{ "PolicyNames": [ "AdminRoot", "ExamplePolicy" ] }

For more information, see Managing IAM policies in the Amazon IAM User Guide.

PowerShell
Tools for PowerShell

Example 1: This example returns a list of the inline policies that are embedded in the group Testers. To get the managed policies that are attached to the group, use the command Get-IAMAttachedGroupPolicyList.

Get-IAMGroupPolicyList -GroupName Testers

Output:

Deny-Assume-S3-Role-In-Production PowerUserAccess-Testers
  • For API details, see ListGroupPolicies in Amazon Tools for PowerShell Cmdlet Reference.

For a complete list of Amazon SDK developer guides and code examples, see Using IAM with an Amazon SDK. This topic also includes information about getting started and details about previous SDK versions.