0
votes

Error as : Unable to get item: Error executing "GetItem" on "https://dynamodb.us-east-1.amazonaws.com"; AWS HTTP error: Client error: POST https://dynamodb.us-east-1.amazonaws.com resulted in a 400 Bad Request response: {"__type":"com.amazon.coral.validate#ValidationException","message":"The provided key element does not match the schema" (truncated...) ValidationException (client): The provided key element does not match the schema - {"__type":"com.amazon.coral.validate#ValidationException","message":"The provided key element does not match the schema"}

Already set key credentials on .aws/credentials file.

1
What is the exact request syntax you are making and what are the partition and sort keys (and their data types) your table is made up of?Kirk

1 Answers

0
votes

The AWS DynamoDB documentation defines the 400 Bad request Validation error as:

The input fails to satisfy the constraints specified by an AWS service.

The GetItem DynamoDB request includes Key parameter (required); for DynamoDB table with a simple primary key, you only need to provide a value for the partition key. For a composite primary key, you must provide values for both the partition key and the sort key (see GetItem API request documentation).

Most likely, you are either missing a hash or soft key in cases where one is required; or the name of the hash key or sort key does not match the one defined for DynamoDB table. For example, you might have specified "id" in GetItem request but your DynamoDB table has "Item_ID" as sort or has key attribute name.