-
Notifications
You must be signed in to change notification settings - Fork 0
Home
SohamMajumder edited this page Mar 29, 2023
·
2 revisions
Welcome to the DynamoDB_TTL wiki!
In this Example we will go over an example which adds TTL value to DynamoDB Items to allow for Automatic Cleanup of Older Data.
Use Case
- Automatic Removal of Old Records
- Save Cost & Reduce Manual intervention
Pre-Requisites:
- AWS Console Access
- AWS Cloud Shell Access
Steps to be followed:
- Open the AWS Cloud Shell (Separate TAB)
- Create a DynamoDB [CLI Script attached]
- Ensure the TTL option is enabled from Console (check below)
- Run the bash script {DynamoDB_TTL.sh} in AWS Shell to generate a sequence of Items with TTL values embedded [10 mis ahead]
Ref:
- https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/TTL.html
- DynamoDB TTL needs to be provided in EpocDate format
- https://youtu.be/ld619A_kcu4
-
DynamoDB CLI doesn't allow Attributes which are not Partition Keys/Sort Keys in the Create Table CLI command
-
When the Items (Records) are added with the new Attribute, the Attribute is added to the Key-Schema Automatically
Enable TTL in DynamoDB from Console: