list-attached-group-policies¶
Lists all managed policies that are attached to the specified IAM group.
An IAM group can also have inline policies embedded with it. To list the inline policies for a group, use list-group-policies. Refer to Managed policies and inline policies for more information.
Paginate the results using the MaxItems and Marker parameters.
Use the PathPrefix parameter to limit the list of policies to only
those matching the specified path prefix. If there are no policies attached
to the specified group (or none that matches the specified path prefix),
the operation returns an empty list.
Refer to AWS API Documentation and aws help for more information on global parameters.
list-attached-group-policies is a paginated operation. Multiple API calls can be issued
to retrieve the entire data set of results. Disable pagination by providing the
--no-paginate argument. When using --output text and the --query argument
on a paginated response, the --query argument must extract data from the results of the
query expression AttachedPolicies.
Synopsis¶
list-attached-group-policies
--group-name <value>
[--path-prefix <value>]
[--max-items <value>]
[--starting-token <value>]
[--page-size <value>]
Options¶
--group-name (string)
The name of the group to list attached policies for. This parameter allows (through its regex pattern) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include the characters
_+=,.@-.
--path-prefix (string)
The prefix of the path to filter the results. This parameter is optional. If it is not included, it defaults to a slash
/, listing all policies.This parameter allows (through its regex pattern) a string of characters consisting of either a forward slash
/by itself or a string that must begin and end with forward slashes. In can also contain any ASCII character from the exclamation mark\u0021, through the DEL character\u007F, including most punctuation characters, digits, and upper and lowercase letters.
--max-items (integer)
The total number of items to return in the command’s output. If the total number of items available is more than the value specified, a
NextTokenis provided in the command’s output. To resume pagination, provide theNextTokenvalue in thestarting-tokenargument of a subsequent command. Do not use theNextTokenresponse element directly outside of the AWS CLI.For usage examples, refer to the Pagination documentation.
--starting-token (string)
A token to specify where to start paginating. This is the
NextTokenfrom a previously truncated response.For usage examples, refer to the Pagination documentation.
--page-size (integer)
The size of each page to get in the AWS service call. This does not affect the number of items returned in the command’s output. Setting a smaller page size results in more calls to the AWS service, retrieving fewer items in each call. This can help prevent the AWS service calls from timing out.
For usage examples, refer to the Pagination documentation.
Examples¶
To list all managed policies that are attached to the specified group
This example returns the names and ARNs of the managed policies that are attached
to the IAM group named Admins in the AWS account.
aws iam list-attached-group-policies --group-name Admins
Output example:
{
"AttachedPolicies": [
{
"PolicyName": "AdministratorAccess",
"PolicyArn": "arn:aws:iam::aws:policy/AdministratorAccess"
},
{
"PolicyName": "SecurityAudit",
"PolicyArn": "arn:aws:iam::aws:policy/SecurityAudit"
}
],
"IsTruncated": false
}
Refer to Overview of IAM Policies for more information.
Output¶
AttachedPolicies -> (list)
A list of the attached policies.
(structure)
Contains information about an attached policy.
An attached policy is a managed policy that has been attached to a user, group, or role. This data type is used as a response element in the ListAttachedGroupPolicies, ListAttachedRolePolicies, ListAttachedUserPolicies, and GetAccountAuthorizationDetails operations.
Refer to Managed policies and inline policies for more information.
PolicyName -> (string)
The name of the attached policy.
PolicyArn -> (string)
The Amazon Resource Name (ARN). ARNs are unique identifiers for Amazon Web Services resources.
Refer to Amazon Resource Names (ARNs) for more information.
IsTruncated -> (boolean)
A flag that indicates if there are more items to return. If your results were truncated, you can make a subsequent pagination request using the
Markerrequest parameter to retrieve more items.Note
IAM can return fewer than the
MaxItemsnumber of results even when there are more results available. It is recommended that you checkIsTruncatedafter each call to ensure that you receive all your results.
Marker -> (string)
When
IsTruncatedis true, this element is present and contains the value to use for theMarkerparameter in a subsequent pagination request.

