The Instance Scheduler on AWS solution automates the starting and stopping of Amazon Elastic Compute Cloud (Amazon EC2) and Amazon Relational Database Service (Amazon RDS) instances.
This solution helps reduce operational costs by stopping resources that are not in use and starting them when they are needed. The cost savings can be significant if you leave all of your instances running at full utilization continuously.
This solution includes a template that creates the AWS Identity and Access Management (IAM) roles necessary to start and stop instances in secondary accounts.
Instance Scheduler on AWS can automatically add tags to all instances it starts or stops. The solution also includes macros that allow you to add variable information to the tags.
This solution includes a command line interface (CLI) that provides commands for configuring schedules and periods. The CLI allows customers to estimate cost savings for a given schedule.
For Amazon EC2 instances, Instance Scheduler on AWS can use SSM maintenance windows defined in the same Region as the instances, and start and stop the instances for the maintenance window.
The diagram below presents the architecture that you can build using the solution's implementation guide and accompanying AWS CloudFormation template.
The AWS CloudFormation template sets up an Amazon CloudWatch event at a customer-defined interval. This event invokes the Instance Scheduler AWS Lambda function. During configuration, the user defines the AWS Regions and accounts, as well as a custom tag that Instance Scheduler on AWS will use to associate schedules with applicable Amazon EC2 and Amazon RDS instances.
These 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 Instance Scheduler on AWS, you define a tag key you will use to identify applicable Amazon EC2 and Amazon RDS instances. When you create a schedule, the name used as the tag value identifies the schedule applied to the tagged resource.
Step 4 (Optional)
When you select the CloudFormation parameter "Using AWS Organizations" and provide a valid Organization ID, an additional Event Bus resource is created which will receive events from the CloudWatch events from remote accounts. These events will provide an Account ID which will added to the solution configuration in DynamoDB.
This Guidance helps you set up a Cloud Financial Management (CFM) capability to manage and optimize your expenses for cloud services. This capability includes near real-time visibility and cost and usage analysis to support decision-making for topics such as spend dashboards, optimization, spend limits, chargeback, and anomaly detection and response.