-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Closed
Labels
aws:eventsAmazon EventBridgeAmazon EventBridgestatus: resolved/staleClosed due to stalenessClosed due to stalenessstatus: response requiredWaiting for a response from the reporterWaiting for a response from the reportertype: featureNew feature, or improvement to an existing featureNew feature, or improvement to an existing feature
Description
Is there an existing issue for this?
- I have searched the existing issues
Feature description
AWS doc: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns-arrays.html
Currently, the event pattern does not match when a message contains the values in an array
Example:
pattern = {"detail": {"event": {"data": {"type": ["1", "2"]}}}}
# should match an event with the following format
{"event": {"data": {"type": ["3", "1"]}}}
as per AWS documentation
The preceding event pattern matches an event that includes the following field because the first item in the event pattern array matches the second item in the event array.
🧑💻 Implementation
Suggestion
def handle_prefix_filtering(event_pattern, value):
for element in event_pattern:
if isinstance(element, (int, str)):
if str(element) == str(value):
return True
if element in value: # added
return True # added
....
if the current element belongs to the value array in the event-pattern, return true
Anything else?
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
aws:eventsAmazon EventBridgeAmazon EventBridgestatus: resolved/staleClosed due to stalenessClosed due to stalenessstatus: response requiredWaiting for a response from the reporterWaiting for a response from the reportertype: featureNew feature, or improvement to an existing featureNew feature, or improvement to an existing feature