@growsari/sls-event-gateway-subscriber
v0.0.3
Published
Serverless Plugin for Growsari Event Gateway Subscription
Downloads
1
Keywords
Readme
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 theevent_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