0.0.3 • Published 4 years ago

dynamodb-stream-stitch-connector v0.0.3

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

dynamodb-stream-stitch-connector

A utility to push dynamodb streams to Stitch. Runs on AWS Lambda

How

AWS Lambda function

//handler.js

const stitchConnector = require('dynamodb-stream-stitch-connector')

const connector = stitchConnector.init({
  apiKey: 'xxxxxxxxxx',
  clientId: 12345,
  tableName: 'stitch-table-name',
  keyNames: [ 'id', 'anotherKey' ]
})

module.exports.streamsToStitch = async ({
  Records
}) => {
  for (const record of Records) {
    await connector.processRecord(record)
  }
}

If you're using Serverless Framework

## serverless.yml

# ....
functions:
  streamsToStitch:
    handler: handler.streamsToStitch
    events:
      - stream:
          type: dynamodb
          arn:
            Fn::GetAtt: [SomeTable, StreamArn]
# ....
0.0.3

4 years ago

0.0.2

5 years ago

0.0.1

5 years ago