and do some other stuff too, sometimes

February 25, 2015 — 10:52 PM UTC

So in our adventures at Leaf, building out our new environment, Will and I ran into a persistent problem – EC2 doesn’t guarantee that an instance will ever be shut down gracefully. No guarantees for upstart scripts, /etc/init.d, whatever. This is particularly problematic for dealing with Chef, where an instance needs to be deleted from the Chef datastore when it goes away. If you don’t, knife search will happily return tens or hundreds of nodes that no longer exist. Which is great.

No, wait. It’s crap.

Enter asger. Since autoscaling groups can publish notifications to SNS, asger will watch an SQS queue subscribed to SNS and execute arbitrary tasks based on the up/down pattern. Created nodes invoke up functions, terminated nodes invoke down functions, life is good. Currently there’s a task for deregistering Chef nodes, but asger is pretty flexible–Route 53 subscriptions, tie-ins to systems like Consul, that sort of thing. You can get asger via RubyGems with gem install asger or on GitHub; use it in good health.

My name's Ed, and I run a little devops consultancy; my thing is making other developers better and making the systems I oversee smarter, faster, and more reliable.

But I'm a human first. So I'm more interested in that. Tech is part of but not all of my life, and I'd rather talk to you about books or music or video games than about code or rapid deployment. I sometimes write about those things when they're interesting, but I'm much more into the questions of how we as technologists can be better citizens and contributors to society.

Some friends and I also do some goofy video stuff, which you can find on Twitch and YouTube.