bora—an AWS Cloudformation wrapper

Last weekend I spent some time working on a small project: bora.1 It’s a simple wrapper around AWS Cloudformation, so obviously everyone’s question is: why the hell would I want yet another Cloudformation wrapper? tl;dr answer is: because all the ones which are available suck. But let me elaborate.

  • Troposphere-based tools are inelegant. Troposphere itself is poorly documented, and I dislike how the Python code mixes with actual Cloudformation JSON code in it. It’s also very often non-lintable (or gets unreadable after linting).
  • I ❤️ Python just like the next guy, but it’s not very well suited for things like CI/CD pipelines. I see this a lot in clients’ setups: first your jenkins job needs to pull the code, then create a virtualenv and pip the requirements, then lint (hah!), and then, hopefully, run. With compiled languages (and Golang especially), you only need to download a binary and run it. The only thing you have to care about is the underlying architecture and OS (which, in 99% of the CI/CD cases, is elf x86_64).

  • I want to embrace Cloudformation’s new neat & clean YAML capabilities. JSON is ugly. Troposphere, as mentioned already, is ugly too. Combining YAML with some Jinja-like markup for variables and loops, we could end up with something very elegant and readable. Continue reading “bora—an AWS Cloudformation wrapper”

AWS Cloudformation template for Counter Strike GO server

I spent an evening writing a cloudformation template for Counter Strike Global Offensive linux server. No, I don’t have a life. Yes, you will thank me next time you play with your friends and the laptop cannot handle more than 5 players. (AWS t2.micro handles 6 players easily, and you can always throw a c4.large at the problem which is still about $0.13/hr and handles, well, just about anything).

The template sets up a single EC2 instance of type t2.micro by default, uses the default VPC, and runs the server with “Arms Race” game in a free-for-all mode. Consult Valve’s documentataion page if you want to run other games or reconfigure the server in any way. The template also sets up a CNAME record pointing to the instance’s public DNS name, so comment the last section out if you don’t have a public hosted zone in your Route53.

Happy shooting!

AWS Cloudformation template for OpenVPN server creation

Are you traveling for Christmas to a country where Netflix/Hulu isn’t available? Are you worried you might resort to violence against your own family once you’re fed up with them? Here’s a VPN server template to help the situation (and keep you away from prison).

Netflix is brilliant and there’s no better time to catch up on your Jessica Jones episodes than Christmas break. But what if your family resides in a country where Netflix isn’t available yet? 😱 Fear not, there’s a way to circumvent geolocation-based legal barriers that protect, in my case, Eastern Europe from excellent comic book-based television. First, you’re gonna need a fast internet connection.1 Second, a VPN server into the country where Netflix is available, e.g., Bundesrepublik Deutschland.

update Jan 6, 2016: Oh, well. VPN servers can still be useful for other purposes.

To create one really quickly and cheaply (and destroy it as easily once it’s not needed), it’s best to use Cloudformation, an orchestration/templating tool that AWS provides. With Cloudformation, all the details2 of your stack are included in one JSON file which, once uploaded via AWS Console, deploys the stack defined by the template. The JSON file below defines an EC2 instance together with a security group suited for OpenVPN: Continue reading “AWS Cloudformation template for OpenVPN server creation”