EventBridge Scheduler

0

Hi everone,

I am a newbie on AWS. I already went through materials on AWS training about Lambda, Networking and EventBridge and did some tests on my account but I couldn't solve my problems.

The problem: I have a Django web app that delivers auto text message to my clients. The client can pick date and time to specify when he wants us to send him a message on the front-end, this data is stored on PostgreSQL database. I want to build an architecture that every time a new date and time record is added on the database, the date and time data is sent to EventBridge to create a trigger (cron) for the lamdba function so that the lambda function will send message at the cron time.

The architecture is basically: RDS - > EventBridge -> Lambda

An ECS is hosting my web app.

My question is 2 fold:

  1. Is the above architecture the best one given the task? Or I should monitor the ECS as soon as the client submit the date and time form, we grab the data right there and send to EventBridge? don't wait until it hits the database.

2.What kind of event and how do I set it up on EventBridge? So that I can extract the date and time data I need so that I can use it as my cron for the lambda trigger? I am always confused with the concept of "event" (AWS materials says an event is like when an instance is launched or when it failes...etc) but can an event be like a new record is added to a database or a client submit a form on the front end?

Thank you a lot for reading such a long question as I just want to be precise on the problem.

Thanh

1 回答
0

To answer your questions in order:

  1. It's completely up to you. If it were me, where I have code on the EC2 instance that is receiving the form that is submitted by the client, I would insert the data into the database and then create the EventBridge event. But you could also do it with a trigger in your database. You might also have a periodic job that runs to ensure that the events in the database are in sync with EventBridge.
  2. You want to create a Scheduled event which is effectively "cron in AWS". From that event you can call other services. In this case you might consider launching a Lambda function to send the message to the client.
profile pictureAWS
专家
已回答 1 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则