- Created a dynamo db table. We use "travis-ci-deloy-test" with number key "created_at".
- Setup aws cli command line tool.
- Stored an item with with number key and attribute (in this example, foo: "finger_print").
- Set credentials for the table for aws client config (e.g. by setting values in
~/.aws/credentials
).
First, prepare the query key in a file query_key.json
describing the key as json.
{
"created_at": { "N": "123" }
}
- Run the query.
aws dynamodb get-item --table-name travis-ci-deloy-test --key file://query_key.json
This returns the following.
{
"Item": {
"created_at": {
"N": "123"
},
"finger_print": {
"S": "foo"
}
}
}
As we can see, aws cli does has returns the raw query result as a json using the (ugly) AttributeValue syntax.