Git Product home page Git Product logo

serverless-plugin-subscription-filter's People

Contributors

dependabot[bot] avatar tsub avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

serverless-plugin-subscription-filter's Issues

A better error message in the case where a log group already has a subscription

I recently hit an issue where my deployment was failing with the error:

An error occurred while provisioning your stack
- Resource limit exceeded..

Being relatively new to serverless and AWS I didn't know what this message meant. It turns out after getting some help that I had already manually created a subscription filter for one of my lambdas and since I can only have one this error was occurring. It would be nice have a slightly more robust error message in this case. Something like below possibly:

    - Resource limit exceeded..

      You've hit a AWS resource limit:
      http://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/cloudwatch_limits_cwl.html

      Subscription filters: 1/log group. This limit cannot be changed.

Downcompile with babel

Turns out this plugin doesn't run on older versions of Node. I get an error when running on 4.3 (actual lambda on aws version):

SyntaxError: Unexpected token =

I believe this is because the code in this plugin is only supported by newer versions of node unless you use babel. So it would be nice if you would down compile before publishing for use in older versions of node. I can try to hookup a PR tomorrow.

The specified log group does not exist.

i get this error:

$ sls deploy --stage staging --region eu-west-1
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Compiling /aws/lambda/PHPErrors subscription filter object...

  Serverless Error ---------------------------------------

  The specified log group does not exist.

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com

  Your Environment Information -----------------------------
     OS:                     linux
     Node Version:           9.11.1
     Serverless Version:     1.30.0

serverless.yaml

service: php-errors

provider:
  name: aws
  runtime: nodejs8.10
  memorySize: 128
  environment:
    REGION: ${file(./config.js):${opt:stage}.REGION}
    TOKEN: ${file(./config.js):${opt:stage}.TOKEN}
    ROOM: ${file(./config.js):${opt:stage}.ROOM}
  iamRoleStatements:
  - Effect: Allow
    Action:
      - ec2:Describe*
    Resource: '*'
plugins:
  - serverless-offline
  - serverless-plugin-subscription-filter
functions:
  logs:
    handler: index.handler
    events:
      - subscriptionFilter:
          stage: staging
          logGroupName: /aws/lambda/PHPErrors
          filterPattern: '?"PHP Fatal" ?"WordPress database error" ?"PHP Parse error"'

what am i missing?

Subscription filter to Elastic Search

I would like to setup a subscription filter for a particular lambda to then stream into an elastic search instance. Is that scenario covered by this plugin?

Property error when multiple functions are defined in serverless.yml

When multiple functions are defined within serverless.yml this plugin encounters an unhandled property error during deployment. I think this is because I am not defining a subscriptionFilter event for all of my functions.

$ sls deploy
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Injecting required Python packages to package...

  Type Error ---------------------------------------------

  Cannot read property 'logGroupName' of undefined

     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com

serverless.yml

service: test-service

provider:
  name: aws
  stage: dev

functions:
  function1:
    handler: function1.lambda_handler
    timeout: 30
    runtime: python3.6
    events:
      - subscriptionFilter:
          stage: dev
          logGroupName: /aws/lambda/logGroup
          filterPattern: ERROR
  function2:
    handler: function2.lambda_handler
    timeout: 30
    runtime: python3.6
    events:
      - http:
          method: POST
          path: /

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.