Cloud Cost Optimization, Product
5
min read

A Guide on AWS Instance Scheduler: What You Need to Know

A Guide on AWS Instance Scheduler: What You Need to Know
March 20, 2025

AWS Instance Scheduler helps cut down on compute costs by automatically turning off instances when they aren't needed. This is particularly useful for development environments or workloads that follow a predictable schedule, such as shutting down during evenings or weekends when no one is using them.

Instead of running instances 24/7, you can create customized schedules based on usage patterns. Some teams opt for always-stopped schedules, manually starting instances only when required.

This guide walks through setting up an AWS Instance Scheduler and applying it across multiple instances.

The Basics of AWS Instance Scheduler

AWS-Instance-Scheduler-Architecture
AWS Instance Scheduler Architecture

This CloudFormation template creates an environment for the AWS Instance Scheduler. The solution uses the following AWS services:

A CloudWatch event triggers the Lambda function whose job is to check the EC2 and RDS instances, find the appropriate tag for a schedule, and match it against the definition of that schedule saved in DynamoDB. After that, depending on the targeted state the Lambda function decides to turn off or turn on the EC2 or RDS instance.

The default behavior of this solution is to stop EC2 and RDS instances, not terminate or delete them, as terminated instances cannot be restarted. It is also a good idea to create an RDS Instance Snapshot before stopping the instances. Each new snapshot overrides the last one. This is part of setting up the stack and is explained in the next section.   

AWS also provides preconfigured templates to streamline setup, reducing the complexity of managing cloud components and resources manually. Additionally, users can implement advanced scheduling techniques, such as on-demand instance activation, to maintain flexibility while optimizing costs.

Understanding the AWS Instance Scheduling Process

Schedules actually define when the EC2 and RDS instances should be running. Each schedule has a unique name and its configuration is stored in the DynamoDB. 

The entire setup revolves around tagging, which is basically a label you give to an instance to be able to categorize it and later quickly identify it. Tags are defined with a key-value pair which you define. 

The AWS Instance Scheduler solution has a default tag key called Schedule. You can of course change it if you need. The tag value should be the unique name of the schedule you want to apply to the instance. Each time the Lambda function runs, it will retrieve the configuration for the schedule from the DynamoDB and apply it to the instance. 

For example you could define a tag with key: value = Schedule: work-days. The name work-days specifies a schedule where the instances should shut down on Friday evening and get started up on Monday morning. Therefore, the instances that are supposed to be covered by this schedule should be tagged with the key: value pair. In the example this is Schedule: work-days.

By defining schedules based on work hours or specific needs, you can automate cost-saving measures without manual intervention. In the next steps, we’ll walk through the process of creating and applying these schedules to multiple instances, making sure they operate only when needed

Step 1: Setting Up the AWS Instance Scheduler

Firstly make sure you’re signed in in your AWS account. The starting step is to launch the instance schedule stack in your AWS account. You can launch the cloud formation template, but keep in mind that it launches in the US East - N. Virginia region by default, so adjust the region according to your needs. Likewise, verify that the correct template is being used, and move to the next step. 

Instance-Scheduler-stack-Step1
Creating the Instance Scheduler stack - Step 1

Secondly, you need to define the Stack name and some specific parameters, like tag name (if you’d like to change the default tag name Schedule), which service you want to schedule: EC2, RDS or Both, whether you want and RDS instance snapshot before shutting down the resource, the frequency of running for the AWS Lambda function, whether you want CloudWatch metrics and logs and a couple more parameters.  

Instance-Scheduler-stack-Step2
Creating the Instance Scheduler stack - Step 2

Thirdly, leave the stack options as they are - empty. Continue to the last step, review the changes and deploy the stack by clicking on Create. In the AWS Console you can follow the status of the stack deployment. CREATE_COMPLETE means that the solution is deployed. 

Step 2: Defining Your Instance Schedule

Deployed-Instance-Scheduler-stack
Deployed Instance Scheduler stack

