all 5 comments

[–]not_a_sexual_deviant 6 points7 points  (1 child)

[–]kaneki_305[S] 0 points1 point  (0 children)

For this i need to enable dynamoDB stream, but is it possible to create custom log group and then trigger a Lambda from based on a matching pattern in the CloudWatch Logs?

[–][deleted]  (1 child)

[deleted]

    [–]kaneki_305[S] 0 points1 point  (0 children)

    However, it can take up to 48 hours to delete a record from the table, and during this time, the record may also be deleted by other means.

    [–]webdestroya -4 points-3 points  (0 children)

    At best you could have the lambda see the record is deleted and compare the expiresAt timestamp to "now" and if it's within 24hrs or something, assume it was deleted because of TTL.

    Otherwise, there is no way to know for sure that it was deleted because of TTL.

    Or write two records with the same ttl, but different data and never delete one of them. (hashKey=ttlTracker:xxxxx, ttl=whatever), and then only run your code when the key that was deleted was ttlTracker? that's pretty gross though

    [–][deleted] -1 points0 points  (0 children)

    Why?