Verify Instance Scheduler Configuration

With a sample environment deployed, we can now proceed to verify the default configuration available for the Instance Scheduler solution.

To configure the scheduler, you can use the scheduler-cli tool preinstalled into an EC2 instance in the sample environment named walab-admin-instance. The admin instance in this lab is accessible using SSM Session Manager. In order to login to the walab-admin-instance instance follow the steps below:

  1. Open the EC2 Console using below link:

  2. Select the instance named walab-admin-instance, and click on the Connect button:

section2_1_schedulerconfiguration

  1. Click on Session Manager as a connection method, and click on Connect:

section2_2_schedulerconfiguration

  1. You have now logged in into the walab-admin-instance, without using SSH or a bastion, and you can configure the Instance Scheduler solution using the scheduler-cli command line.

    • Note: The Instance Scheduler can stop/start EC2 and RDS instances based on a customizable set of schedules. Schedules might contain several periods. Refer to the Sample schedule documentation for more information.
  2. Execute below command to see the available options of the cli, including how to list the preinstalled schedules and time periods:

scheduler-cli -h

section2_3_schedulerconfiguration

  1. In this lab we will leverage the predefined schedules, defining new schedules is outside the scope of this lab. Execute the following command to see the schedules that are preinstalled:
scheduler-cli describe-schedules --region us-east-1 --stack InstanceScheduler

section2_4_schedulerconfiguration

  1. We will use the preinstalled schedule named “seattle-office-hours”, this schedule will stop the instances with a tag key “Schedule”, and a tag value “seattle-office-hours” outside the period “office-hours” in the timezone “US/Pacific”:

section2_5_schedulerconfiguration

  1. Execute below command to see the list of periods pre-configured:
scheduler-cli describe-periods --region us-east-1 --stack InstanceScheduler

section2_6_schedulerconfiguration

  1. The period “office-hours” highlighted above defines the period for which the instances associated with it should be running: From 9:00 AM to 5:00 PM, Monday to Friday.

    Using this schedule for any “dev” (non-prod) instances will allow to save costs and reduce energy consumption by 76% as they will run only 24% of the time (8 hours per day * 5 days).

    In other words, every week, instances that include the tag key/value “Schedule=seattle-office-hours” will run for 8*5=40 hours instead of 24*7=168 hours.


You have now completed this section of the lab.

In the next section we will explore how to use the AWS Resource Groups Tag Editor in combination with the Instance Scheduler solution for making sure our “dev” (non-prod) instances are shut-down outside of business hours.

Click on Next Step to continue with the next section.