Skip to content

Excluding lambda events breaks serverless since serverless 1.52 #11

@Jaystified

Description

@Jaystified

For example, for a serverless.yml similar to this:

service: "test"
provider:
  stage: "${opt:stage}"
  name: "aws"
functions:
  foo:
    handler: "handler.foo"
    events:
      - sns: "bar"
plugins:
- "serverless-plugin-ifelse"
custom:
  serverlessIfElse:
    - If: '"${opt:stage}" == "dev"'
      Exclude:
        - "functions.foo.events"

The above worked until serverless 1.52.0 (excluding). After the 1.52.0 release it outputs the following when trying to use the following:
TypeError: Cannot read property 'find' of undefined
Manually setting foo to have no events still allows packaging and deploying successfully, so I suspect this is a plugin bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions