Level Up: Infrastructure As Code

Level 0: What it is and why you should care.

Adamish

--

Brightly coloured building blocks stacked loosely on top of each other.
Photo by Sharon McCutcheon from Pexels

What is Infrastructure as Code?

Infrastructure as Code (or IaC) is a process by which you can manage and provision the infrastructure your code will run on using machine-readable, committable, reviewable configuration files.

Why Infrastructure as Code?

In the beginning, there were servers: actual physical machines that existed in the real world as objects. You could touch them. They lived in a data centre across town, a dingy basement, or, if you were really unlucky, a cupboard shared with the cleaner. If you wanted to install or update something you had to connect to the physical machine over the network or a serial interface. If you wanted to increase the RAM or disk-space, you had to go across town, or down to the aforementioned dingy basement, or go to the cleaning cupboard — dodging the bucket and mop — and open the machine up.

Now, of course, like many other things which used to be physical objects, servers are a thing of the past!

Just kidding, of course they’re not, but we live in an age where the complexities of their physical management — which hopefully don’t involve dodging buckets and mops in 2021— are delegated to a handful of cloud providers, for better or worse. The memory, network throughput, and processor cores of the “machine” running your app can be tweaked up and down and even auto-scale on demand. The future!

So…let’s say you have your spiffy new app, rapidly approaching the end of the Waterfall development cycle because I don’t know, whatever, you do you.

You decided upon your cloud provider a while ago and you’ve already set up an EC2 instance and some S3 buckets, all configured and provisioned, and protected by appropriate policies via the AWS Console. You’ve deployed your code to it and you’re happy everything is working. Testers are happy, stake-holders are happy. Now you decide that the time has finally come to set up a second environment, for production.

--

--

Adamish

I’m a Lead Developer and write mostly Ruby on Rails. I also dabble in any language that takes my fancy.