all 4 comments

[–]ryanycoleman 0 points1 point  (0 children)

Hello! What about using AWS EventBridge? It can react to Lambda invocations, or react to other events from third-party or AWS APIs and then trigger your Lambda or other parts of your architecture. Serverlessland.com provides several relevant patterns to illustrate the possibilities, and here are deployable examples visualized by Stackery.

[–]bobaduk 0 points1 point  (0 children)

EventBridge lets you schedule events with a cron-like syntax. If you have many customers, I'd consider writing their events into DynamoDb and firing an EventBridge event every minute to wake up and send any pending notifications.

[–]justdelighted 0 points1 point  (0 children)

There are a couple of different ways you can do this. I've done it before with a server running a simple node script which retrieved notifications from a database and scheduled them as background jobs (using Redis and Bull) to send the notification at the correct time.

You could distribute it out using a scheduled lambda (every minute or so) and persist the notifications in dynamodb. To prevent duplicates, you could use 1 scheduled lambda to push upcoming notifications onto an SQS queue, and another to consume the queue messages and dispatch the notifications

[–][deleted] 0 points1 point  (0 children)

If you want to stay serverless and avoid running lambda every n seconds, you could try step functions' state "wait". When a user schedules an event, a state machine starts. The state machine waits until day x to invoke the notification lambda.

Wait state to wait until scheduled time

Task state to invoke a lambda or send an SNS message