I'm trying to implement a DynamoDB get_item
call using https://github.com/aws/aws-sdk-ruby/blob/0465bfacbf87e6bc78c38191961ed860413d85cd/gems/aws-sdk-dynamodb/lib/aws-sdk-dynamodb/table.rb#L697 via our Ruby on Rails app, dr-recommends.
From reviewing this DynamoDB CloudFormation stack that I wrote, I expect the following get_item
call to work, so I'm a little lost as to how to proceed.
Type: 'AWS::DynamoDB::Table'
Properties:
AttributeDefinitions:
- AttributeName: 'pk'
AttributeType: 'S'
- AttributeName: 'sk'
AttributeType: 'S'
KeySchema:
- KeyType: 'HASH'
AttributeName: 'pk'
- KeyType: 'RANGE'
AttributeName: 'sk'
BillingMode: 'PAY_PER_REQUEST'
Do you see anything here that would explain why the following call might not work?
aws dynamodb get-item --table-name actual-table-name --key "{\"pk\":{\"S\":\"77119f89-d5bc-4662-91bb-f3e81e1d9b21\"}}" --projection-expression sk
# An error occurred (ValidationException) when calling the GetItem operation: The provided key element does not match the schema