New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

serverless-dynamodb-autoscaling

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

serverless-dynamodb-autoscaling

Serverless Plugin for Amazon DynamoDB Auto Scaling configuration.

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.3K
decreased by-5.92%
Maintainers
1
Weekly downloads
 
Created
Source

⚡️ Serverless Plugin for DynamoDB Auto Scaling

npm CircleCI license Coveralls

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 using AWS native DynamoDB Auto Scaling.

Usage

Add the NPM package to your project:

# Via yarn
$ yarn add serverless-dynamodb-autoscaling

# Via npm
$ npm install serverless-dynamodb-autoscaling --save-dev

Configuration

Add the plugin to your serverless.yml:

plugins:
  - serverless-dynamodb-autoscaling

Configure DynamoDB Auto Scaling in serverless.yml with references to your DynamoDB CloudFormation resources for the table property:

custom:
  capacities:
    - table: CustomTable  # DynamoDB Resource
      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
    - table: AnotherTable
      read:
        minimum: 5
        maximum: 1000
        # usage: 0.75 is the default

That's it! With the next deployment (sls deploy) serverless will add a CloudFormation configuration to enable Auto Scaling for the DynamoDB resources CustomTable and AnotherTable.

You must of course provide at least a configuration for read or write to enable Auto Scaling. The value for usage has a default of 75 percent.

Notice: With the relese of v0.2.x the plugin introduced a breaking change. Starting with v0.2.0 you need to provide the CloudFormation reference for the table property. In v0.1.x the plugin used a name property with the DynamoDB table name.

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.

Thanks

Contribution

You are 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.

Keywords

FAQs

Package last updated on 21 Jul 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc