Skip to content

Get Resource Policy

dynamodb_get_resource_policy R Documentation

Returns the resource-based policy document attached to the resource, which can be a table or stream, in JSON format

Description

Returns the resource-based policy document attached to the resource, which can be a table or stream, in JSON format.

get_resource_policy follows an eventually consistent model. The following list describes the outcomes when you issue the get_resource_policy request immediately after issuing another request:

  • If you issue a get_resource_policy request immediately after a put_resource_policy request, DynamoDB might return a PolicyNotFoundException.

  • If you issue a get_resource_policyrequest immediately after a delete_resource_policy request, DynamoDB might return the policy that was present before the deletion request.

  • If you issue a get_resource_policy request immediately after a create_table request, which includes a resource-based policy, DynamoDB might return a ResourceNotFoundException or a PolicyNotFoundException.

Because get_resource_policy uses an eventually consistent query, the metadata for your policy or table might not be available at that moment. Wait for a few seconds, and then retry the get_resource_policy request.

After a get_resource_policy request returns a policy created using the put_resource_policy request, the policy will be applied in the authorization of requests to the resource. Because this process is eventually consistent, it will take some time to apply the policy to all requests to a resource. Policies that you attach while creating a table using the create_table request will always be applied to all requests for that table.

Usage

dynamodb_get_resource_policy(ResourceArn)

Arguments

ResourceArn

[required] The Amazon Resource Name (ARN) of the DynamoDB resource to which the policy is attached. The resources you can specify include tables and streams.

Value

A list with the following syntax:

list(
  Policy = "string",
  RevisionId = "string"
)

Request syntax

svc$get_resource_policy(
  ResourceArn = "string"
)