Serverless Framework を使って、Lambda(Node.js) で DynamoDB を使用するサンプルです。
npm install
npm run deploy:dev
npm run deploy:v1
npm run remove
curl -X POST https://XXXXXXX.execute-api.us-east-1.amazonaws.com/dev/todos --data '{ "text": "Learn Serverless" }'
curl https://XXXXXXX.execute-api.us-east-1.amazonaws.com/dev/todos
# Replace the <id> part with a real id from your todos table
curl https://XXXXXXX.execute-api.us-east-1.amazonaws.com/dev/todos/<id>
# Replace the <id> part with a real id from your todos table
curl -X PUT https://XXXXXXX.execute-api.us-east-1.amazonaws.com/dev/todos/<id> --data '{ "text": "Learn Serverless", "checked": true }'
# Replace the <id> part with a real id from your todos table
curl -X DELETE https://XXXXXXX.execute-api.us-east-1.amazonaws.com/dev/todos/<id>
https://github.com/serverless/examples/tree/master/aws-node-rest-api-with-dynamodb