⚡️ Serverless Plugin for DynamoDB Auto Scaling

With this plugin for serverless you can set DynamoDB Auto Scaling configuratin in your serverless.yml
file. The plugin supports multiple tables and separate configuration sets for read
and write
capacities.
Usage
Add the npm package to your project:
$ yarn add serverless-dynamodb-autoscaling
$ npm install serverless-dynamodb-autoscaling --save
Configuration
Add the plugin to your serverless.yml
:
plugins:
- serverless-dynamodb-autoscaling
Configure DynamoDB Auto Scaling in serverless.yml
:
custom:
capacities:
- name: custom-table
read:
minimum: 5
maximum: 1000
usage: 0.75
write:
minimum: 40
maximum: 200
usage: 0.5
- name: custom-table-2nd
read:
minimum: 5
maximum: 1000
That's it! After the next deployment (sls deploy
) serverless will configure your Auto Scaling for DynamoDB.
DynamoDB
The configuration above works fine for a default DynamoDB table configuration.
resources:
Resources:
CustomTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: custom-table
AttributeDefinitions:
- AttributeName: key
AttributeType: S
KeySchema:
- AttributeName: key
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 5
WriteCapacityUnits: 5
License
Feel free to use the code, it's released using the MIT license.
Contribution
You are more than welcome to contribute to this project! 😘
To make sure you have a pleasant experience, please read the code of conduct. It outlines core values and believes and will make working together a happier experience.