Skip to content

Get Policy

iam_get_policy R Documentation

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

Description

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 list_entities_for_policy. This operation returns metadata about the policy. To retrieve the actual policy document for a specific version of the policy, use get_policy_version.

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 get_user_policy, get_group_policy, or get_role_policy.

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

Usage

iam_get_policy(PolicyArn)

Arguments

PolicyArn

[required] The Amazon Resource Name (ARN) of the managed policy that you want information about.

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

Value

A list with the following syntax:

list(
  Policy = list(
    PolicyName = "string",
    PolicyId = "string",
    Arn = "string",
    Path = "string",
    DefaultVersionId = "string",
    AttachmentCount = 123,
    PermissionsBoundaryUsageCount = 123,
    IsAttachable = TRUE|FALSE,
    Description = "string",
    CreateDate = as.POSIXct(
      "2015-01-01"
    ),
    UpdateDate = as.POSIXct(
      "2015-01-01"
    ),
    Tags = list(
      list(
        Key = "string",
        Value = "string"
      )
    )
  )
)

Request syntax

svc$get_policy(
  PolicyArn = "string"
)