serverless: EventBridge event not correctly treat "true"

Bug Report

Description

  1. What did you do? Create lambda invoked via event from EventBridge

  2. What happened? oops, error 😃

  3. What should’ve happened? true not “true” in [{“exists”:“true”}]

  4. What’s the content of your serverless.yml file? https://pastebin.pl/view/8846bc90

  5. What’s the output you get when you use the SLS_DEBUG=* environment variable (e.g. SLS_DEBUG=* serverless deploy)

ServerlessError: An error occurred: CarDetailsToDynamoDBCustomEventBridge1 - Failed to update resource. Event pattern is not valid. Reason: exists match pattern must be either true or false. at [Source: (String)"{"detail-type":["Lambda Function Invocation Result - Success"],"source":["lambda"],"detail":{"responsePayload":{"license_plate":[{"exists":"true"}]}}}"; line: 1, column: 141] See details in CloudWatch Log: 2020/03/25/[$LATEST]c8287290ed044dfa98074c2e58e1e8bc.

https://pastebin.pl/view/03bde7c6

Similar or dependent issues:

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 5
  • Comments: 20 (6 by maintainers)

Most upvoted comments

Any updates? The issue still persists.

According to the following ticket in the SAM project, Cloudfront team is already working on it: https://github.com/awslabs/serverless-application-model/issues/1455

I can confirm that this now works for me. See activity on this this issue

I tried with this yaml and it deployed correctly:

source:
- aws.codepipeline
detail-type:
- CodePipeline Action Execution State Change
detail:
  type:
    owner:
    - exists: true
  version:
  - numeric:
    - ">"
    - 5

The same issue was also true for numeric values, but both booleans and numbers now works đŸ„ł