Skip to main content

AWS EC2/RDS Instance Scheduler

Use the EC2/RDS Instance Scheduler to start and stop AWS EC2 and RDS instances according to the cloudaware:scheduler tag on each resource. The tag value defines the schedule as space-separated key=value fields.

This feature is most useful for development, test, lab, demo, and batch resources that have predictable idle periods. Avoid scheduling customer-facing or mission-critical resources unless the workload owner has approved the operating window and recovery expectations.

Before You Begin

Make sure that:

  • The AWS account is connected to Cloudaware. See AWS Setup Guide.
  • The Cloudaware AWS identity has the optional Instance Scheduler permissions. See Instance Scheduler.
  • Target EC2 and RDS instances can be safely stopped and started.
  • Resource owners have approved the schedule and time zone.
  • The cloudaware:scheduler tag can be applied to the target resources.

IAM Permissions

The scheduler needs permission to describe, start, and stop EC2 and RDS instances. Add the optional Instance Scheduler policy to the Cloudaware AWS role or IAM user used for the account.

For the policy document, see Cloudaware AWS IAM Policies - Instance Scheduler.

If you use access keys, Cloudaware also provides the policy in the AWS account setup flow:

  1. In Cloudaware, go to Admin.
  2. Select Amazon Web Services.
  3. Open the AWS Accounts tab.
  4. Click ADD AMAZON ACCOUNT.
  5. Select Using Access & Secret Keys.
  6. In CLOUDAWARE IAM POLICIES, select Instance Scheduler.

Scheduler Tag Format

Add the cloudaware:scheduler tag to each EC2 or RDS instance that Cloudaware should schedule.

The tag value must use this format:

tz=<Area/Location> default=<schedule> [mon=<schedule>] [tue=<schedule>] [wed=<schedule>] [thu=<schedule>] [fri=<schedule>] [sat=<schedule>] [sun=<schedule>] [policy=<mode>]

The tz field must be first in the tag value.

Schedule Fields

FieldRequiredDescription
tzYesTime zone used by the scheduler. Use the IANA Area/Location format, for example tz=America/New_York.
defaultYesDefault work hours for days without a day-specific override. Use a 24-hour number, a hyphenated range, multiple values separated by /, on, or off.
mon, tue, wed, thu, fri, sat, sunNoDay-specific work hours. These values override default for the selected day.
policyNoScheduler mode. Supported values are start_at_time and stop_at_time. With either mode, the scheduler changes instance state only at the times defined by default and day-specific fields.

Schedule Values

Use 24-hour time when defining work hours.

ValueMeaning
9-17Run from 09:00 through 17:59.
9/14-17Run from 09:00 through 09:59 and from 14:00 through 17:59.
offKeep the instance stopped for the day unless another field overrides it.
onKeep the instance running for the day unless another field overrides it.

Examples

Weekdays with Weekend Shutdown

tz=America/New_York default=9-17 sat=off sun=off

Result:

  • Monday through Friday: running from 09:00 through 17:59.
  • Saturday and Sunday: stopped.
  • Time zone: New York.

Exception Window Only

Use default=off when the instance should stay stopped except for specific approved windows.

tz=America/New_York default=off wed=0-5

Result:

  • Wednesday: running from 00:00 through 05:59.
  • All other days: stopped.
  • Time zone: New York.

Business Hours on Weekdays

tz=America/New_York mon=8-18 tue=8-18 wed=8-18 thu=8-18 fri=8-18 sat=off sun=off default=off

Result:

  • Monday through Friday: running from 08:00 through 18:59.
  • Saturday and Sunday: stopped.
  • Time zone: New York.

Split Overnight Operating Window

For instances that need to run around midnight, define separate ranges before and after midnight.

tz=America/New_York mon=0-2/22-24 tue=0-2/22-24 wed=0-2/22-24 thu=0-2/22-24 fri=0-2/22-24 sat=off sun=off default=off

Result:

  • Monday through Friday: running from midnight to 2 AM and again from 10 PM to midnight.
  • Saturday and Sunday: stopped.
  • Time zone: New York.

Scheduler Tag Generator

The Cloudaware Scheduler Tag Generator is also available as a template in S3.

Validation

After applying the scheduler tag:

  1. Confirm the EC2 or RDS instance has the cloudaware:scheduler tag.
  2. Confirm the tag value starts with tz=.
  3. Confirm the AWS role or IAM user includes the Instance Scheduler permissions.
  4. Confirm the time zone and operating hours with the resource owner.
  5. Wait for a test schedule window and verify that the instance state changes as expected.
  6. If the instance does not change state, review AWS permissions, tag spelling, and the configured schedule values.