- Newest
- Most votes
- Most comments
If this is something that has a persistent configuration then instance scheduler is a good fit. This way it will just start the instance when needed without much manual intervention needed. You can do persistent spot requests as well, which may lower your cost, but you run into the chance if a spot instance isn't available you might run into issues. https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-requests.html
I think I would set up an Auto Scaling Group with a Scheduled scaling policy and use a Spot instance defined in the ASG or Launch Template.
The options from both Rob_H and kentrad are both valid. Another possible option is to have a Lambda scheduled through Event Bridge to start the instance [1] and when the processing is done, a simple shutdown script can be executed on the machine (like /sbin/shutdown -h now). This way the instance is only running for the time it needs to be. I personally use this as it's the simplest for me to keep track of.
The lambda in the link has a stop option as well, I do not use that option, but it's available if it meets your needs.
[1] https://aws.amazon.com/premiumsupport/knowledge-center/start-stop-lambda-eventbridge/
Relevant content
- asked 2 years ago
- asked a year ago
- asked a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 4 years ago