@growsari/sls-event-gateway-subscriber

0.0.3 • Public • Published

Serverless Plugin - Event Gateway Subscriber

This Serverless Framework plugin will configure API Gateway connected Lambdas to subscribe to topics in the Growsari Event Bus

Installation

npm install --save @growsari/sls-event-gateway-subscriber

Enviroment Configuration

EVENT_GATEWAY_URL - Base URL of the Growsari Event Bus

Usage

To use the plugin, add the following configurations in serverless.yml

  • Include the package in the plugins
  • Add event_gateway as an event trigger for a function.
  • Add topic as a topic name for the event_gateway event
# serverless.yml

service:  serviceName

provider:
  name:  aws
  runtime:  nodejs10.x

# Add package in plugins
plugins:
  -  "@growsari/sls-event-gateway-subscriber"

functions:
  notificationUrlforTopicName:
    handler: handler.process
    events:
      # Make sure an http event with a POST method is present
      - http:
          path: notify
          method: post
      # Add event_gateway as an event and a topic to subscribe to
      - event_gateway:
          topic:  topicName

Readme

Keywords

none

Package Sidebar

Install

npm i @growsari/sls-event-gateway-subscriber

Weekly Downloads

1

Version

0.0.3

License

none

Unpacked Size

3.81 kB

Total Files

5

Last publish

Collaborators

  • madhugogineni
  • ddimaano.gs
  • prasad.riktam
  • melyo
  • leland.growsari
  • gs.dwight.badua