Introducing Net::EC2::Tiny

One of the fun / cool things about Perl is that it can easily inhabit that space between "too complex for bash" and "too insignificant to invest in a C implementation." In my opinion a lot of the command line tools for EC2 are pretty terrible - they have a large learning curve, a high amount of dependencies and they just aren't that easy to get up and going.

So I started by thinking what was the "minimum viable product" for an EC2 client? Something that slaps a valid v2 AWS signature on any arbitrary API request and translates the XML returned into a Perl data structure. And that's exactly what Net::EC2::Tiny is.

In the spirit of *::Tiny modules, I tried to restrict the number of dependencies, but when I decided firmly to require HTTPS support, that locked me into IO::Socket::SSL and Net::SSLeay, so I opted to give myself a little bit of sugar and used Moo. So there's 5 non-core dependencies.

Anyway, when you're in the mood for a quick (and possibly dirty) EC2 client, whip up a simple(ish) script using Net::EC2::Tiny. It's the low learning curve glue between the raw EC2 API and Perl - perfect for those jobs which interact with EC2 in a relatively minor way.


Cool module. BTW, I've always thought being a ::Tiny module means having no non-core dependencies? (But I couldn't google the official ::Tiny guideline.)

Well, Moose::Tiny has a dependency on the Moose.

Moose::Tiny should perhaps be named Object::Tiny::Moose or Moose::ObjectTiny.

Actually I think its a fine precedent to set/follow that ::Tiny modules (especially those ones for not so tiny tasks) pull in Moo.

::Tiny doesn't have a strict definition. Sometimes it mean literally "few lines of code" and sometimes it means "just the foundational bits you need to do some task". For those latter cases, yours included, Moo is probably fine. IMO

Leave a comment

About Mark Allen

user-pic Singer, dad, nerd, not necessarily in that order. @bytemeorg