Allow 'active' tags, such as AWSBOX_TTL and AWSBOX_SCHEDULE #84

chilts opened this Issue Jul 16, 2013 · 1 comment


None yet
2 participants

chilts commented Jul 16, 2013

From #83, we are going to add tags to each instance, however, the difference between passive tags and active tags means we should do them separately.

To keep it simple for AWSBOX_SCHEDULE. Either 24/7 or 12/7 or 12/5, and a timezone adjustment.

For the 12 hours/ 7 days, and 12 hours/5 days (M-F) it will be from 6am to 6pm UTC.
Then people can adjust to their working hours:

AWS_SCHEDULE=12/5,-8 (6am to 6pm, monday to friday, pacific standard time)

people can use the hour offset value to tweak to their working day.

Lots of options :), maybe 0111110,6-18,-8 ... which is: day of week, hours of day, time zone ... i could go on forever :)

I guess the instance needs to be backed by an EBS, otherwise this won't work. Finally, what will be the 'thing' that starts and stops the instance?

The original thinking was too complex for what we need. To start out we'll do this:

  • cronjob will run the reaper every day, it will look for awsboxes
  • an awsbox is identified by the passive tag AWSBOX (#83)
  • if the AWSBOX is 5 days old, an email will be sent to the owner warning them that it will be shutdown in 2 days
  • if the AWSBOX is 6 days old, another email will be sent
  • if the AWSBOX is 7 days old, it will be terminated immediately
  • unless the AWSBOX_SPAREME tag exists. Then the AWSBOX will be spared for another week


  • this will spare the awsbox from the reaper for another 7 days

The Reaper

I think i will make this a part of the awsbox code base so things are kept together. The mechanism for running it will be cron, and it will use its own tag, AWSBOX_REAPER=timestamp of last touch to keep track of the last time the reaper inspected the box.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment