The following code examples show how to use GetGroupPolicy
.
- AWS CLI
-
To get information about a policy attached to an IAM group
The following
get-group-policy
command gets information about the specified policy attached to the group namedTest-Group
.aws iam get-group-policy \ --group-name
Test-Group
\ --policy-nameS3-ReadOnly-Policy
Output:
{ "GroupName": "Test-Group", "PolicyDocument": { "Statement": [ { "Action": [ "s3:Get*", "s3:List*" ], "Resource": "*", "Effect": "Allow" } ] }, "PolicyName": "S3-ReadOnly-Policy" }
For more information, see Managing IAM policies in the AWS IAM User Guide.
-
For API details, see GetGroupPolicy
in AWS CLI Command Reference.
-
For a complete list of AWS SDK developer guides and code examples, see Using this service with an AWS SDK. This topic also includes information about getting started and details about previous SDK versions.