GithubHelp home page GithubHelp logo

rrahul963 / serverless-create-global-dynamodb-table Goto Github PK

View Code? Open in Web Editor NEW
25.0 4.0 17.0 522 KB

serverless plugin that would create global dynamodb tables for specified tables

License: Apache License 2.0

JavaScript 100.00%
dynamodb-tables serverless global-tables global aws aws-dynamodb

serverless-create-global-dynamodb-table's Introduction

serverless-create-global-dynamodb-table

serverless Build Status npm version Coverage Status

A serverless plugin to automatically creates dynamodb global table(s).

By default, the plugin will deploy the whole service stack in the specified region(s) and then setup global table relation between the dynamodb tables.

Install

npm install --save-dev serverless-create-global-dynamodb-table

Add the plugin to your serverless.yml file:

plugins:
  - serverless-create-global-dynamodb-table

Configuration

custom:
  globalTables:
    version: v1 # optional, default is 'v1' (2017.11.29), please use 'v2' for (2019.11.21) version creation
    regions: # list of regions in which you want to set up global tables
      - region-1
      - region-2
    createStack: false # optional flag, when set to false will not deploy the stack in new region(s) and will create the tables using AWS SDK.
                       # if you use 'createStack: true' with 'version: v2', please add 'Condition' rule to your dynamodb to create it in the main region only,
                       # other regions are going to be replicated automatically from the main region.

NOTE:

  1. When creating global tables with createStack: false, any update the source table config is not replicated to global tables.
  2. version field is backward compatible and not required (the field can be absent).
    If you want to use Global Table (Version 2019.11.21), please use version: v2.
    Also, we don't recommend using v2 over v1 in your existing project. The plugin doesn't support updating from v1 to v2.
    More details about Global Tables you can find in the following link: AWS DynamoDB Global Tables
  3. Here is an example of using conditions, by default it's optional, but it's required for createStack: true with version: v2 setup:
Conditions:
  RegionUSEast1: !Equals [ !Ref "AWS::Region", us-east-1 ]

MyDynamoDBTable:
    Condition: RegionUSEast1
    Type: 'AWS::DynamoDB::Table'
    DeletionPolicy: Retain
    Properties:
    ....

Revisions

  • 2.0.0
    • Updated the package to deploy the service stack in the new region(s) by default
    • Added support to setup auto-scaling on global tables when not using create stack feature.
    • Added unit-tests
  • 2.1.0
    • Added support for PAY_PER_REQUEST billing mode for createStack: true mode
  • 3.1.0
    • Added support to create a new version of Global Table (Version 2019.11.21)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.