Reputation: 4927
I'd like to run a very light ruby script once a day and then shutdown my Elastic Cloud instance on AWS in order to reduce its costs.
Is it possible to schedule an instance to auto-start once a day, run a script for one hour and then shut-down?
Upvotes: 0
Views: 289
Reputation: 446
You can do this with the help of Lambda and CloudWatch.
Please refer: https://aws.amazon.com/premiumsupport/knowledge-center/start-stop-lambda-cloudwatch/
Upvotes: 0
Reputation: 3152
This article covers how to use auto-scaling to launch your instance for a short time to run a job.
As for the job itself, you can trigger it's execution on startup by any of the methods suitable to your OS/environment. Some are listed on this page.
Upvotes: 2