infrastructure as code (IaC) is the managing and provisioning of infrastructure through code instead of using a manual process to configure devices or systems. Over the years, IT infrastructure provisioning has been done manually. The people responsible for the process have to rack and stack the servers physically. Also, they have to manually configure the hardware to the desired settings and requirements of the operating system and the hosted application.
IaC helps you automate the infrastructure deployment process in a repeatable, consistent manner. Infrastructure as Code can simplify and accelerate your infrastructure provisioning process, help you avoid mistakes and comply with policies, keep your environments consistent, and save your company a lot of time and money.
There are two parts in IaC:
1. Infra provisioning: Provisioning infrastructure manually is a time-consuming process and it is impossible to guarantee zero errors. Automating the provisioning of infrastructure eliminates configuration drift, ensures predictability in what is provisioned, and makes your software delivery process much more reliable.
eg: Terraform, Cloud Formation, ARM templates
2. Configuration: Configuration Management (CM) ensures that the current design and build a state of the system is known, good & trusted.
eg: Ansible, Puppet, Chef.