Can i use amazon eventbridge to turn on an ec2 instance and run cron jobs

0

I want to run cron jobs on EC2 instances, But I don't want the instances to be running always. so is there a way I can use Evenbridge to automatically power on the instances at a specific time and run cron jobs? or should I follow any other methods?

Sarath
已提問 8 個月前檢視次數 455 次
2 個答案
1

Hello.

For such use cases, it would be a good idea to set up an Eventbridge scheduler.
This can be used to start or stop EC2 at a specific time.
https://docs.aws.amazon.com/scheduler/latest/UserGuide/what-is-scheduler.html

The following blog describes the automation of EC2 outages.
Automation of EC2 startup can be set up in the same way.
https://dev.to/aws-builders/easy-setup-for-ec2-stop-jobs-with-amazon-eventbridge-scheduler-4lpg

profile picture
專家
已回答 8 個月前
profile picture
專家
已審閱 8 個月前
profile pictureAWS
專家
已審閱 8 個月前
1

If all you need is a cron job, just use EventBridge Scheduler to define the schedule. The Scheduler can invoke a Lambda function to perform the actual work. No need for an EC2 instance.

profile pictureAWS
專家
Uri
已回答 8 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南