Serverless Framework example for Golang and Lambda

Everyone, the day has come.

AWS Lambda is finally. Compatible. With Golang. đź––

Here’s how you can start using Go with the Serverless Framework RIGHT NOW and deploy Lambdas to your heart’s content.


What I learned in 2017 Writing Go

A little over a year ago, I joined Cloud Foundry to work on Loggregator, Cloud Foundry’s application logging component. Its core concern is best-effort log delivery without pushing back on upstream writers. Loggregator is written entirely in Go.

After spending more than a thousand hours working with Go in a non-trivial code base, I still admire the language and enjoy using it. Nonetheless, our team struggled with a number of problems, many of which seem unique to Go. What follows is a list of the most salient problems.

Learning Go by porting a medium-sized web backend from Python

Summary: To learn Go, I ported the backend of a small site I run from Python to Go, and had a fun, pain-free experience doing so.

I’ve been wanting to learn Go for a while now: I like the philosophy of a language that’s small, has a gentle learning curve, and compiles very fast (for a statically-typed language). What pushed me over the line to actually go and do it was seeing more and more fast, robust tools that are written in Go – Docker and ngrok are two I’ve used recently.

The philosophy of Go is not to everyone’s taste (no exceptions, no user-defined generics, etc), but it fit my mental model well. Simple, speedy, does things the obvious way. During the port, I was especially impressed with how robust the standard library and tooling was.


How to Create a Private Ethereum Blockchain from Ground-up?

Ethereum is a decentralized platform that runs smart contracts, applications that run exactly as programmed without possibility of downtime, censorship, fraud or third party interference. In this blog post I will take you through all the steps required in setting up a fully functioning private ethereum blockchain, inside your local network — which includes:

  • Setting up a private blockchain with ethereum using geth.
  • Setting up the MetaMask ethereum wallet to work with the private blockchain.
  • Transfer funds between multiple accounts.
  • Create, deploy and invoke a smart contract on the private blockchain using remix.
  • Setting up ethereum block explorer over the private blockchain.


Run your own OAuth2 server

In this guide, you will set up a hardened, fully functional OAuth 2.0 (OAuth2) server. It will take you about ~15 minutes. This guide is for you, if you are looking to do something like in the gif on the right, or more specifically:

  • You want to use OAuth2 for API security.
  • You want to open up your API to third party developers like Dropbox, or GitHub.
  • You want to become and identity provider like Google, Facebook, or Twitter.
  • You need to federate (delegate) authentication or authorization.

We will use ORY Hydra (open source), a security-first OAuth2 and OpenID Connect server written in Golang.


Simple task runner / Make alternative written in Go

Task is a simple tool that allows you to easily run development and build tasks. Task is written in Golang, but can be used to develop any language. It aims to be simpler and easier to use then GNU Make.


Up  – Deploy serverless apps in seconds

Last year I wrote Blueprints for Up, describing how most of the building blocks are available to create a great serverless experience on AWS with minimal effort. This post talks about the initial alpha release of Up.

The TL;DR was to run your “vanilla” HTTP server inside of Lambda on a unprivileged port, and relay requests to it, so that you don’t have to write code specifically targeting Lambda or other platforms.

Roughly a month ago I decided to start working on it over at apex/up, and wrote the first small serverless sample application tj/gh-polls for live SVG GitHub user polls. It worked well and costs less than $1/month to serve millions of polls, so I thought I’d go ahead with Up and see if I can offer open-source and commercial variants.

The long-term goal is to provide a “Bring your own Heroku” of sorts, supporting many platforms. While PaaS is nothing new, the serverless ecosystem is making this kind of program increasingly trivial, however AWS and others often suffer in terms of UX due to the flexibility they provide. Up aims to abstract platform internals away and provide a user-friendly solution.