Infrastructure as Code: the key to agile, secure, reliable deployment

Katja Belova
How to use Terraform to flexibly provision your architecture with modular code

After weeks of hard work, you’re taking a new build live. Then disaster strikes.

Everything worked great in the cloud dev environment with test data, and with real data in staging. But in production, it’s chaos. ‘It worked great in staging!’ exclaims one engineer, bewildered. ‘What’s different now?’ Eventually, you find the culprit: a network config mismatch overlooked during manual setup.

Horror stories like this were all too common before Infrastructure as Code (IaC). Maintenance was labor-intensive and error-prone, requiring much preparation and checking (with backups in case things went south). But in the last 10-15 years, the ‘shift left’ strategy has seen more engineers setting up their own infrastructure. To avoid bottlenecks during periods of high demand, IaC tools have emerged to allow less-experienced engineers to adjust infrastructure under expert DevOps guidance.

There are several IaC tools for a variety of tasks, but I’d like to focus on the current go-to solution: Terraform. I recommend avoiding platform-limited tools like (for example) Cloud Formation for AWS. A generic tool like Terraform offers a range of providers including all major cloud and container services like Kubernetes. This flexibility accelerates development, collaboration, and reliability - without binding you to a provider. Plus, you can work with the strong Terraform community and its open-source registry of provider modules, instead of relying on one company.

Benefits of Terraform's IaC:

It's essential, but the transition to IaC has a learning curve. Make sure to invest in training from day one, including sufficient documentation. With the right approach, switching from manual infrastructure config to automated IaC promises to save you from the horror of late-night deployment woes - and facilitate scalable, agile growth.