In your AWS console, the AWS Instance Scheduler stores configuration details in an Amazon DynamoDB table called ConfigTable. This table holds schedules and periods, with the most important parameter being the period, which defines when instances should be active. You can specify timeframes as precisely as hours, days, or months. At a minimum, the schedule must include one of the following: begintime, endtime, weekdays, months, or monthdays. The begintime determines when instances start, while endtime specifies when they stop, if only a start time is set, manual intervention is required to stop them.

The ConfigTable includes predefined schedule samples that you can use or customize based on your needs. These configurations help automate instance management, ensuring resources are available only when necessary. A typical period configuration might look like this:

Office-hours-sample-period
Office hours sample period

This period defines standard office hours, starting at 9 AM and ending at 5 PM, from Monday to Friday, making it ideal for UK business hours. You can adjust these periods directly in the AWS console to match your needs.

Schedules aren’t just for shutting down resources, they can also manage workload efficiency. For example, the Vertical Scaling on Weekdays schedule adjusts EC2 instance sizes, running smaller instances on weekends and micro instances during weekdays to optimize costs and performance.

Vertical-scaling-on-weekdays-schedule
Vertical scaling on weekdays schedule

Step 3: Tagging Instances for Scheduling

In order for a schedule to work, you need to tag the EC2/RDS instances you want the schedule to be applied on. You should use the tag key (the tag name you defined when creating the CFN stack - default value is Schedule) and the tag value - which is the name of the schedule stored in the Config table. When you find your resource you go to Manage Tags and enter the key-value pair defining the schedule. You can also use the Tag Editor to tag multiple instances at once.

tags-EC2-instance
Managing tags for an EC2 instance

Step 4: Monitoring with CloudWatch

With CloudWatch, you can keep an eye on the performance of your AWS instances. It tracks things like how much CPU is being used or if instances are up and running as expected. You can check the CloudWatch metrics to make sure the solution runs as it's designed to. In the CloudWatch console, there will be a namespace, such as <stackname>:InstanceScheduler (DevInstanceScheduler:InstanceScheduler in our case), where you can monitor these metrics. 

CloudWatch can also send you alerts or notifications if something isn’t right, helping you monitor the AWS instance scheduler’s activity to ensure your instances are starting and stopping on schedule, saving you time and money. This makes managing your resources easier and more efficient.

Create a Saving Schedule in Microtica

If you don’t feel like going through the hustle of launching and deploying a solution in your AWS console, you can use Microtica’s Cloud Waste Manager feature. All you have to do is:

  1. Sign up for free
  2. Connect your AWS Account
  3. Set permissions only for turn on/off of instances
  4. Go to Saving Schedules → Select an active time period for your instances
  5. Select the instances you want to apply the schedule to
  6. Activate
saving-schedule-microtica
Create a saving schedule in Microtica

Conclusion

To wrap up, AWS Instance Scheduler provides an effective way to manage EC2 and RDS instances, helping you reduce costs by automating start and stop times. Using tools like CloudWatch, Lambda, and DynamoDB, it streamlines resource management. Whether implementing basic schedules or more complex setups, this guide equips you with the knowledge to optimize AWS cost and usage, all while improving efficiency.

Frequently Asked Questions

What is an EC2 Scheduler?

An EC2 scheduler automates the start and stop of Amazon EC2 instances based on pre-defined schedules. This helps save costs by running instances only when needed, ensuring resources are efficiently managed and unused instances are turned off during off-hours.

What are Scheduled Instances in AWS?

Scheduled instances in AWS allow you to launch EC2 instances at specific times, repeating on a regular schedule. These instances are ideal for workloads that need to run periodically, such as development or test environments, to optimize cost and usage.

What is the Difference Between Instance Scheduler and Resource Scheduler in AWS?

An instance scheduler manages the start/stop times of EC2 and RDS instances based on predefined schedules. In contrast, a resource scheduler manages broader resource scheduling, including compute, storage, and network, to optimize cost and efficiency across various AWS services.