Skip to main content

IAM Get Policy

Retrieves information about the specified managed policy, including the policy's default version and the total number of IAM users, groups, and roles to which the policy is attached. To retrieve the list of the specific users, groups, and roles that the policy is attached to, use ListEntitiesForPolicy. This operation returns metadata about the policy. To retrieve the actual policy document for a specific version of the policy, use GetPolicyVersion.

This operation retrieves information about managed policies. To retrieve information about an inline policy that is embedded with an IAM user, group, or role, use GetUserPolicy, GetGroupPolicy, or GetRolePolicy.

For more information about policies, see Managed policies and inline policies in the IAM User Guide.

External Documentation

To learn more, visit the AWS documentation.

Basic Parameters

ParameterDescription
AWS Region(s)Enter the desired AWS Region(s).

To execute the action in multiple regions, provide a comma-separated list.
For example: us-east-1,eu-west-2.

If you wish to run the action in all available regions, use the asterisk symbol (*) instead.
Policy ARNThe Amazon Resource Name (ARN). ARNs are unique identifiers for Amazon Web Services resources.

For more information about ARNs, go to Amazon Resource Names (ARNs) in the Amazon Web Services General Reference.

Advanced Parameters

ParameterDescription
Disable XML To JSON Auto ConvertWhen checked, XML responses are not automatically converted into JSON format.

Example Output

{
"Policy": {
"Arn": "\u003cp\u003eThe Amazon Resource Name (ARN). ARNs are unique identifiers for Amazon Web Services resources.\u003c/p\u003e \u003cp\u003eFor more information about ARNs, go to \u003ca href=\"https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html\"\u003eAmazon Resource Names (ARNs)\u003c/a\u003e in the \u003ci\u003eAmazon Web Services General Reference\u003c/i\u003e. \u003c/p\u003e",
"AttachmentCount": 0,
"CreateDate": "date-time",
"DefaultVersionId": "v[1-9][0-9]*(\\.[A-Za-z0-9-]*)?",
"Description": "string",
"IsAttachable": false,
"Path": "((/[A-Za-z0-9\\.,\\+@=_-]+)*)/",
"PermissionsBoundaryUsageCount": 0,
"PolicyId": "[\\w]+",
"PolicyName": "[\\w+=,.@-]+",
"Tags": [
{
"Key": "[\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]+",
"Value": "[\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*"
}
],
"UpdateDate": "date-time"
}
}

Automation Library Example

Iam Get Policy with Aws and Send Results Via Email

Automation LibraryPreview this Automation on desktop