-1

In a Cloudwatch Event, we can write filter rules on source, details etc. How I'm doing it currently is as shown below,

  DefaultEventsRule:
    Type: AWS::Events::Rule
    Properties:
      Name: "CloudWatchRule1"
      Description: "Match events and send them to corresponding queue for delivery."
      EventPattern:
        {
          "source": ["xyz"],
          "resources":
              ...

Is it possible to do regex operation on that source? It looks like it is not possible to write regex on events; there is another question out there in SO asking a similar question (for destination), and the workaround was to use separate rules, seems that is the only way for source too.

Ref: regex-in-cloudwatch-event-pattern-matching

Jimson James
  • 2,937
  • 6
  • 43
  • 78

1 Answers1

0

As of now RegEx is not supported. Maximum you can do is to use complex filter with EventBridge See details content-filtering-with-event-patterns.

Also see the answers in this SO question, regex-in-cloudwatch-event-pattern-matching which helped me.

Hope AWS guys will add RegEx matching in future!

Jimson James
  • 2,937
  • 6
  • 43
  • 78