DBS-C01 Workload-Specific Database Design Practice Question
Exhibit
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"dynamodb:GetItem",
"dynamodb:Query",
"dynamodb:Scan"
],
"Resource": "arn:aws:dynamodb:us-east-1:123456789012:table/MyTable"
},
{
"Effect": "Deny",
"Action": "dynamodb:Scan",
"Resource": "arn:aws:dynamodb:us-east-1:123456789012:table/MyTable",
"Condition": {
"ForAllValues:StringNotEquals": {
"dynamodb:Attributes": ["pk", "sk"]
}
}
}
]
}Refer to the exhibit. A DynamoDB table has a primary key of pk (partition key) and sk (sort key). An application needs to perform GetItem and Query operations but should only be allowed to retrieve the pk and sk attributes. The IAM policy above is applied to the application's IAM role. Why does the policy fail to achieve the goal?
⚠ Common exam trap
A common mix-up: candidates assume a Deny on specific attributes will block all access to those attributes, but they overlook that DynamoDB returns all attributes by default when no ProjectionExpression is specified, making the Deny ineffective unless a ProjectionExpression is always provided.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The Deny statement does not prevent retrieval of all attributes when no ProjectionExpression is specified.
The Deny statement only denies access when the request includes a ProjectionExpression that specifies attributes other than pk and sk. However, if the application performs a GetItem or Query without specifying any ProjectionExpression, DynamoDB returns all attributes by default, which violates the requirement to restrict retrieval to only pk and sk. The policy does not block this default behavior, so it fails to achieve the goal.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The Deny statement uses the wrong condition key; it should use 'dynamodb:Select' instead of 'dynamodb:Attributes'.
Why it's wrong here
While 'dynamodb:Select' is valid, the core issue is with 'ForAllValues:StringNotEquals' behavior.
- ✗
The policy should use 'dynamodb:ReturnValues' condition key.
Why it's wrong here
ReturnValues is for write operations like UpdateItem, not relevant here.
- ✓
The Deny statement does not prevent retrieval of all attributes when no ProjectionExpression is specified.
Why this is correct
If the request does not specify attributes, the condition has no values to compare, so the Deny is not applied, allowing full access.
- ✗
The Allow statement should include 'dynamodb:Scan' to allow Query operations.
Why it's wrong here
Query does not require Scan permission; the Allow already includes Query.
Go deeper
Related to this question
About these practice questions
Courseiva writes every DBS-C01 question from scratch — 1,663 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This DBS-C01 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DBS-C01 exam.