Note:

You are viewing the documentation for an older major version of the AWS CLI (version 1).

AWS CLI version 2, the latest major version of AWS CLI, is now stable and recommended for general use. To view this page for the AWS CLI version 2, click here. For more information see the AWS CLI version 2 installation instructions and migration guide.

[ aws . verifiedpermissions ]

get-policy

Description

Retrieves information about the specified policy.

See also: AWS API Documentation

Synopsis

  get-policy
--policy-store-id <value>
--policy-id <value>
[--cli-input-json <value>]
[--generate-cli-skeleton <value>]
[--debug]
[--endpoint-url <value>]
[--no-verify-ssl]
[--no-paginate]
[--output <value>]
[--query <value>]
[--profile <value>]
[--region <value>]
[--version <value>]
[--color <value>]
[--no-sign-request]
[--ca-bundle <value>]
[--cli-read-timeout <value>]
[--cli-connect-timeout <value>]

Options

--policy-store-id (string)

Specifies the ID of the policy store that contains the policy that you want information about.

--policy-id (string)

Specifies the ID of the policy you want information about.

--cli-input-json (string) Performs service operation based on the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, the CLI values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

Global Options

--debug (boolean)

Turn on debug logging.

--endpoint-url (string)

Override command's default URL with the given URL.

--no-verify-ssl (boolean)

By default, the AWS CLI uses SSL when communicating with AWS services. For each SSL connection, the AWS CLI will verify SSL certificates. This option overrides the default behavior of verifying SSL certificates.

--no-paginate (boolean)

Disable automatic pagination.

--output (string)

The formatting style for command output.

  • json
  • text
  • table

--query (string)

A JMESPath query to use in filtering the response data.

--profile (string)

Use a specific profile from your credential file.

--region (string)

The region to use. Overrides config/env settings.

--version (string)

Display the version of this tool.

--color (string)

Turn on/off color output.

  • on
  • off
  • auto

--no-sign-request (boolean)

Do not sign requests. Credentials will not be loaded if this argument is provided.

--ca-bundle (string)

The CA certificate bundle to use when verifying SSL certificates. Overrides config/env settings.

--cli-read-timeout (int)

The maximum socket read time in seconds. If the value is set to 0, the socket read will be blocking and not timeout. The default value is 60 seconds.

--cli-connect-timeout (int)

The maximum socket connect time in seconds. If the value is set to 0, the socket connect will be blocking and not timeout. The default value is 60 seconds.

Examples

Note

To use the following examples, you must have the AWS CLI installed and configured. See the Getting started guide in the AWS CLI User Guide for more information.

Unless otherwise stated, all examples have unix-like quotation rules. These examples will need to be adapted to your terminal's quoting rules. See Using quotation marks with strings in the AWS CLI User Guide .

To retrieve details about a policy

The following get-policy example displays the details for the policy with the specified ID.

aws verifiedpermissions get-policy \
    --policy-id PSEXAMPLEabcdefg111111 \
    --policy-store-id PSEXAMPLEabcdefg111111

Output:

{
    "createdDate": "2023-06-12T20:33:37.382907+00:00",
    "definition": {
        "static": {
            "description": "Grant everyone of janeFriends UserGroup access to the vacationFolder Album",
            "statement": "permit(principal in UserGroup::\"janeFriends\", action, resource in Album::\"vacationFolder\" );"
        }
    },
    "lastUpdatedDate": "2023-06-12T20:33:37.382907+00:00",
    "policyId": "SPEXAMPLEabcdefg111111",
    "policyStoreId": "PSEXAMPLEabcdefg111111",
    "policyType": "STATIC",
    "principal": {
        "entityId": "janeFriends",
        "entityType": "UserGroup"
    },
    "resource": {
        "entityId": "vacationFolder",
        "entityType": "Album"
    }
}

For more information about policies, see Amazon Verified Permissions policies in the Amazon Verified Permissions User Guide.

Output

policyStoreId -> (string)

The ID of the policy store that contains the policy that you want information about.

policyId -> (string)

The unique ID of the policy that you want information about.

policyType -> (string)

The type of the policy.

principal -> (structure)

The principal specified in the policy's scope. This element isn't included in the response when Principal isn't present in the policy content.

entityType -> (string)

The type of an entity.

Example: "entityType":"*typeName* "

entityId -> (string)

The identifier of an entity.

"entityId":"*identifier* "

resource -> (structure)

The resource specified in the policy's scope. This element isn't included in the response when Resource isn't present in the policy content.

entityType -> (string)

The type of an entity.

Example: "entityType":"*typeName* "

entityId -> (string)

The identifier of an entity.

"entityId":"*identifier* "

actions -> (list)

The action that a policy permits or forbids. For example, {"actions": [{"actionId": "ViewPhoto", "actionType": "PhotoFlash::Action"}, {"entityID": "SharePhoto", "entityType": "PhotoFlash::Action"}]} .

(structure)

Contains information about an action for a request for which an authorization decision is made.

This data type is used as a request parameter to the IsAuthorized , BatchIsAuthorized , and IsAuthorizedWithToken operations.

Example: { "actionId": "<action name>", "actionType": "Action" }

actionType -> (string)

The type of an action.

actionId -> (string)

The ID of an action.

definition -> (tagged union structure)

The definition of the requested policy.

Note

This is a Tagged Union structure. Only one of the following top level keys can be set: static, templateLinked.

static -> (structure)

Information about a static policy that wasn't created with a policy template.

description -> (string)

A description of the static policy.

statement -> (string)

The content of the static policy written in the Cedar policy language.

templateLinked -> (structure)

Information about a template-linked policy that was created by instantiating a policy template.

policyTemplateId -> (string)

The unique identifier of the policy template used to create this policy.

principal -> (structure)

The principal associated with this template-linked policy. Verified Permissions substitutes this principal for the ?principal placeholder in the policy template when it evaluates an authorization request.

entityType -> (string)

The type of an entity.

Example: "entityType":"*typeName* "

entityId -> (string)

The identifier of an entity.

"entityId":"*identifier* "

resource -> (structure)

The resource associated with this template-linked policy. Verified Permissions substitutes this resource for the ?resource placeholder in the policy template when it evaluates an authorization request.

entityType -> (string)

The type of an entity.

Example: "entityType":"*typeName* "

entityId -> (string)

The identifier of an entity.

"entityId":"*identifier* "

createdDate -> (timestamp)

The date and time that the policy was originally created.

lastUpdatedDate -> (timestamp)

The date and time that the policy was last updated.

effect -> (string)

The effect of the decision that a policy returns to an authorization request. For example, "effect": "Permit" .