Have ideas to improve npm?Join in the discussion! »

    serverless-plugin-subscription-filter

    1.0.7 • Public • Published

    serverless-plugin-subscription-filter

    serverless npm version

    Serverless plugin to register AWS CloudWatchLogs subscription filter.

    Installation

    npm install --save-dev serverless-plugin-subscription-filter

    plugins:
      - serverless-plugin-subscription-filter

    Usage

    This plugin is external serverless events. You can write settings like serverless events.

    functions:
      hello:
        handler: handler.hello
        events:
          subscriptionFilter:
              stage: prod
              logGroupName: /cloud-trail
              filterPattern: '{ $.errorMessage != "" }'

    Supports also multiple subscription filter.

    functions:
      hello:
        handler: handler.hello
        events:
          subscriptionFilter:
              stage: prod
              logGroupName: /cloud-trail
              filterPattern: '{ $.errorMessage != "" }'
          subscriptionFilter:
              stage: prod
              logGroupName: /my-log-group
              filterPattern: '{ $.errorMessage != "" }'
      goodbye:
        handler: handler.goodbye
        events:
          subscriptionFilter:
              stage: dev
              logGroupName: /my-log-group2
              filterPattern: Exception

    About each properties

    property description
    stage The deployment stage with serverless. Because only one subscription filter can be set for one LogGroup.
    logGroupName The log group to associate with the subscription filter.
    filterPattern The filtering expressions that restrict what gets delivered to the destination AWS resource. Sorry, if you want to use '{ $.xxx = "yyy" }' syntax, then surround the whole in ''(single quote).

    Future supports

    • Set IAM Role for subscription filter

    Install

    npm i serverless-plugin-subscription-filter

    DownloadsWeekly Downloads

    127

    Version

    1.0.7

    License

    MIT

    Unpacked Size

    16.7 kB

    Total Files

    4

    Last publish

    Collaborators

    • avatar