[ANN] Rapid API tool: AWS Lambda + API Gateway + Go (Aegis)

140 views
Skip to first unread message

Tom Maiaroto

unread,
Jan 19, 2017, 4:43:13 PM1/19/17
to golang-nuts
Hi all,

I've advertised this tool and wrote a blog post about it even, but never really announced it here or in Slack.
I thought a forum would be a better place for feedback than Twitter or something so I figured I'd post here.

You can find the project here: https://github.com/tmaiaroto/aegis

Basically, the reason I built this was because I was always inspired by tools that let you deploy static sites to Amazon S3 real quick. 
I wanted something similar for deploying APIs. While there are other wonderful solutions (that I still love and use) they weren't exactly what I wanted.

So this will use AWS Lambda for your app and API Gateway will forward requests to the Lambda. Any request. Any HTTP method.
When using this package's helper functions, it will transform those requests into something a bit more friendly and familiar.
Essentially there's a router for you to use in your app (with a "fall through" to catch anything not explicitly handled).

I'm curious what people think and if I can find any way to improve upon it. Already it's helped me, but I hope it can help others.

I'm also really excited about Go 1.8's plugin feature and I'm curious if there's a way to use plugins with the router here.
So for example, if I wrote a serverless API that was a geocoder or something (and maybe more) and you wanted to bring it into your API, you could use the plugin build mode to include part of it. You might not want all of my API, but just a certain part. So you could load one of the handlers and use it under any route in your own app.

I'm not sure if that is better than simply relying upon import, but I do think it might provide an easier opportunity to use part of another package without that package being written explicitly as something that was intended to be imported into another app.

The idea of a composable API comes to mind and I wonder if there's even a CLI way to manage that.

Thoughts anyone? Thanks!

JM

unread,
Jan 19, 2017, 6:46:42 PM1/19/17
to golang-nuts
Does AWS lambda support go finally or are you using a node js wrapper?

Tom Maiaroto

unread,
Jan 20, 2017, 1:20:59 AM1/20/17
to golang-nuts
Yes, you still need to use a wrapper of some sort. I chose Node.js, but am also thinking about using Python to see which is faster.
That said, your Go Lambdas will typically (in every example of substance I've seen) will run faster than Node.js Lambdas.

The wrapper is a bummer from an implementation point of view, but in no way should prevent one from using Go in Lambda as far as I'm concerned.
Reply all
Reply to author
Forward
0 new messages