The cache table is not created
eerison opened this issue · comments
the initial table cache
is not created if it doesn't exist!
after I create the table cache
with attribute id
manually, the code works
That's by design, this package assumes the table exists. The table should have a primary key id
which is a string and a numeric attribute ttl
which is set as TTL attribute. You can modify the attribute names, those are just the defaults.
AWS CLI commands to create the table:
export TABLE_NAME=MyCoolCacheTable
(change this to your desired table name)aws dynamodb create-table --attribute-definitions AttributeName=id,AttributeType=S --table-name $TABLE_NAME --key-schema AttributeName=id,KeyType=HASH --billing-mode PAY_PER_REQUEST
aws dynamodb update-time-to-live --table-name $TABLE_NAME --time-to-live-specification Enabled=true,AttributeName=ttl