Reputation: 17018
Is it possible to have DynamoDB conditionally save a timestamp if the item is created?
It looks like the AWS Java SDK provides this functionality via the @DynamoDBAutoGeneratedTimestamp
annotation.
Upvotes: 2
Views: 1564
Reputation: 46849
Your could write/use a DynamoDB trigger - an AWS Lambda function - to do this for you:
https://aws.amazon.com/dynamodb/faqs/
** Q. How does DynamoDB Triggers work? ** The custom logic for a DynamoDB trigger is stored in an AWS Lambda function as code. To create a trigger for a given table, you can associate an AWS Lambda function to the stream (via DynamoDB Streams) on a DynamoDB table. When the table is updated, the updates are published to DynamoDB Streams. In turn, AWS Lambda reads the updates from the associated stream and executes the code in the function.
Upvotes: 1