Skip to content

Get Policy Version

iam_get_policy_version R Documentation

Retrieves information about the specified version of the specified managed policy, including the policy document

Description

Retrieves information about the specified version of the specified managed policy, including the policy document.

Policies returned by this operation are URL-encoded compliant with RFC 3986. You can use a URL decoding method to convert the policy back to plain JSON text. For example, if you use Java, you can use the decode method of the java.net.URLDecoder utility class in the Java SDK. Other languages and SDKs provide similar functionality.

To list the available versions for a policy, use list_policy_versions.

This operation retrieves information about managed policies. To retrieve information about an inline policy that is embedded in a user, group, or role, use get_user_policy, get_group_policy, or get_role_policy.

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

For more information about managed policy versions, see Versioning for managed policies in the IAM User Guide.

Usage

iam_get_policy_version(PolicyArn, VersionId)

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.

VersionId

[required] Identifies the policy version to retrieve.

This parameter allows (through its regex pattern) a string of characters that consists of the lowercase letter 'v' followed by one or two digits, and optionally followed by a period '.' and a string of letters and digits.

Value

A list with the following syntax:

list(
  PolicyVersion = list(
    Document = "string",
    VersionId = "string",
    IsDefaultVersion = TRUE|FALSE,
    CreateDate = as.POSIXct(
      "2015-01-01"
    )
  )
)

Request syntax

svc$get_policy_version(
  PolicyArn = "string",
  VersionId = "string"
)