Serverless-application-model: EventBridgeRule fails to deploy when using content based filtering

Created on 17 Feb 2020  路  8Comments  路  Source: aws/serverless-application-model

Description:
EventBridgeRule event source can't handle numeric or exists matching as described here

Steps to reproduce the issue:
Create a EventBridgeRule event mapping like

"Pattern": {
  "source": [
    "test-source"
  ],
  "detail": {
    "name": [
      {
        "exists": true
      }
    ],
    "age": [
      {
        "numeric": [
          ">",
          25
        ]
      }
    ]
  }

Observed result:
Deploy fails with the following error from CloudFormation:

The following resource(s) failed to create: [TestFunctionEventBridge].          
Resource creation cancelled                                                
Event pattern is not valid. Reason: exists match pattern must be either    
true or false.  at [Source: (String)"{"source":["test-source"],"detail":{" 
name":[{"exists":"true"}],"age":[{"numeric":[">","25"]}]}}"; line: 1,      
column: 56] (Service: AmazonCloudWatchEvents; Status Code: 400; Error      
Code: InvalidEventPatternException; 

It looks like the issue is that both true and 25 got converted to strings.

Most helpful comment

Any update on this?

All 8 comments

This bug is actually inside the CloudFormation service, not Serverless Application Model itself.

I have submitted a fix internally, and will update once the fix is deployed globally

@nikp

Any idea when this fix will get deployed? Heard from the AWS support that it should've been rolled out already, but doesn't seem to be the case.

We're getting quite deep into writing over-complicated event patterns as workarounds

@ljacobsson unfortunately the CloudFormation deployment had to be rolled back due to an unrelated bug. The new global deployment is starting next Tuesday.

Any update on this?

We are still getting this error, any updates? 馃檹

The problem still persists.

@nikp any idea when the fix will get deployed? It still seems to be failing, and there does not seem to be a good workaround for that.

Check this out!

I can confirm that this indirectly fixed this bug :partying_face:

Made me very happy :-)

Was this page helpful?
0 / 5 - 0 ratings