Courseiva
Workload-Specific Database DesignmediumMultiple ChoiceObjective-mapped

DBS-C01 Workload-Specific Database Design Practice Question

Exhibit

Refer to the exhibit.

IAM policy document (CloudFormation snippet):
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "dynamodb:GetItem",
        "dynamodb:Query",
        "dynamodb:Scan"
      ],
      "Resource": "arn:aws:dynamodb:us-east-1:123456789012:table/mytable",
      "Condition": {
        "ForAllValues:StringEquals": {
          "dynamodb:LeadingKeys": ["user_${aws:userid}"]
        }
      }
    }
  ]
}

A company uses the IAM policy shown in the exhibit to control access to a DynamoDB table. The table has a partition key user_id and a sort key timestamp. The application uses the AWS SDK to query items. When a user tries to query items with a filter condition, they receive an AccessDeniedException. What is the most likely cause?

⚠ Common exam trap

The trap here is that candidates may overlook the `LeadingKeys` condition and assume the error is due to a missing action or a policy syntax issue, rather than recognizing that the query must include a partition key matching the condition value.

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 query does not specify a partition key that matches the user's LeadingKeys condition.

The IAM policy uses a `Condition` block with `ForAllValues:StringEquals` on `dynamodb:LeadingKeys` to restrict access to items where the partition key (`user_id`) matches the caller's IAM user ID (`${aws:userid}`). When a query does not specify a partition key that satisfies this condition, the request fails with an `AccessDeniedException`. The error occurs because the query must include a partition key equal to the user's ID to pass the leading keys restriction.

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 aws:userid variable is not being resolved correctly.

    Why it's wrong here

    The variable is correctly resolved in IAM policies.

  • The query does not specify a partition key that matches the user's LeadingKeys condition.

    Why this is correct

    The condition restricts access to items with a partition key equal to the user's ID; if the query does not use that partition key, access is denied.

  • The policy is missing a Condition element with dynamodb:Select.

    Why it's wrong here

    No such condition is needed.

  • The policy does not allow the Query action.

    Why it's wrong here

    The policy allows Query, so that is not the issue.

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 →

How Courseiva writes practice questions · Editorial policy

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.