Bird
0
0

You want to create a DynamoDB table with a composite primary key and enable auto scaling for read capacity. Which combination of parameters is correct?

hard📝 Best Practice Q8 of 15
AWS - DynamoDB
You want to create a DynamoDB table with a composite primary key and enable auto scaling for read capacity. Which combination of parameters is correct?
A--attribute-definitions AttributeName=UserId,AttributeType=S AttributeName=Timestamp,AttributeType=N --key-schema AttributeName=UserId,KeyType=HASH AttributeName=Timestamp,KeyType=RANGE --billing-mode PROVISIONED --auto-scaling-enabled
B--attribute-definitions AttributeName=UserId,AttributeType=S,AttributeName=Timestamp,AttributeType=N --key-schema AttributeName=UserId,KeyType=HASH AttributeName=Timestamp,KeyType=RANGE --billing-mode PROVISIONED --auto-scaling-enabled
C--attribute-definitions AttributeName=UserId,AttributeType=S,AttributeName=Timestamp,AttributeType=N --key-schema AttributeName=UserId,KeyType=HASH AttributeName=Timestamp,KeyType=RANGE --billing-mode PROVISIONED
D--attribute-definitions AttributeName=UserId,AttributeType=S AttributeName=Timestamp,AttributeType=N --key-schema AttributeName=UserId,KeyType=HASH AttributeName=Timestamp,KeyType=RANGE --billing-mode PAY_PER_REQUEST
Step-by-Step Solution
Solution:
  1. Step 1: Understand composite key and attribute definitions syntax

    Attributes must be comma-separated; key schema must include HASH and RANGE keys.
  2. Step 2: Check auto scaling and billing mode

    Auto scaling is configured separately; --auto-scaling-enabled is not a valid CLI parameter. Billing mode PROVISIONED is required for auto scaling.
  3. Step 3: Identify correct option

    --attribute-definitions AttributeName=UserId,AttributeType=S,AttributeName=Timestamp,AttributeType=N --key-schema AttributeName=UserId,KeyType=HASH AttributeName=Timestamp,KeyType=RANGE --billing-mode PROVISIONED correctly formats attributes, key schema, and billing mode without invalid parameters.
  4. Final Answer:

    Option C with correct attribute syntax and billing mode PROVISIONED -> Option C
  5. Quick Check:

    Composite key + PROVISIONED billing = --attribute-definitions AttributeName=UserId,AttributeType=S,AttributeName=Timestamp,AttributeType=N --key-schema AttributeName=UserId,KeyType=HASH AttributeName=Timestamp,KeyType=RANGE --billing-mode PROVISIONED [OK]
Quick Trick: Use PROVISIONED billing for auto scaling; no --auto-scaling-enabled flag [OK]
Common Mistakes:
  • Wrong attribute syntax
  • Invalid auto scaling parameter
  • Using PAY_PER_REQUEST with auto scaling

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes