Infrastructure-As-Code in the Cloud & Why it Matters in DevSecOps | Impact Makers

Infrastructure-As-Code in the Cloud & Why it Matters in DevSecOps

What is Infrastructure-as-Code (IaC)?

Infrastructure-as-Code (IaC) is the practice of defining templates that can be used to provision technology infrastructure to support software and applications. Traditionally, physical hardware configuration of network switches/routers, servers, network-attached storage, etc. has been a time-consuming and difficult task that not only was prone to human error—but was also not easily repeatable. Even after the advent of virtualization and the automated software configuration revolution, technology infrastructure was still built on a backbone of (usually) manually-managed hypervisors overseen by IT operations staff.

A small snippet of an AWS CloudFormation template using YAML syntax.

With the rise in popularity of public cloud platforms like AWS and Azure, the idea of managing and configuring infrastructure automatically via predefined code and templates has emerged. This was difficult to manage previously simply because traditional on-premises datacenters did not have programmatic interfaces (APIs) that enabled actions to be defined and executed automatically. The usage of individual and non-integrated scripting in operational work tasks did not provide the same capabilities and error controls as APIs now provide. This paradigm shift in computing has enabled tasks requiring physical configuration—like racking a server in a datacenter to host an application—to be abstracted as a handful of code that can be replicated infinitely.

A Terraform execution plan.

Why does IaC matter & how does it impact DevSecOps?

This brings us to the central point—why does this matter—and more specifically how does this impact DevSecOps? The points below are not listed in any particular order.

A small snippet of a Terraform template.

How does IaC influence cloud strategy & continuous delivery?

IaC is now pervasive across public cloud providers. Mature DevSecOps practitioners are adopting or have already adopted IaC as a component of their continuous integration/ continuous delivery (CI/CD) pipelines. IaC is an important component of enabling true continuous delivery when technology infrastructure is involved.

It should be noted that IaC becomes much simpler to implement in cases where technology infrastructure is already abstracted, or in services that tend to function in a PaaS (Platform as a Service) model rather than IaaS (Infrastructure as a Service) model. For example, using a service like AWS’s Elastic Beanstalk can automatically provision and deploy technology infrastructure components designed to run applications and workloads and then customize them based on parameters that you provide. Similar functionality is present in other platforms like Google Kubernetes Engine (GKE), Heroku, or Azure Container Instances. In much the opposite way, adoption of IaC can be challenging in hybrid cloud environments where different platform-restricted template/coding languages may influence the choice of IaC flavor—HashiCorp’s Terraform is known for attempting to be the one-size-fit-all solution in these cases. Regardless—IaC should be considered a crucial part of any cloud strategy and CI/CD pipeline. It provides a method of capturing cloud architecture as code—and by enabling the rapid deployment and revision of this infrastructure it can influence the creation of a cloud operating model as well.

Watch for more from Impact Makers’ Cloud Experts

In this blog, tools like Terraform, CloudFormation, and Azure Resource Manager templates were discussed—but the details and advantages of these different technologies was never expounded upon. Look forward to posts on this in the future!