All Projects → sbstjn → Serverless Dynamodb Autoscaling

sbstjn / Serverless Dynamodb Autoscaling

Licence: mit
Serverless Plugin for Amazon DynamoDB Auto Scaling configuration.

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Serverless Dynamodb Autoscaling

Aws Sdk Perl
A community AWS SDK for Perl Programmers
Stars: ✭ 153 (+7.75%)
Mutual labels:  aws, cloudformation, amazon, dynamodb
Awesome Aws
A curated list of awesome Amazon Web Services (AWS) libraries, open source repos, guides, blogs, and other resources. Featuring the Fiery Meter of AWSome.
Stars: ✭ 9,895 (+6868.31%)
Mutual labels:  aws, serverless, cloudformation, dynamodb
Serverless
This is intended to be a repo containing all of the official AWS Serverless architecture patterns built with CDK for developers to use. All patterns come in Typescript and Python with the exported CloudFormation also included.
Stars: ✭ 1,048 (+638.03%)
Mutual labels:  aws, serverless, cloudformation, dynamodb
Aws Toolkit Vscode
AWS Toolkit for Visual Studio Code, an extension for working with AWS services including AWS Lambda.
Stars: ✭ 823 (+479.58%)
Mutual labels:  aws, serverless, cloudformation, amazon
Aws Testing Library
Chai (https://chaijs.com) and Jest (https://jestjs.io/) assertions for testing services built with aws
Stars: ✭ 52 (-63.38%)
Mutual labels:  aws, serverless, dynamodb
Shorty.sls
Serverless URL shortener written in Python3 using the serverless framework
Stars: ✭ 35 (-75.35%)
Mutual labels:  aws, serverless, cloudformation
Designing Cloud Native Microservices On Aws
Introduce a fluent way to design cloud native microservices via EventStorming workshop, this is a hands-on workshop. Contains such topics: DDD, Event storming, Specification by example. Including the AWS product : Serverless Lambda , DynamoDB, Fargate, CloudWatch.
Stars: ✭ 131 (-7.75%)
Mutual labels:  aws, serverless, dynamodb
Dynamo Easy
DynamoDB client for NodeJS and browser with a fluent api to build requests. We take care of the type mapping between JS and DynamoDB, customizable trough typescript decorators.
Stars: ✭ 133 (-6.34%)
Mutual labels:  aws, serverless, dynamodb
Aws Auto Terminate Idle Emr
AWS Auto Terminate Idle AWS EMR Clusters Framework is an AWS based solution using AWS CloudWatch and AWS Lambda using a Python script that is using Boto3 to terminate AWS EMR clusters that have been idle for a specified period of time.
Stars: ✭ 21 (-85.21%)
Mutual labels:  aws, serverless, cloudformation
Lambda Refarch Webapp
The Web Application reference architecture is a general-purpose, event-driven, web application back-end that uses AWS Lambda, Amazon API Gateway for its business logic. It also uses Amazon DynamoDB as its database and Amazon Cognito for user management. All static content is hosted using AWS Amplify Console.
Stars: ✭ 1,208 (+750.7%)
Mutual labels:  aws, serverless, dynamodb
Graphql Recipes
A list of GraphQL recipes that, when used with the Amplify CLI, will deploy an entire AWS AppSync GraphQL backend.
Stars: ✭ 137 (-3.52%)
Mutual labels:  aws, serverless, dynamodb
Graphql Serverless
Sample project to guide the use of GraphQL and Serverless Architecture.
Stars: ✭ 28 (-80.28%)
Mutual labels:  aws, serverless, dynamodb
Aws Multi Account Viewer
Serverless app designed for any customer with two or more accounts to view resources across accounts/regions in simple single pane of glass website
Stars: ✭ 87 (-38.73%)
Mutual labels:  aws, serverless, cloudformation
Scar
Deploy static websites in seconds - with HTTPS, a global CDN, and custom domains.
Stars: ✭ 1,715 (+1107.75%)
Mutual labels:  aws, serverless, cloudformation
Contacts api
Serverless RESTful API with AWS Lambda, API Gateway and DynamoDB
Stars: ✭ 66 (-53.52%)
Mutual labels:  aws, serverless, dynamodb
Workshop Donkeytracker
Workshop to build a serverless tracking application for your mobile device with an AWS backend
Stars: ✭ 27 (-80.99%)
Mutual labels:  aws, serverless, dynamodb
Historical
A serverless, event-driven AWS configuration collection service with configuration versioning.
Stars: ✭ 85 (-40.14%)
Mutual labels:  aws, serverless, dynamodb
Dynamodb Json
DynamoDB json util to load and dump strings of Dynamodb json format to python object and vise-versa
Stars: ✭ 114 (-19.72%)
Mutual labels:  aws, serverless, dynamodb
Serverless Aws Lambda Node Postgres
Serverless AWS Lambda with Node.js,Postgres Rest API with Sequelize.
Stars: ✭ 18 (-87.32%)
Mutual labels:  aws, serverless, cloudformation
Cloudmagick
CloudMagick is a serverless application which provides a dynamic image transformation like the small light module of apache2
Stars: ✭ 11 (-92.25%)
Mutual labels:  aws, serverless, cloudformation

⚡️ Serverless Plugin for DynamoDB Auto Scaling

npm CircleCI license Coveralls

With this plugin for serverless, you can enable DynamoDB Auto Scaling for tables and Global Secondary Indexes easily in your serverless.yml configuration file. The plugin supports multiple tables and indexes, as well as separate configuration for read and write capacities using Amazon's 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

Add the plugin to your serverless.yml:

plugins:
  - serverless-dynamodb-autoscaling

Configuration

Configure DynamoDB Auto Scaling in serverless.yml with references to your DynamoDB CloudFormation resources for the table property. The index configuration is optional to apply Auto Scaling Global Secondary Index.

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

That's it! With the next deployment, serverless will add a CloudFormation configuration to enable Auto Scaling for the DynamoDB resources CustomTable and its Global Secondary Index called custom-index-name.

You must provide at least a configuration for read or write to enable Auto Scaling!

Defaults

maximum: 200
minimum: 5
usage: 0.75

Index

If you only want to enable Auto Scaling for the index, use indexOnly: true to skip Auto Scaling for the general DynamoDB table.

API Throtteling

CloudWatch has very strict API rate limits! If you plan to configure Auto Scaling for multiple DynamoDB tables or Global Secondary Indexes, request an increase of the rate limits first! Otherwise, you might run into an error like this:

An error occurred while provisioning your stack: XYZ - Unable to create alarms for scaling policy XYZ due to reason: 
Rate exceeded (Service: AmazonCloudWatch; Status Code: 400; Error Code: Throttling; Request ID: XYZ).

Breaking Changes

There have been multiple breaking changes regarding CloudFormation resource names in the past. If you end up with an error, that your CloudFormation Stack cannot be updated, try to remove the custom > capacities configuration from your serverless.yml file and deploy the service without any Auto Scaling configuration. After that, just re-add your previous configuration and deploy your service again.

DynamoDB

The example serverless configuration above works fine for a DynamoDB table CloudFormation resource like this:

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
        GlobalSecondaryIndexes:
          - IndexName: custom-index-name
            KeySchema:
              - AttributeName: key
                KeyType: HASH
            Projection:
              ProjectionType: ALL
            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 beliefs and will make working together a happier experience.

Local Development

If you plan to change the TypeScript files and link the package to another project, use the link and build yarn commands:

$ > yarn link
$ > yarn build:watch # or "yarn build"

Use your local build of the package in another project:

$ > yarn link serverless-dynamodb-autoscaling
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].