Discover the evolution of Infrastructure as Code (IaC), from ancient Unix tools to today’s modern solutions. Explore how IaC has transformed infrastructure management, from configuration to cloud-agnostic approaches.
When someone says Infrastructure-as-Code, people typically think about modern tools like Terraform or Ansible. However, management and configuration of a large number of hosts has been a challenge for decades, and there are some pretty old tools that were used to address this challenge.
- Although not meant to be an IaC or configuration management tool, Unix maketool (introduced in 1976) was sometimes also used for automation of configuration management tasks. PXE Boot (Preboot Execution Environment) tool (introduced in 1981) brought an early form of configuration management.
- In 2006, AWS released the first version of EC2. Provisioning of arbitrary amounts of compute resources had never been easier before. This fact significantly influenced the evolution of configuration management tools likeChef and Puppet.
- In 2012, Ansible was released. In contrast with Chef and Puppet, Ansible is agentless. In other words, it is not necessary to install any additional software on the managed hosts.
- The above mentioned evolution steps are obviously about configuration management. The scope of Infrastructure-as-Code is broader as there are many kinds of infrastructure resources that need to be managed (e.g. network, storage, databases etc.). Nevertheless, configuration management can be perceived as an evolutionary predecessor of Infrastructure-as-Code.
- Container technologies like Docker and Kubernetes (introduced in 2013 and 2014) increased the complexity of infrastructure significantly, thus bringing the challenge to a whole new level.
- Terraform was introduced in 2014, and it has become very popular. It uses a declarative language known as HashiCorp Configuration Language (HCL), which is also used by other HashiCorp products. Although Terraform is a declarative tool, it has several imperative style features which make it easy to avoid code duplication.
- Terraform was introduced in 2014, and it has become very popular. It uses a declarative language known as HashiCorp Configuration Language (HCL), which is also used by other HashiCorp products. Although Terraform is a declarative tool, it has several imperative style features which make it easy to avoid code duplication.
- Terraform is a cloud agnostic tool, so it can be used for Azure, AWS, GCP and many other platforms. It can even be used in hybrid environments where two or more platforms are combined. Cloud providers typically provide their native IaC services like AWS CloudFormation, Azure Resource Manager templates etc. These tools are usually limited to the cloud they are part of, but they are usually slightly more powerful when it comes to utilization of some specific functionalities. For instance, CloudFormation used in combination with CFN helper scripts can wait for the completion of EC2 instance initialization performed as part of EC2 user data script.
- Azure Resource Manager (ARM) was introduced on December 2, 2014. Before ARM’s introduction, Azure resources were managed using the Classic deployment model (Azure Service Management or ASM). However, ASM had some limitations, such as limited role-based access control and lack of support for managing resources as a group. Since its launch, ARM has become the standard for managing Azure resources and has been continuously updated to add new functionalities and improve existing ones.
- During the last few years, several tools using imperative language (as opposed to declarative language) have been introduced (e.g. AWS CDK, Pulumi, CDK for Terraform). Each of them allows us to define the infrastructure in various programming languages like Java, Python, JavaScript etc.
- Imperative tools might be suitable for environments where developers are also responsible for the infrastructure. In such cases, developers can use the same programming language they use for the application development. Compared to the declarative tools, this gives them a lot of power in the form of conditional logic, loops, object oriented programming etc. However, if not used wisely, this can easily lead to “Infrastructure as Messy Code“. Besides other drawbacks, such implementation is likely to undermine the documentation aspect of IaC.
- AWS CDK is an imperative tool which aims to improve the experience of working with IaC compared to CloudFormation, by providing high level reusable constructs that enable more efficient ways to manage and create AWS resources.
- AWS CDK was announced as a developer preview at the AWS Summit in New York on July 17, 2018 and reached general availability on July 11, 2019, with support for TypeScript and Python as the initial programming languages. Since then the choice of programming languages was broadened to 6, added were namely JavaScript, Java, C# and Go. This tool has a very fast release cycle with new updates being available approximately once a week.