Bird
0
0

You run this command to create a DynamoDB table:

medium📝 Debug Q14 of 15
AWS - DynamoDB
You run this command to create a DynamoDB table:
aws dynamodb create-table --table-name Orders --attribute-definitions AttributeName=Id,AttributeType=N --key-schema AttributeName=OrderId,KeyType=HASH --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5

But you get an error. What is the most likely cause?
AThe attribute definition and key schema attribute names do not match
BProvisioned throughput values are missing
CThe key schema is missing a RANGE key
DAttributeType should be 'S' for string, not 'N' for number
Step-by-Step Solution
Solution:
  1. Step 1: Check attribute definitions and key schema names

    The attribute definitions specify AttributeName=Id, but the key schema specifies AttributeName=OrderId. The names do not match, causing the error.
  2. Step 2: Verify other potential issues

    Provisioned throughput values are present (not B), a simple primary key with only HASH is allowed (not C), AttributeType=N is valid for numeric IDs (not D).
  3. Final Answer:

    The attribute definition and key schema attribute names do not match -> Option A
  4. Quick Check:

    Attribute names must match exactly [OK]
Quick Trick: Match attribute names exactly in definitions and key schema [OK]
Common Mistakes:
  • Assuming 'N' type is invalid
  • Expecting RANGE key for all tables
  • Missing provisioned throughput

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes