EC2 fun with Tanda webhooks

Alex Ghiculescu
Tanda Product Team
Published in
2 min readNov 7, 2017

This guest post was written by Bernd Hartzer, who competed at the 2017 Tanda Hackathon.

This year I went to my first Tanda hackathon in Brisbane. The theme for the hackathon was webhooks, to celebrate Tanda’s new webhooks platform. One of the cool things about this hackathon is the shorter format (roughly 24 hours of hacking) compared to the usual full weekend slog.

It kicked off at the Brisbane Tanda office, where there was no shortage of food or beers (or tequila shots). There were a lot of cool ideas floating around, but I knew I wanted to do something in the cloud/infrastructure/automation space. There’s a ton of amazing stuff being talked about and worked on in tech at the moment, and something I’ve been interested in is how systems, infrastructure and automation will change to keep up with other advancements. What I thought would be cool to implement on top of Tanda’s webhooks is a system that would allow developers to get fresh servers with their development environments spun up for them when they clocked in with Tanda. This is something that could be valuable to companies that employ many developers, and managing or configuring development environments for each developer is too time consuming or risky.

The stack I decided to use for this project was Node.js with the Serverless framework. The main reason was because I knew this would allow me to get off to a flying start. I could deploy my code, and have an endpoint up and running to accept requests from the webhook in no time. Naturally, things did not go to plan, and I spent a (very) long time figuring out why my webhook and endpoint were not talking to each other. After looking in all the wrong places, I discovered my endpoint had only been configured to accept GET requests, so the webhooks POST’s were going unanswered. Like I said; off to a flying start.

With a quick substitution of a few characters in my code, my first hurdle was out of the way and I could start fleshing this thing out. Most of my time was spent between various AWS documentation, guides and their JavaScript SDK pages. I slowly worked through my to-do list and managed to get a working prototype done just in time. I had EC2 instances being created on clock in, and tagged with the unique user and shift id’s provided by the Tanda webhook. Then, I had those same EC2 instances being terminated when the relevant user clocked out.

Everyone’s work culminated with the final pitches which were hosted at River City Labs. On display were projects ranging from facial recognition systems to products that were created by leveraging tools like Zapier, and didn’t require any code to be written at all. I got some good feedback on my pitch, and learnt a bit more about working with webhooks and AWS, so I’ll notch it up as a success for myself! If you are interested to check out what I built, you can find it on GitHub: https://github.com/berndhartzer/tanda-hackathon-17

--

--