serverless-offline-dynamodb-streams
Emulate AWS λ and DynamoDB streams locally when developing your Serverless project
Last updated 2 months ago by godu .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install serverless-offline-dynamodb-streams 
SYNC missed versions from official npm registry.

serverless-offline-dynamodb-streams

This Serverless-offline-dynamodb-streams plugin emulates AWS λ and DynamoDBStreams on your local machine. To do so, it listens DynamoDBStreams stream and invokes your handlers.

Features:

  • Serverless Webpack support.
  • DynamoDBStreams configurations: batchsize and startingPosition.

Installation

First, add serverless-offline-dynamodb-streams to your project:

npm install serverless-offline-dynamodb-streams

Then inside your project's serverless.yml file, add following entry to the plugins section before serverless-offline (and after serverless-webpack if presents): serverless-offline-dynamodb-streams.

plugins:
  - serverless-webpack
  - serverless-offline-dynamodb-streams
  - serverless-offline

See example

Configure

Functions

Ths configuration of function of the plugin follows the serverless documentation.

functions:
  myKinesisHandler:
    handler: handler.compute
    events:
      - stream:
          enabled: true
          type: dynamodb
          arn: arn:aws:dynamodb:eu-west-1:XXXXXX:table/myStream/stream/2018-07-02T19:48:31.121
          batchSize: 10
          startingPosition: TRIM_HORIZON

DynamoDB

The configuration of aws.DynamoDBStreams's client of the plugin is done by defining a custom: serverless-offline-dynamodb-streams object in your serverless.yml with your specific configuration.

You could use mhart's Dynalite with the following configuration:

custom:
  serverless-offline-dynamodb-streams:
    apiVersion: '2013-12-02'
    endpoint: http://0.0.0.0:8000
    region: eu-west-1
    accessKeyId: root
    secretAccessKey: root
    skipCacheInvalidation: false
    readInterval: 500

arn could be deduce from tableName if your add the key tableName in your function's configuration. Useful if your use dynalite and regularly recreate a new DynamoDBStreams.

functions:
  myKinesisHandler:
    handler: handler.compute
    events:
      - stream:
          enabled: true
          type: dynamodb
          tableName: myTable

Current Tags

  • 4.0.1                                ...           latest (2 months ago)
  • 4.0.1                                ...           next (2 months ago)

17 Versions

  • 4.0.1                                ...           2 months ago
  • 4.0.0                                ...           2 months ago
  • 3.0.2                                ...           5 months ago
  • 3.0.1                                ...           9 months ago
  • 3.0.0                                ...           10 months ago
  • 2.0.0                                ...           a year ago
  • 1.6.2                                ...           a year ago
  • 1.6.1                                ...           a year ago
  • 1.6.0                                ...           a year ago
  • 1.5.1                                ...           2 years ago
  • 1.5.0                                ...           2 years ago
  • 1.4.0                                ...           2 years ago
  • 1.3.0                                ...           2 years ago
  • 1.2.0                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Downloads
Today 0
This Week 3
This Month 4
Last Day 0
Last Week 1
Last Month 17
Dependencies (3)
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |