This repository shows an example of an application that executes a trigger when performing an insert in dynamodb.
In order to deploy the example, you need to run the following command:
$ serverless deploy
After successful deployment, you can invoke the deployed function by using the following command:
npm run insert
Which should result in response similar to the following:
{
"statusCode": 200,
"body": [
{
"created_at": "2022-12-29T01:12:33.656Z",
"id": "88dbe52d-0a60-4259-bd9f-32381fe07e81",
"name": "Batman",
"power": "Rich"
}
]
}
You can invoke your function locally by using the following command:
npm run insert-local
Which should result in response similar to the following:
{
"statusCode": 200,
"body": [
{
"created_at": "2022-12-29T01:12:33.656Z",
"id": "88dbe52d-0a60-4259-bd9f-32381fe07e81",
"name": "Batman",
"power": "Rich"
}
]
}