Greg Tyler

Weeknotes: 23rd September 2019

Published on 28th September 2019

This week I learnt how to pair.

At ceremonies on Tuesday we agreed as a team to do more pairing. Some of the team (and department) are really passionate about pairing, some (like me) have never really done it before. But certainly no-one was against the idea, so we decided to give it a go.

I think we dived into this experiment more than anticipated, with most of us spending the majority of the rest of the week closely (and remotely) pairing. It could be seen as a trial by fire, but I think we were all experienced and mature enough to just give it a fair short.

This only marks the beginning of our pairing journey, but we’ve learnt a few lessons already. Firstly, dodgy internet connections are really problematic when pairing remotely (sorry colleagues!). Secondly, choose your battles: we identified the core, complex work and paired on that, then separated to do the more mundane or tedious bits: filling our further tests, fiddling with HTML.

We’ve been lucky to have work that accommodates pairing excellently (it’s been quite complex and involved, and is also very important to the product), so it will be interesting to see how this momentum keeps up.

Infrastructure as code

I’ve spent a fair amount of time with our infrastructure recently, and realised that I’ve grown in confidence with managing it. I thought this marked a good opportunity to give a brief intro to Infrastructure as code, and how we’re using Terraform.

The idea of the “Infrastructure as code” “movement” is that you can explain your infrastructure (servers, databases, DNS records, passwords etc. etc.) in a standardised format so that it can be applied automatically by tooling.

For example, you might have a file with a description of your database, including what the root password is and what other users/permissions should be granted. When run, your tool can then set up the database in your service provider of choice. If you need to change permissions, you re-run the tool and it will cleanly apply the updates (without destroying and recreating everything, wherever possibe).

There are various benefits of this, but among them:

Our tool of choice is Terraform, which provides an easy-to-undestand syntax and a massive selection of providers (services you can describe in your code). In particular, the AWS integration is very complete.

Terraform makes documenting our (fairly complex) infrastructure really easy, and making changes to it easier still. Being part of our codebase and full CI/CD pipeline, it’s also very easy to automatically test changes and know when something’s wrong.

As well as setting up our service, the wider OPG team uses Terraform to manage our GitHub and AWS accounts. So when a new member of staff joins a team, their access is granted via a pull request and we can be confident they have the same access as their colleagues.

I’m still a beginner with Terraform and Infrastructure as code, but I’m quickly seeing the power and confidence it brings.