I am pretty new to AWS. We’re looking for a way to execute our node.js script like a cron job. There is Elastic Beanstalk application which runs a web server in node. In the same git repository, we’ll have a few lightweight services that will run periodically, probably one minute, to clean something from DB, sync some external data etc, nothing major.
What would be the best way to do this?
I would like to avoid using lambda, since we want the code to be locally testable and present in the repository.
Thanks in advance
2
Answers
Any service that can be subscribed to scheduled CloudWatch events.
If you don’t want to use Lambda, you could use ECS/Fargate to run scheduled tasks. The short version is it’s basically
docker run
on a cron schedule made easy.You could do it using following steps:
Here is an screenshot of EventBridge from AWS Console.
Reference – Using API destinations with Amazon EventBridge