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.
Asked
Active
Viewed 432 times
0
-
You want an create s3 event-notification or a scheduled job? – Kapil Shukla Jan 19 '22 at 18:09
-
that is the point if no event happens in 4 hours then trigger – rollmaster Jan 19 '22 at 18:35
1 Answers
1
You could emulate this behaviour by having 2 Event-Bridge rules and a lambda.
- The first rule simply triggers every 4 hours
- The second rule matches S3 events, and triggers the lambda
- 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

Manuel Díaz
- 51
- 2