3 Answers
- Newest
- Most votes
- Most comments
1
No, a TTL is used to delete an item so you'd set the TTL for the (eventual, year from now) deletion time.
If an item could be marked as "expired" what would you want the behaviour to be?
1
Use logic in your code not to display data older than X days and set the TTL to expire after a year
0
In order to be able to use TTL as you suggest, you have to implement other additional mechanisms such as
- DynamoDB Stream that allows you to get the details of the deleted item
- Lambda as a trigger, preferably using filters for TTL deletions
So, in the Lambda, you would have to re-upload the item to DDB with the updated values you need.
NOTE: Using these services may increase your bill, it might be easier to use the logic in your code
answered a year ago
Relevant content
- asked a year ago
- asked a year ago
- AWS OFFICIALUpdated 2 years ago

I have a column indicating whether a record is active or not, and I need this column to automatically update to "expired" 24 hours after the record is created. I'm seeking a more efficient solution for this automatic update after 24 hours, without relying on Lambda functions and EventBridge.
Use logic in your code than updating the column every 24 hours? Rely on the creation timestamp. Using lambda to make updates to dynamo costs $ on read and writes. TTL deletes are free
Gary's comment is correct - the way I would do it is use application logic to treat a record as inactive if the TTL is set.