Bird
0
0

Which IAM policy condition correctly enforces this fine-grained access control for user 'alice'?

hard🚀 Application Q15 of 15
DynamoDB - Security and Access Control
You want to allow users to read only their own orders in a DynamoDB table where the partition key is 'UserId'. Which IAM policy condition correctly enforces this fine-grained access control for user 'alice'?
A{ "ForAllValues:StringEquals": { "dynamodb:LeadingKeys": ["alice"] } }
B{ "StringEquals": { "dynamodb:Attributes": ["alice"] } }
C{ "ForAnyValue:StringEquals": { "dynamodb:LeadingKeys": ["alice"] } }
D{ "StringLike": { "dynamodb:LeadingKeys": "alice*" } }
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct condition operator for exact key match

    For fine-grained access, ForAllValues:StringEquals with an array ensures all keys match exactly.
  2. Step 2: Evaluate options for correct syntax and semantics

    { "ForAllValues:StringEquals": { "dynamodb:LeadingKeys": ["alice"] } } uses correct operator and array format; others use wrong keys or operators.
  3. Final Answer:

    { "ForAllValues:StringEquals": { "dynamodb:LeadingKeys": ["alice"] } } -> Option A
  4. Quick Check:

    Exact key match needs ForAllValues:StringEquals with array [OK]
Quick Trick: Use ForAllValues:StringEquals with array for exact user keys [OK]
Common Mistakes:
MISTAKES
  • Using dynamodb:Attributes instead of LeadingKeys
  • Using StringEquals without array
  • Using StringLike which allows wildcards

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More DynamoDB Quizzes