Bird
0
0

How can you enforce row-level security in DynamoDB so that users can only update items where the partition key matches their user ID and the item status is "pending"?

hard🚀 Application Q9 of 15
DynamoDB - Security and Access Control
How can you enforce row-level security in DynamoDB so that users can only update items where the partition key matches their user ID and the item status is "pending"?
AUse dynamodb:Attributes to filter by status only
BUse dynamodb:TableName and dynamodb:ReturnConsumedCapacity
CUse dynamodb:LeadingKeys only without attribute conditions
DUse dynamodb:LeadingKeys for user ID and a condition on the attribute "status" equals "pending"
Step-by-Step Solution
Solution:
  1. Step 1: Restrict access by partition key

    dynamodb:LeadingKeys limits access to items matching the user's ID.
  2. Step 2: Add attribute condition for status

    Include a condition that the "status" attribute equals "pending" to restrict updates.
  3. Final Answer:

    Use dynamodb:LeadingKeys for user ID and a condition on the attribute "status" equals "pending" -> Option D
  4. Quick Check:

    Combine LeadingKeys and attribute status condition = A [OK]
Quick Trick: Combine LeadingKeys with attribute equals condition [OK]
Common Mistakes:
MISTAKES
  • Using only LeadingKeys without attribute filters
  • Using table-level keys instead of item-level
  • Ignoring attribute conditions for status

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More DynamoDB Quizzes