Skip to content

Instantly share code, notes, and snippets.

@viperscape
viperscape / ec2-power.py
Last active June 8, 2016 16:55
script to power on/off ec2 instances based on block times, reassociates eip if needed and saves cache of eips when rerun
import boto.ec2
import sys
import datetime
from time import gmtime, strftime, sleep
import toml
# expects ec2 instance tag: power-off
# values should be in 24hr clock from:to
# eg 2400:0400
# would result in midnight to 4am