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

Facts read 16 Nov 2026. Page reviewed 16 Nov 2026.

Allows an application to put, update, delete and read items in the Orders table and its indexes. Table creation, deletion and settings changes are not allowed in the rewrite. The original uses dynamodb:* on the table, which includes DeleteTable. The names and the account ID 111122223333 are AWS documentation placeholders.

```json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "OrdersFull",
      "Effect": "Allow",
      "Action": "dynamodb:*",
      "Resource": "arn:aws:dynamodb:us-east-1:111122223333:table/Orders"
    }
  ]
}
```

## What it allows

- Allows every DynamoDB action on the Orders table.

- Allows 85 actions (dynamodb:*) on arn:aws:dynamodb:us-east-1:111122223333:table/Orders.

Checks:
- No flags.

The action dynamodb:* covers 85 actions, including deleting the table and changing its capacity and backups.

## Least privilege rewrite

```json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "OrdersItems",
      "Effect": "Allow",
      "Action": [
        "dynamodb:GetItem",
        "dynamodb:PutItem",
        "dynamodb:UpdateItem",
        "dynamodb:DeleteItem",
        "dynamodb:Query",
        "dynamodb:BatchWriteItem"
      ],
      "Resource": [
        "arn:aws:dynamodb:us-east-1:111122223333:table/Orders",
        "arn:aws:dynamodb:us-east-1:111122223333:table/Orders/index/*"
      ]
    }
  ]
}
```

The rewrite lists six item-level actions on the table and its indexes. Table deletion, capacity changes and backups are removed.

- Allows 6 actions (dynamodb:GetItem, dynamodb:PutItem, dynamodb:UpdateItem, dynamodb:DeleteItem, dynamodb:Query, dynamodb:BatchWriteItem) on arn:aws:dynamodb:us-east-1:111122223333:table/Orders, arn:aws:dynamodb:us-east-1:111122223333:table/Orders/index/*.

Checks:
- No flags.

- [Paste it into the workbench](/)
- [Every DynamoDB action and its access level](/actions/dynamodb/)

## Related pages

- [IAM policy example: limit DynamoDB items to the caller](/examples/dynamodb-leading-keys-per-user/)
- [IAM policy example: read a DynamoDB stream](/examples/dynamodb-read-streams-for-consumer/)
- [IAM policy example: let users manage their own MFA device](/examples/iam-manage-own-mfa-device/)
- [All of them](/examples/)

## Sources

- Amazon DynamoDB Developer Guide: identity-based policies: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/using-identity-based-policies.html (read 16 Nov 2026)
- AWS Service Authorization Reference, programmatic access (fetched 16 Nov 2026): https://docs.aws.amazon.com/service-authorization/latest/reference/service-reference.html (read 16 Nov 2026)

Last reviewed 16 Nov 2026. Canonical: https://iampolicygenerator.com/examples/dynamodb-crud-one-table/

This site is not affiliated with Amazon Web Services. AWS service and product names are used only to describe AWS services.
