Skip to content
IAM Policy Generator

IAM policy example: read one DynamoDB table, with a least privilege rewrite

Allows a principal to read items from one DynamoDB table, Orders, and its indexes. The original reads every table with the Get, BatchGet, Describe and List wildcards plus Query and Scan. The rewrite names one table, three read actions and drops Scan.

Open the workbench ยท All examples

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "ReadTables",
      "Effect": "Allow",
      "Action": [
        "dynamodb:Get*",
        "dynamodb:Query",
        "dynamodb:Scan",
        "dynamodb:BatchGet*",
        "dynamodb:Describe*",
        "dynamodb:List*"
      ],
      "Resource": "*"
    }
  ]
}

What it allows

  • Allows reading items, listing and describing every table in every Region.

What it allows

  1. Allow 34 actions (dynamodb:Get*, dynamodb:Query, dynamodb:Scan, dynamodb:BatchGet*, dynamodb:Describe*, dynamodb:List*) on every resource.

    Action or patternActionsAccess levels
    dynamodb:Get*5Read 5
    dynamodb:Query1Read 1
    dynamodb:Scan1Read 1
    dynamodb:BatchGet*1Read 1
    dynamodb:Describe*17Read 17
    dynamodb:List*9List 7, Read 2

Checks

No flags from the six checks.

The wildcards expand to 5, 1, 17 and 9 actions on all tables.

Least privilege rewrite

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "ReadOrders",
      "Effect": "Allow",
      "Action": [
        "dynamodb:GetItem",
        "dynamodb:BatchGetItem",
        "dynamodb:Query"
      ],
      "Resource": [
        "arn:aws:dynamodb:us-east-1:111122223333:table/Orders",
        "arn:aws:dynamodb:us-east-1:111122223333:table/Orders/index/*"
      ]
    }
  ]
}

The rewrite names one table and its indexes and drops Scan, which reads the entire table.

What it allows

  1. Allow 3 actions (dynamodb:GetItem, dynamodb:BatchGetItem, dynamodb:Query) on arn:aws:dynamodb:us-east-1:111122223333:table/Orders, arn:aws:dynamodb:us-east-1:111122223333:table/Orders/index/*.

    Action or patternActionsAccess levels
    dynamodb:GetItem1Read 1
    dynamodb:BatchGetItem1Read 1
    dynamodb:Query1Read 1

Checks

No flags from the six checks.

Sources

  1. Amazon DynamoDB Developer Guide: identity-based policies, read 16 Nov 2026
  2. AWS Service Authorization Reference, programmatic access (fetched 16 Nov 2026), read 16 Nov 2026

Last reviewed 16 Nov 2026.