Skip to content

serverless plugin to make serverless-cwe-sns-sqs-lambda events

Notifications You must be signed in to change notification settings

lytesoft/serverless-cwe-sns-lambda

 
 

Repository files navigation

Serverless Cwe Sns Sqs Lambda

serverless MIT License

This plugin allows to define a cloudwatch event rule as the trigger for a lambda. To handle errors and retries, this event will go through SNS (connected to a DLQ to avoid delivery problems) and call a lambda which should have the onError param with another DLQ defined (outside the scope of this plugin)

Install

Run npm install in your Serverless project.

$ npm install --save-dev https://github.com/tcastelli/serverless-cwe-sns-lambda/master/tarball

Add the plugin to your serverless.yml file

plugins:
  - "serverless-cwe-sns-lambda"

Setup

functions:
  processEvent:
    handler: handler.handler
    events:
      - cweSns:
          ruleResourceName: XXXXEvent                           #required
          topicResourceName: XXXXTopic                          #optional
          dlqResourceName:  string                              #optional
          dlqPolicyResourceName : string                        #optional
          ruleMessage: Input || InputPath || InputTransformer   #optional                         
          filterPolicy: Object                                  #optional
          prefix: string                                        #optional

resources:
  Resources:
    XXXXEvent:
      Type: AWS::Events::Rule
      Properties:
        ScheduleExpression: cron(0/3 * * * ? *)
        State: ENABLED
        Targets: []

plugins:
  - serverless-cwe-sns-lambda

About

serverless plugin to make serverless-cwe-sns-sqs-lambda events

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%