IAM policy example: read one DynamoDB table, with a least privilege rewrite
Facts read 16 Nov 2026. Page reviewed 16 Nov 2026.
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
Allow 34 actions (dynamodb:Get*, dynamodb:Query, dynamodb:Scan, dynamodb:BatchGet*, dynamodb:Describe*, dynamodb:List*) on every resource.
Action or pattern Actions Access levels dynamodb:Get*5 Read 5 dynamodb:Query1 Read 1 dynamodb:Scan1 Read 1 dynamodb:BatchGet*1 Read 1 dynamodb:Describe*17 Read 17 dynamodb:List*9 List 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
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 pattern Actions Access levels dynamodb:GetItem1 Read 1 dynamodb:BatchGetItem1 Read 1 dynamodb:Query1 Read 1
Checks
No flags from the six checks.
Related pages
Sources
- Amazon DynamoDB Developer Guide: identity-based policies, read 16 Nov 2026
- AWS Service Authorization Reference, programmatic access (fetched 16 Nov 2026), read 16 Nov 2026
Last reviewed 16 Nov 2026.