Configure the solution - Instance Scheduler on AWS

Configure the solution

Once the solution has been deployed, you can configure scheduling on the hub control stack.

Step 3: Configure schedules and periods

Note

IThe solution can support any number of schedules, each of which can contain one or more periods that define when instances controlled by that schedule should be running. For more information, refer to Schedules and Periods.

Using Infrastructure as Code (Recommended)

Instance Scheduler on AWS provides an AWS CloudFormation CustomResource that you can use to manage your schedules and periods using Infrastructure as Code (IaC).

For information on how to manage schedules using IaC, please refer to Manage Schedules Using Infrastructure as Code (IaC).

Using the Amazon DynamoDB Console and Instance Scheduler CLI

Important

If you used the custom resource to manage any schedules using IaC, you must not use the DynamoDB console or scheduler CLI to delete or modify those schedules or their periods. If you do, you will create a conflict between the stored parameters in CloudFormation and the values in the table. Also, do not use periods managed by CloudFormation in schedules created using the DynamoDB console or the scheduler CLI.

When deploying the Instance Scheduler Hub Stack, the solution created an Amazon DynamoDB table containing several sample periods and schedules that you can use as a reference to create your own custom periods and schedules. To create a schedule in DynamoDB, modify one of the schedules in the configuration table (ConfigTable) or create a new one. To create a schedule using the CLI, first install the Scheduler CLI and then use the Available commands.

Note

For examples of how to create several sample schedules using IaC, DynamoDB, and the InstanceScheduler CLI, please refer to Sample schedule.

Step 4: Tag your instances

When you deployed the AWS CloudFormation template, you defined the name (tag key) for the solution’s custom tag. For the Instance Scheduler to recognize an Amazon EC2 or Amazon RDS instance, the tag key on that instance must match the custom tag key. Therefore, it is important that you apply tags consistently and correctly to all applicable instances. You can continue to use existing tagging best practices for your instances while using this solution. For more information, refer to Tagging Your Amazon EC2 Resources and Tagging your Amazon RDS resources.

On the AWS Management Console, use the Tag Editor to apply or modify tags for multiple resources at a time. You can also apply and modify tags manually in the console.

Setting the tag value

When you apply a tag to a resource, use the tag key you defined during initial configuration. Set the tag key to Schedule and set the tag value to the name of the schedule that should apply to the instance. If you would like to change the tag key, you can do so by updating the solution parameters.

Note

For Amazon RDS instances, the tag value can be from 1 to 256 Unicode characters in length and cannot be prefixed with aws. The string can contain only the set of Unicode letters, digits, white-space, '_', '.', '/', '=', '+', '-' (Java regex: "^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-]*)$"). For more information, refer to Tagging Your Amazon RDS Resources.

EC2 Instances with Encrypted EBS Volumes

If your EC2 instances have EBS volumes encrypted with customer-managed KMS keys, you must give the instance scheduler role the KMS:CreateGrant permission to be able to start those instances. For more information, refer to Encrypted EC2 Instances Not Starting.