A core capability underpinning the shift to Cloud Native DevOps is treating 'Infrastructure as Code' (IaC). As the term suggests it means applying practices from software development to the activities of managing the underlying IT infrastructure.

Vladimir Fedak provides a comprehensive overview of DevOps and the role IaC plays:

"The practice of describing all software runtime environment and networking settings and parameters in simple textual format, that can be stored in your Version Control System (VCS) and versioned on request. These text files are called manifests and are used by DevOps tools like Terraform and Kubernetes to automatically provision and configure build servers, testing, staging and production environments."

Managing your infrastructure as a software process therefore also highlights the role of software testing, indeed given the challenges and objectives of infrastructure management it's a critically important capability.

Terraform

In his blog 'Top 3 Terraform Testing Strategies for Ultra-Reliable Infrastructure-as-Code' Carlos Nunez maps software testing practices, such as unit and integration testing and Test Driven Development to infrastructure deployment strategies, using one of the most popular tools for this - Terraform.

As an introduction, he describes how it ensures the removal of the decades-old “works fine on my computer” problem, where the code that worked in testing does not work in production. IaC ensures continuity, as all the environments are provisioned and configured automatically, with no room for human error, which greatly speeds up and simplifies the software development and infrastructure operations.

With human error being one of the primary reasons for IT systems downtime, where simply mistyping a DNS entry can entirely crash an online business, avoiding the potential for these errors through automation is of the highest value and importance to every organisation.

Tools like Terraform eliminate the need for and risk of manual infrastructure configuration, with features like Terraform Plan that enables you to visualize and forecast what would happen to infrastructure once your changes are applied before doing so. Carlos walks through scenarios that explain how these activities can be integrated into your overall DevOps pipeline flow so that continuous testing of your infrastructure is an integral component part of your overall continuous delivery life-cycle.

Doing so provides a keystone foundation for encouraging high confidence in the release cycle. For example, every sandbox environment created by an integration test will be an exact replica of production because every sandbox environment will ultimately become production. This provides a key building block towards infrastructure immutability whereby any changes to production become part of a hotfix or future feature release, and no changes to production are allowed or even needed.

This type of repeatability and control imbues the development teams with greater confidence as the risks of infrastructure conflicts and crashes are massively reduced.

In his InfoQ article, Yevgeniy Brikman provides a transcript of a presentation he gave on the same topic, where he too comments on this key insight, that many DevOps teams live in a state of fear that greatly inhibits their productivity as they worry about making changes without a clear understanding of what impact those changes will have.

He also explores the application of testing practices like static, unit, integration and end-to-end testing to the management of infrastructure to address this situation, based on his own extensive experiences of doing so and he also includes demo code to try out. He walks through scenarios such as using Terraform to provision a VPC, five node Kubernetes cluster and Route 53 zone, and explains the role of their own tools like Terratest.

2i Services

2i can assist organisations adopt these techniques to also develop the qualities, practices and approaches that your people need to form high-performing Agile Delivery Teams. As testing experts, we can help your organisation embed best practices throughout your DevOps life-cycle and infrastructure management.
 
This requires a holistic understanding of a large, complex enterprise environment, including multiple technologies, departments and workflow interactions. 2i specialises in mapping this complexity and from that defining a DevOps blueprint that synthesises them together to achieve faster throughput of successful code deployment.

Drop here!
Author: 2i Testing