npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

serverless-dynamo-stream-plugin

v0.1.5

Published

Creates and connects DynamoDB streams for pre-existing tables with AWS Lambdas using Serverless

Downloads

2,210

Readme

Serverless Dynamo Stream Plugin

Creates and connects DynamoDB streams for pre-existing tables with AWS Lambdas using Serverless.

Purpose

Serverless provides the ability to connect your DynamoDB stream with your Lambda out of the box if the Dynamo table is created by Serverless itself, and not only that, if you are trying to do it directly with just serverless, the Dynamo DB table cannot be pre-existing, it will throw an error.

That being said, if you use Terraform, Ansible or any other tool to create your resources outside of Serverless, there is no way to connect your Lambda managed by Serverless with the pre-existing DynamoDB table using a stream.

This plugin solves this problem.

Install

Install the plugin

Using your favorite package manager, simply install the package into your project.

yarn install serverless-dynamo-stream-plugin

or

npm install serverless-dynamo-stream-plugin

Add to serverless.yml

Add the plugin to the plugins section in serverless.yml file.

...
plugins:
  - serverless-dynamo-stream-plugin
...

Usage

existingDynamoStream event

The plugin adds a new type of event for your Dynamo tables called existingDynamoStream. This event accepts the table name and some other parameters (more optional parameters to come in the future). Here is how you can configure your tankHandler Lambda to connect to Battle DynamoDB table stream.

tankHandler:
  handler: handlers/dynamo-streams/tankHandler.process
  events:
    - existingDynamoStream:
        tableName: Battle
        streamType: NEW_IMAGE
        startingPosition: LATEST

Running

There are two ways to run the plugin.

  1. sls deploy

The plugin runs automatically after the deploy phase. If you deploy your Serverless infrastructure using the sls deploy command, the plugin starts running automatically once the deploy is finished.

  1. sls dynamo-stream

In case you would like to run the plugin on demand, there is a separate command for it called dynamo-stream. Running sls dynamo-stream will not run the deploy and it will only try to connect the lambdas to your DynamoDB streams. Please note that the plugin relies on having a successful serverless deploy first. Meaning that before running your dynamo-stream command, you'll need to make sure all lambdas are already deployed by Serverless.

Release

Initially developed at Commandeer and now Open Sourced for everyone to use.