Home > Back-end >  AWS Dynamo DB - How can I set the TTL to a default value of 7 days
AWS Dynamo DB - How can I set the TTL to a default value of 7 days

Time:03-10

I am looking to set up TTL on my DynamoDB so that I can expire items from some of the tables.

I worked out how to enable the TTL and set an attribute on the table with an Epoch value of when the TTL will expire and it works, however this is not manageable as I assume that this requires me to manually add this attribute and epoch value every time?

Can anyone advise if it is possible to set the TTL to a default value of 7 days and how I can automatically have this to delete items from tables after the 7 days?

Thanks

Eamon

CodePudding user response:

Can anyone advise if it is possible to set the TTL to a default value of 7 days...

No - you will have to set this every time (which should be trivial to calculate) in your DynamoDB request.

  • Related