Bird
0
0

You wrote this IAM policy to allow read access to a DynamoDB table but users still get AccessDenied errors. What is the likely problem?

medium📝 Debug Q14 of 15
DynamoDB - Backup and Recovery
You wrote this IAM policy to allow read access to a DynamoDB table but users still get AccessDenied errors. What is the likely problem?
{
  "Version": "2012-10-17",
  "Statement": [{
    "Effect": "Allow",
    "Action": "dynamodb:GetItem",
    "Resource": "arn:aws:dynamodb:us-east-1:123456789012:table/MyTable"
  }]
}
AThe Resource ARN is missing the index name.
BThe Action should include dynamodb:Query and dynamodb:Scan for read access.
CThe Effect should be Deny instead of Allow.
DThe Version date is incorrect.
Step-by-Step Solution
Solution:
  1. Step 1: Identify required actions for read access

    Read access often requires multiple actions like GetItem, Query, and Scan.
  2. Step 2: Check the policy actions

    The policy only allows GetItem, so Query and Scan requests will be denied.
  3. Final Answer:

    The Action should include dynamodb:Query and dynamodb:Scan for read access. -> Option B
  4. Quick Check:

    Read access needs GetItem, Query, Scan [OK]
Quick Trick: Include all read actions: GetItem, Query, Scan [OK]
Common Mistakes:
MISTAKES
  • Assuming GetItem alone grants full read access
  • Changing Effect to Deny by mistake
  • Ignoring the need for multiple actions

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More DynamoDB Quizzes