Stop and Start instances using the AWS Instance Scheduler – STOPINATOR

DAY 6 – STOPINATOR- Start and Stop EC2 at predefined times 🔴🟢

☁️100 days of Cloud- Day Six
✅Follow Me on Twitter

Tweet This Blog – Read on GitHub – Read On iCTPro.co.nz

Stopping and starting EC2 instances automatically

Usi…


This content originally appeared on DEV Community and was authored by Anuvindh Sankaravilasam

DAY 6 - STOPINATOR- Start and Stop EC2 at predefined times 🔴🟢

☁️100 days of Cloud- Day Six
Follow Me on Twitter

Cover

Tweet This Blog - Read on GitHub - Read On iCTPro.co.nz

Stopping and starting EC2 instances automatically

Using Instance scheduler you can start and stop instance automatically using Cloud formation

Prerequisites

Installing Scheduler CLI

curl "https://s3.amazonaws.com/solutions-reference/aws-instance-scheduler/latest/scheduler-cli.zip" -o "scheduler-cli.zip"

Unzip

unzip scheduler-cli.zip

Install

sudo python setup.py install

Check

scheduler-cli --version

Creating AWS CloudFormation Stack

Launch Solution , or download template

Comments ScreenShots
Click on to Launch Solution Stack launch
Enter Stack Name Image StackName
Choose your frequency (in Mins) Image frequency
Enable CloudWatch Logs Image Cloudwatchlogs
Start & Stop tag Image startandstop
keep everything default and acknowledge then click create stack Image Stack creation

Creating Start and Stop Period

Go to instance and paste this script

scheduler-cli create-period --stack Ec2instanceScheduler --region ap-southeast-2 --name mon-fri-9-5 --begintime 9:00 --endtime 16:59 --weekdays mon-fri

Here i am setting up to start time 9 am and stop time 4.59 Pm from Monday to Friday.

Now go to AWS Console and open the DynamoDB.

Click on to Tables and choose the config table .
Then Choose the Items , and check for QuickPeriod appears under Name.

Creating Schedule for the period

Each schedule must contain at least one schedule period, it defines the time instance should run.

SSH into ec2

scheduler-cli create-schedule --stack Ec2Stopinator --name QuickSchedule --region ap-southeast-2 --periods QuickPeriod --timezone UTC+1300

goto the DynamoDB.

Click on to Tables and choose the config table .
Then Choose the Items , and check for QuickSchedule appears under Name.

Tagging the Schedule

Now go to ec2 and select Manage tags
Key = Schedule
Value = QuickSchedule

🎉 Congratulations 🎉 you have successfully configured STOPINATOR


This content originally appeared on DEV Community and was authored by Anuvindh Sankaravilasam


Print Share Comment Cite Upload Translate Updates
APA

Anuvindh Sankaravilasam | Sciencx (2022-02-11T11:54:04+00:00) Stop and Start instances using the AWS Instance Scheduler – STOPINATOR. Retrieved from https://www.scien.cx/2022/02/11/stop-and-start-instances-using-the-aws-instance-scheduler-stopinator/

MLA
" » Stop and Start instances using the AWS Instance Scheduler – STOPINATOR." Anuvindh Sankaravilasam | Sciencx - Friday February 11, 2022, https://www.scien.cx/2022/02/11/stop-and-start-instances-using-the-aws-instance-scheduler-stopinator/
HARVARD
Anuvindh Sankaravilasam | Sciencx Friday February 11, 2022 » Stop and Start instances using the AWS Instance Scheduler – STOPINATOR., viewed ,<https://www.scien.cx/2022/02/11/stop-and-start-instances-using-the-aws-instance-scheduler-stopinator/>
VANCOUVER
Anuvindh Sankaravilasam | Sciencx - » Stop and Start instances using the AWS Instance Scheduler – STOPINATOR. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/02/11/stop-and-start-instances-using-the-aws-instance-scheduler-stopinator/
CHICAGO
" » Stop and Start instances using the AWS Instance Scheduler – STOPINATOR." Anuvindh Sankaravilasam | Sciencx - Accessed . https://www.scien.cx/2022/02/11/stop-and-start-instances-using-the-aws-instance-scheduler-stopinator/
IEEE
" » Stop and Start instances using the AWS Instance Scheduler – STOPINATOR." Anuvindh Sankaravilasam | Sciencx [Online]. Available: https://www.scien.cx/2022/02/11/stop-and-start-instances-using-the-aws-instance-scheduler-stopinator/. [Accessed: ]
rf:citation
» Stop and Start instances using the AWS Instance Scheduler – STOPINATOR | Anuvindh Sankaravilasam | Sciencx | https://www.scien.cx/2022/02/11/stop-and-start-instances-using-the-aws-instance-scheduler-stopinator/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.