Appendix E: Sample Schedule
The AWS Instance Scheduler enables customers to automatically start and stop Amazon Elastic Compute Cloud (Amazon EC2) and Amazon Relational Database Service (Amazon RDS) instances. The following section shows how to configure the periods and schedule required to run instances Monday 9 am ET to Friday 5 pm ET. Since Monday and Friday are not full days, this schedule includes three periods to accommodate: Monday, Tuesday-Thursday, and Friday.
Periods
The first period starts tagged instances at 9 am Monday and stops at midnight. This period includes the following fields and values.
Field | Value |
---|---|
begintime |
09:00 |
endtime |
23:59 |
name |
mon-start-9am |
weekdays |
mon |
The second period runs tagged instances all day Tuesday through Thursday. This period includes the following fields and values.
Field | Value |
---|---|
name |
tue-thu-full-day |
weekdays |
tue-thu |
The third period stops tagged instances at 5 pm on Friday. This period includes the following fields and values.
Field | Value |
---|---|
begintime |
00:00 |
endtime |
16:59 |
name |
fri-stop-5pm |
weekdays |
fri |
Schedule
The schedule combines the three periods into the schedule for tagged instances. The schedule includes the following fields and values.
Field | Value |
---|---|
name |
mon-9am-fri-5pm |
periods |
mon-start-9am,tue-thu-full-day,fri-stop-5pm |
timezone |
America/New_York |
Instance Tag
To apply this schedule to instances, you must add the Schedule=mon-9am-fri-5pm
tag to the instances. Note that if you changed the default tag name in the AWS CloudFormation
Instance Scheduler tag name parameter, your tag will be different. For example, if you entered Sked
as your tag name, your tag will be Sked=mon-9am-fri-5pm
.
Scheduler CLI
To configure the above schedule using the Instance Scheduler CLI, use the following commands:
scheduler-cli create-period --stack
<stackname>
--name mon-start-9am --weekdays mon --begintime 9:00 --endtime 23:59 scheduler-cli create-period --stack<stackname>
--name tue-thu-full-day --weekdays tue-thu scheduler-cli create-period --stack<stackname>
--name fri-stop-5pm --weekdays fri --begintime 0:00 --endtime 17:00 scheduler-cli create-schedule --stack<stackname>
--name mon-9am-fri-5pm --periods mon-start-9am,tue-thu-full-day,fri-stop-5pm --timezone America/New_York