Complex event pattern in AWS(scheduled AND event-based)

I want to create an even pattern in AWS which will do the following: s3 event happens OR (if anything has not happened in the last 4 hours) every 4 hours. There is custom event pattern and schedule event, but i can't find how to chain both.


You could emulate this behaviour by having 2 Event-Bridge rules and a lambda.

  1. The first rule simply triggers every 4 hours
  2. The second rule matches S3 events, and triggers the lambda
  3. The lambda updates the first rule, updating the cron expression so that it would execute every 4h, counting from the moment the lambda was triggered

That way each time the second rule matches an event, the first rule will be delayed by 4 hours