Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

The EC2/RDS scheduler starts and stops EC2/RDS instances based on the cloudaware:scheduler tag value. Schedule tag value may consist of several fields separated by a space, each field in the format key=value.

IAM Policy

EC2

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "ec2:DescribeInstances",
                "ec2:StartInstances",
                "ec2:StopInstances"
            ],
            "Resource": "*"
        }
    ]
}

RDS

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "rds:DescribeDBInstances",
                "rds:ListTagsForResource",
                "rds:StartDBInstance",
                "rds:StopDBInstance"
            ],
            "Resource": "*"
        }
    ]
}

The list of keys

Value

Description

tz (required)

Timezone to be used by scheduler. Can be POSIX style abbreviation or “Area/Location” style from IANA Time Zone Database.

Example 1. Timezone POSIX style:

tz=EST

Example 2. Timezone Area/Location style:

tz=America/New_York

default (required)


Default instance work hours. Can be either numeric or range with a hyphen separated by the slashes /. It also can be the word off which mean that instance should be stopped all that day or on which mean that instance should be running. The work hours should be specified in 24-hour format

mon, tue, wed, thu, fri, sat, sun


Instance work hours for current day. Format is the same as key default.

Example 1. Work hours:

default=9-16 sat=off sun=off

Instance will be running from 9:00 to 16:59 all days except Saturday and Sunday.

Example 2. Work hours:

default=off wed=9/14-17

Instance will be running only on Wednesday from 9:00 to 9:59 and from 14:00 to 17:59.

policy (optional)


Scheduler mode. Can be start_at_time or stop_at_time which mean that the scheduler will check and change instance status only at time defined with keys default and mon .. sun.

Examples

tz=UTC default=9-17 sat=9-11/15-17 sun=off

Description:

schedule timezone

  • UTC;

instance work hours

  • from Monday to Friday: 9:00-17:59;

  • Saturday: 9:00-11:59 and 15:00-17:59;

  • Sunday: completely off;

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

Description:

schedule timezone

  • America/New York;

instance work hours

  • Wednesday: 00:00-5:59;

  • No labels