What is infrastructure as code?
Infrastructure as Code (IaC) is an approach that uses the code for infrastructure management instead of managing it manually.
With IaC, infrastructure can be defined in a configuration file that specifies all the resources required to run an application, such as: servers, storage, networks, virtual machines, and connection topology. The configuration file can be then versioned and tested using the same procedures as the application code.
In this way IaC enables to:
- manage the infrastructure in a consistent and predictable way, as changes are made using the same procedures and tools as in software development,
- integrate the infrastructure into the continuous integration/continuous delivery (CI/CD) process,
- track changes to the infrastructure over time and roll back unwanted changes,
- scale the infrastructure more easily, since new resources can be provisioned using automated processes,
- add version and track the infrastructure in the same way as the software code, making it easier to identify and fix problems, and
- reduce the risk of errors in the infrastructure provisioning.
There are many tools and technologies for implementing IaC, including configuration management tools such as: Chef, Ansible, and Puppet or cloud-specific tools such as: AWS CloudFormation and Azure Resource Manager.
IaC tools are often used in conjunction with Terraform and CloudFormation, which allow users to define and manage infrastructure defined across multiple cloud providers.