serverless-dynamo-build

1.1.5 • Public • Published

Serverless Dynamo Build npm

A plugin to buld Dynamo DB with data for Serverless Framework.

Use Case

  • Populate Data into Dynamo during deployment through serverless. Can prevent additonal usage of lambdas for populating data into Dynamo DB,once the serverless deploy is completed

Install

Run npm install in your Serverless project.

$ npm install --save serverless-dynamo-build

Add the plugin to your serverless.yml file

plugins:
  - serverless-dynamo-build

Setup

custom:
  dynamoBuild:
#   noOperation will determine if the below operations will be executed or not ( noOperation=true will ignore the below statements)
  noOperation: false
  # Multiple operations for multiple tables can be provided here
  config:
    - table: event
      operation: UPDATE
    #   params contain multiple record details that needs to be inserted in the table
      params:
        - hashKey: eventPath
          hashValue: name/{id}
          rangeKey: eventData
          rangeValue: eventValue
        #   updateKeys holds the set of fields that needs to be inserted
          updateKeys: 
            - scope
            - scope1
        #   updateValues holds the set of values that needs to be inserted for the above fields
          updateValues: 
            - - scope/1
              - scope/2
            - - scope1/1
              - scope1/2
        - hashKey: eventPath
          hashValue: description/{desc}
          updateKeys: 
            - scope
          updateValues: 
            - - scope/SCOPE3
              - scope/SCOPE4
    - table: event
      operation: DELETE
      params:
        - hashKey: eventPath
          hashValue: address/{id}


## Usage

Run `sls deploy`, Dynamo DB table will populated with data.

Run 'sls deploy --noDynamoBuild` if dynamo db population is not required

Run `sls dynamo build` to build up the dynamo db with values

Readme

Keywords

none

Package Sidebar

Install

npm i serverless-dynamo-build

Weekly Downloads

4

Version

1.1.5

License

ISC

Unpacked Size

7.77 kB

Total Files

3

Last publish

Collaborators

  • savz