Automate stop and start schedules
Overview
The Instance Scheduler on
AWS
The Instance Scheduler on AWS also offers cross-account instance scheduling,
automated tagging, and the ability to configure schedules or periods by using a
command-line interface or the AWS Systems Manager
Case studies
Consider the example of a company that uses Instance Scheduler on AWS in a production environment to automatically stop instances outside of business hours every day. If this company leaves all of its instances running at full utilization, they can achieve up to 70 percent cost savings for those instances that are only necessary during regular business hours. The following chart shows how the weekly utilization is reduced from 168 hours to 50 hours.

Consider another example. The electric utility company Jamaica Public Service
Company Limited (JPS) migrated its database to Amazon RDS. Now, JPS uses Amazon EC2 to host
API services and run other applications. For JPS, Instance Scheduler on AWS became
the key tool for managing non-production environments. JPS used the Instance
Scheduler on AWS to reduce development costs and manage EC2 instances based on
team needs and work schedules. This helped JPS reduce costs by 40 percent. For more
information, see the AWS case study Jamaica Public Service Migrates Efficiently to the Cloud, Reduces Costs by 40%
Using AWS Instance Scheduler
Cost optimization scenario
The following example scenario helps illustrate the cost advantages of using Instance Scheduler on AWS. In this scenario, a major retail company in Singapore deploys two Windows environments on Amazon EC2. The first environment, known as workload A, is utilized by the marketing team to analyze real-time in-store transactions while the stores are open. The second environment, known as workload B, is reserved for the accounting team, which works only during regular business hours. The current operating schedule of both environments (24/7) is not ideal given current usage patterns and requires optimization to reduce the company's operating costs.
The following diagram shows the monthly cost before optimization.

For example, there are 31 days in the month of March, out of which 23 are weekdays. If the marketing team uses Instance Scheduler on AWS and operates their instances only when needed (that is, for 321 hours per month instead of 730 hours per month), they could potentially save $932.52 each month. This amounts to a 56 percent reduction in operating costs. The accounting team can experience significant advantages as well, with their instance usage time dropping from 730 hours per month to 230 hours. This results in a reduction of $1,140, or 68.5 percent. The company could save a combined total of $2,072.52 per month (equal to a 62 percent reduction), or $24,870.24 annually.
The following diagram shows the monthly cost after optimization.

Note
The pricing for this example was determined by using the AWS Pricing Calculator
Cost optimization
recommendations
This section explains how to deploy and configure the Instance Scheduler on AWS based on the example scenario covered in the previous Cost optimization scenario section. We recommend that you take the following next steps to optimize your costs by using the Instance Scheduler on AWS:
-
Launch the Instance Scheduler stack
-
Configure periods
-
Configure schedules
-
Tag instances
The following architecture diagram shows what's created in the AWS Cloud by the Instance Scheduler stack.

