HOW TO SCHEDULE AN EC2 INSTANCE ?




When we talk about cloud service, There is not doubt that AWS is best cloud service provider and AWS providing one the best service to its customer. So there is possibility that some of the customer might complain about cost of AWS instance. But here is the thing that AWS is also giving you many ways that you can save dollars ( $ ) . Only thing is here is that you need to find way to save cost for your AWS cost means AWS give you food but they not gonna serve you, you need to eat by yourself at right time.
 
 So here I came up the way to save instance cost by scheduling an EC2 Instance. If you are instance in some particular time period or Let say I need instance for 8 hours a day because I am using this instance in development. So we can schedule an EC2 instance in this case and save instance cost. It is very simple way to save cost. 

Follow below Steps and schedule an Instance : - 

Step 1 :-  Login to AWS and open cloud formation console, Start new stack with click on create new stack button. Here to you need to select below option. AWS is providing cloud formation template to schedule an instance. You can download from this link . Or you can launch template remotely from this this link .




Step 2 :- In this step, you need to specify some details as per your requirement.  So start with giving your stack name, most of the details we are not going to change and leave as it is. Below are some of the details. 

 

  • Instance Scheduler tag name :- this is use for tag an EC2 or RDS instances.
  • Service(s) to schedule :-  choose EC2 or RDS, or Both to apply as per you need
  • Region(s) :-  leave blank for your current region.
  • Default time zone :-  default value is UTC, you can change if you require but I suggest you to choose UTC time zone. 
  • Cross-account role :-  leave blank for current account.
  • This account, pick Yes for current account.
  • Frequency :- It is frequency time when lambda will triggered for schedule instance
  • Memory size :- size of Lambda function that run the scheduler. if you deal with large number of instance, make sure to increase memory size.
  • Enable cloud watch logs for troubleshooting 
  • started tags :- state= started 
  • stopped tags :- state=stopped


Step 3 :- Now click on next and leave all other option as it is. Review your parameter and and create stack. It will take some time to create stack.



Step 4 :-  Now, Scheduler stack is created. You need to assign tag to instance.But before open DynamoDB.Here config, scheduler and maintenance table are created by cloud formation stack. In config table you can change timezone, time of schedule etc.. . You can scale up and down also by tagging an instance.


 

Step 5 :-  If you want to schedule instance as per uk-office hour ( you can find time by clicking on period) time, you need to give tag name to Instance which we need to schedule. 


And that's it, Now your instance will star and stop in office-hour tag time. You can show instance start and stop in Scheduler table in DynamoDB. Cloud formation and lambda function will charge you But its is very less compare to instance up time
             It is quick guide about instance scheduler But you can find many more things about on it. Thank you....







Comments

Popular posts from this blog

Different Ways to change .Pem file of AWS instance Part : - 2 ( Using Reset-Access Document )

Contact Me

Name

Email *

Message *