Using Resource Scheduler to stop and start EC2 instances
Start by logging on to your AWS console, with an admin account.
- Browse to https://console.aws.amazon.com.
- Go to Systems Manager, and click Quick Setup.
- In the Resource Scheduler section, click the Create button.
- Instance Tag: Enter a key and a value (e.g. Schedule, WorkingHours).
- Select a Time Zone.
- Choose the days that you want the schedule to run.
- Enter Start instance time (e.g. 9am)
- Enter Stop instance time (e.g. 5pm)
- Choose Current Region, to apply this schedule to your current region only, alternatively you can select multiple regions.
- Read the Summary to confirm your settings.
- Click Create button.
For this schedule to be applied to specific instances you will need to tag them.
- Go to Services > EC2.
- Select the Instance, by clicking its checkbox.
- Select the Tags tab.
- Click the Manage tags button.
- Add a new Tag with a Key and a Value to match your schedule (e.g. Schedule, WorkingHours).
You should find that your instance will start and stop according to the schedule that you've set. You can still manually start and stop the instance outside the schedule times, but if the instance is running it will automatically stop at the stop time, and if it isn't running, it will automatically start at the start time.
Thanks for visiting,