The diagram shows the following workflow steps:
-
An AWS CloudFormation template sets up an Amazon CloudWatch event at an interval that you define. This event invokes an AWS Lambda function. During configuration, you define the AWS Regions and accounts. You also define a custom tag that Instance Scheduler on AWS uses to associate schedules with applicable Amazon EC2 instances, Amazon RDS instances, and clusters.
-
The schedule configuration values are stored in Amazon DynamoDB, and the Lambda function retrieves them each time it runs. You can then apply the custom tag to applicable instances.
-
During initial configuration of the Instance Scheduler, you define a tag key for identifying applicable Amazon EC2 and Amazon RDS instances. When you create a schedule, the name you specify is used as the tag value that identifies the schedule that you want to apply to the tagged resource.
Launch the Instance Scheduler stack
This section shows you how to launch the CloudFormation stack for the Instance Scheduler on AWS.
Note
You're responsible for the cost of the AWS services used while running
Instance Scheduler on AWS. As of January 2023, the cost for running this
solution with default settings in the us-east-1
Region is
approximately $9.90 per month for Lambda charges, or less if you have a Lambda
free tier monthly usage credit. For more information, see the
Cost section of the Instance
Scheduler on AWS Implementation Guide in the AWS Solutions
Library.
To launch the instance scheduler stack, complete the following steps.
-
Sign in to the AWS Management Console
and choose Launch solution (downloadable template) to launch instance-scheduler-on-aws.template
CloudFormation template.Note
You can also download the template
as a starting point for your own implementation. -
The template launches in the US East (N. Virginia) Region by default. To launch Instance Scheduler in a different Region, use the Region selector in the console navigation bar.
Note
This example uses the Asia Pacific (Singapore) Region.
-
On the Create Stack page, in the Prerequisite - Prepare template section, verify that the Template is ready option is selected. In the Template source section, verify that the Amazon S3 URL option is selected.
-
Verify that the correct template URL is in the Amazon S3 URL text box, and then choose Next.
-
On the Specify stack details page, assign a name to your solution stack. For information about naming character limitations, see IAM and STS Limits in the AWS Identity and Access Management (IAM) documentation. The stack name for the example in this guide is called
MyInstanceScheduler
.Note
The stack name can't contain more than 28 characters.
-
Under Parameters, review the parameters for the template and modify them as necessary.
-
Choose Next. On the Configure stack options page, choose Next.
-
On the Review page, review and confirm the settings. Select the box acknowledging that the template will create IAM resources.
-
Choose Create to deploy the stack.
Configure periods
After you deploy the CloudFormation template, the solution creates a DynamoDB table that contains sample period rules and schedules that you can use as a reference to create your own custom period rules and schedules. For an example period configuration, see Sample schedules in the Instance Scheduler on AWS documentation.
To complete the step for this scenario, you must generate periods that correspond to each workload and meet their specific needs. For example:
Period 1 (Workload A):
Name: retail-hours
Days: Monday to Sunday
Hours: 1100 - 2300
Period 2 (Workload B):
Name: office-hours
Days: Monday to Friday
Hours: 0800 - 1800
To configure periods, complete the following steps:
-
Sign in to the DynamoDB console
and make sure you're in the same Region where you launched the CloudFormation template for the Instance Scheduler on AWS. -
In the navigation pane, choose Tables, and then select the table named ConfigTable.
-
Choose Explore table items.
-
To create a period for office hours, select period for the office-hours item.
-
On the Edit item page, change the value of begintime to 0800 and endtime to 1800. Leave the default value in place for weekdays.
Note
The begintime and endtime values determine when the instances should be started and stopped, while the weekdays value determines which days of the week this schedule applies to (Monday to Friday for this example).
-
Choose Save changes.
-
To duplicate the office-hours period and use it to create a new period for retail hours, select period for the office-hours item. Then, from the Actions menu, choose Duplicate item.
-
Modify the attributes to match your needs. The following attributes are used to meet the requirements of the example scenario:
type: period name: retail-hours begintime: 11:00 description: Retail hours endtime: 23:00 weekdays: mon-sun
-
Choose Create item.
-
In the DynamoDB ConfigTable, identify the two periods that you just created listed in the item lists.
Configure schedules
In the context of Instance Scheduler on AWS, schedules refer to the application of one or more periods and the relevant time zone. These schedules are then assigned to your instances as tags. This section shows you how to create two schedules (shown below) to accommodate the varying time patterns of the two example workloads, and then associate the schedules with the periods that you created in the previous section.
Schedule 1:
Name: singapore-office-hours
Period: office-hours
Timezone: Asia/Singapore
Schedule 2:
Name: singapore-retail-hours
Period: retail-hours
Timezone: Asia/Singapore
To create and configure schedules, complete the following steps:
-
Sign in to the DynamoDB console
and make sure you're in the same Region where you launched the CloudFormation template for the Instance Scheduler on AWS. -
In the navigation pane, choose Tables, and then select the table named ConfigTable.
-
Choose Explore table items.
-
To duplicate the UK office hours schedule and use it to create a new schedule for your office hours (Singapore office hours, for this example), select schedule for the uk-office-hours item. Then, from the Actions menu, choose Duplicate item.
-
Modify the attributes to match your needs. The following attributes are used to meet the requirements of the example scenario:
type: schedule name: singapore-office-hours description: Office hours in Singapore periods: office-hours timezone: Asia/Singapore
-
Choose Create item.
-
Repeat steps 4–6 to create a schedule for Singapore retail hours using the following attribute values:
type: schedule name: singapore-retail-hours description: Retail hours in Singapore periods: retail-hours timezone: Asia/Singapore
-
In the DynamoDB ConfigTable, identify the two schedules and two periods that you created.
Tag instances
After you establish your schedules, you must uses tags to allocate the schedules to the specific instances that you want to use. You can use the tag editor within AWS Resource Groups to generate and assign tags to your Amazon EC2 instances.
-
Sign in to the AWS Management Console
and make sure you're in the same Region where you previously launched the CloudFormation template. -
Open the Resource Groups console
. In the navigation pane, expand Tagging, and then choose Tag Editor. -
In the Find resources to tag section, for Regions, choose your Regions. For Resource types, choose Amazon EC2 or Amazon RDS. This scenario focuses on the Amazon EC2 instances in workload A. The marketing team is using workload A in the Singapore Region. The resources for this workload are already tagged with a Department key and a Marketing value. You can use this tag to search for the instances.
-
Choose Search resources.
-
Select the instances that you want to include in the schedule from the list of search results, and then choose Manage tags of selected resources.
-
In the Edit tags of all selected resources section, choose Add tag to add the Instance Scheduler schedule tags to your EC2 instances. You can use the tag keys and values that match schedulea (previously created in DynamoDB).
-
For Tag key, add Schedule. For Tag value, enter singapore-retail-hours.
-
Choose Review and apply tag changes.
-
To apply the tag to all the EC2 instances that you selected, choose Apply changes to all selected.
-
Repeat steps 3–9 for any additional schedules you wish to apply.
Validate results
We recommend that you use AWS Cost Explorer
-
View and analyze the costs associated with your EC2 instances, including instances managed by Instance Scheduler.
-
Filter your Cost Explorer view by tags so that you can focus on specific workloads and get a granular view of the cost savings achieved by using Instance Scheduler.
-
Gain insights into the financial impact of using Instance Scheduler.
-
Identify opportunities for further cost optimization and make data-driven decisions to optimize your AWS spending.
The following charts illustrate the cost of operating workload A and workload B during a seven day period (Monday–Sunday) before optimization by using Instance Scheduler.
Combined total expenses of workloads A and B

Workload A expenses

Workload B expenses

In this scenario, Cost Explorer shows the cost reductions that result from implementing Instance Scheduler on AWS. The following charts depict the operational costs of workload A and workload B for a period of seven days (Monday–Sunday) post-optimization.
Combined total expenses of workload A and B

Workload A expenses

Workload B expenses

Additional resources
-
Automate starting and stopping AWS instances (Instance Scheduler on AWS documentation)
-
Back to Basics: Using an Instance Scheduler to Control Amazon EC2 and Amazon RDS Resource Costs
(YouTube) -
Tagging your AWS resources (Tagging AWS Resources User Guide)
-
Analyzing your costs with AWS Cost Explorer (AWS Billing and Cost Management documentation)