Alerts for running EC2 instances

As a Juju developer I’m always creating and destroying EC2 environments. Sometimes I create more than I destroy which leads to a small hemorrhage of cash, which leads to a sinking feeling in the pit of my stomach when I discover what I’ve done.

So I’m experimenting with this little cron-based reminder system. It may be simultaneously too annoying when I’m sitting in front of my computer and wholly ineffective if I’m away for long periods of time. Suggested improvements welcome.

AWS_ACCESS_KEY=your key here
AWS_SECRET_KEY=your secret here

*/5 * * * * /usr/bin/ec2-describe-instances -O $AWS_ACCESS_KEY -W $AWS_SECRET_KEY | grep INSTANCE && DISPLAY=:0.0 /usr/bin/notify-send –urgency=critical -i terminal -t 10000 “EC2 instances running”