AWS EC2/RDS Instance Schedule
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
To provide Cloudaware with necessary permissions for instance start/stop schedule, apply the following Instance Scheduler policy in your AWS console:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "CaInstanceScheduler",
"Effect": "Allow",
"Action": [
"ec2:DescribeInstances",
"ec2:StartInstances",
"ec2:StopInstances",
"rds:DescribeDBInstances",
"rds:ListTagsForResource",
"rds:StartDBInstance",
"rds:StopDBInstance"
],
"Resource": [
"*"
]
}
]
}
The policy can be also downloaded in Cloudaware account: go to Admin → AWS Accounts → ADD AMAZON ACCOUNT → Using Access & Secret Keys → select Instance Scheduler in 'Please use one of those'.
Tag Keys
The list of tag keys that are used to set up instance start/stop:
Key | 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:
CODE
Example 2. Timezone Area/Location style:
CODE
|
default (required) | Default instance work hours. Can be either numeric or range with a hyphen separated by the slashes |
mon, tue, wed, thu, fri, sat, sun (optional) | Instance work hours for current day. Format is the same as key Example 1. Work hours:
CODE
Instance will be running from 9:00 to 16:59 all days except Saturday and Sunday. Example 2. Work hours:
CODE
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 |
Learn more about tagging resources in Cloudaware here.
Tag Examples
tz=UTC default=9-17 sat=9-11/15-17 sun=off
Description:
schedule timezone |
|
instance work hours |
|
tz=America/New_York default=off wed=0-5
Description:
schedule timezone |
|
instance work hours |
|