robin-drexler / serverless-dynamodb-ttl

⚡️ Serverless Plugin to set DynamoDB TTL

Home Page:https://www.npmjs.com/package/serverless-dynamodb-ttl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

⚡️ Serverless Plugin to set DynamoDB TTL

npm CircleCI license Coveralls

About the plugin

It's not possible to use DynamoDB's TTL feature with CloudFormation yet. Use this plugin to configure TTL for your DynamoDB with Serverless.

Usage

Add the npm package to your project:

# Via yarn
$ yarn add serverless-dynamodb-ttl

# Via npm
$ npm instal serverless-dynamodb-ttl --save

Add the plugin to your serverless.yml:

plugins:
  - serverless-dynamodb-ttl

Configure TTL in serverless.yml:

custom:
  dynamodb:
    ttl:
      - table: your-dynamodb-table-name
        field: your-ttl-property-name

That's it! After the next deployment serverless will make sure to configure your TTL property in DynamoDB.

License

Feel free to use the code, it's released using the MIT license.

Contributors

Contribution

Run unit tests

$ yarn test
# or
$ npm test

Lint code

$ yarn lint
# or
$ npm lint

Feel free to contribute to this project! Thanks 😘

About

⚡️ Serverless Plugin to set DynamoDB TTL

https://www.npmjs.com/package/serverless-dynamodb-ttl

License:MIT License


Languages

Language:JavaScript 100.0%