https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-create-rule-schedule.html
-
on each job creation event create a “one time” event bridge schedule event
- name it using the job id so that its easy to delete later
- set the time to be what we expect the overall sla breach to be in future: say now() + 3 days
- need to set the flex window aptly (1~15 mins)
-
let the event bridge target be sqs (so that we can buffer and consume in a controlled rate)
- the sqs payload can contain the job-id,
- let this sqs be consumed by a lambda that does 2 things
- ensure deletion of the event-bridge schedule (if exists) : using the job-id in payload to derive the schedule name
- to clear up quota per aws acc
- catch and ignore ResourceNotFoundException while deleting to ignore sqs retries
- used the job-id to lookup details from tracker-db and forward it the action Q/notification downstream
- ensure deletion of the event-bridge schedule (if exists) : using the job-id in payload to derive the schedule name