Autoscale DynamoDB resources with a single AWS AutoScalingPlan
yarn add -D @endemolshinegroup/serverless-dynamodb-autoscaler
Add the plugin to your serverless.yml
:
plugins:
- @endemolshinegroup/serverless-dynamodb-autoscaler
Add a capacities
property to your serverless.yml
:
custom:
capacities:
- table: CustomTable # DynamoDB Resource
index: # List or single index name
- custom-index-name
read:
minimum: 5 # Minimum read capacity
maximum: 1000 # Maximum read capacity
usage: 0.75 # Targeted usage percentage
write:
minimum: 40 # Minimum write capacity
maximum: 200 # Maximum write capacity
usage: 0.5 # Targeted usage percentage
Finish by running sls deploy
and you're good to go!