Bird
0
0

An API Gateway integration request to DynamoDB fails with a validation error. The template is:

medium📝 Debug Q7 of 15
DynamoDB - with Serverless
An API Gateway integration request to DynamoDB fails with a validation error. The template is:
{
  "TableName": "Orders",
  "Key": {
    "OrderId": { "S": "$input.params('orderId')" }
  },
  "DeleteKey": {
    "OrderId": { "S": "$input.params('orderId')" }
  }
}

What is the cause of the error?
AMissing "UpdateExpression" for delete operation
B'DeleteKey' is not a valid parameter for DynamoDB operations
CTableName is incorrect
DKey attribute type should be Number, not String
Step-by-Step Solution
Solution:
  1. Step 1: Identify valid parameters for DynamoDB DeleteItem

    DeleteItem requires TableName and Key; 'DeleteKey' is invalid.
  2. Step 2: Confirm error cause

    Using 'DeleteKey' causes validation failure because it is not recognized.
  3. Final Answer:

    'DeleteKey' is not a valid parameter for DynamoDB operations -> Option B
  4. Quick Check:

    DeleteItem uses 'Key', not 'DeleteKey' [OK]
Quick Trick: Use 'Key' for DeleteItem, never 'DeleteKey' [OK]
Common Mistakes:
MISTAKES
  • Using 'DeleteKey' instead of 'Key'
  • Expecting UpdateExpression for delete
  • Assuming attribute type mismatch

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More DynamoDB Quizzes