Understanding Configuration Management and Infrastructure as Code
What is Infrastructure As Code?
Infrastructure generally refers to everything that makes up the IT environment, such as servers, storage, network devices, firewall devices, routers, virtual machines, load balancers, and software to name a few.
All the above requirements can be set up and maintained through an IaC model where we use a simple code to maintain the whole infrastructure hence the name Infrastructure as Code (IaC)
When you think about IaC, think about it like this - IaC creates the thing.
When you need to create a service in the cloud, a virtualized server, or even a scalable orchestration solution like Kubernetes, you need to think about how to automate it. No one wants to create anything manually anymore and for good reason. There's no way to make manual efforts repeatable and clicking around a UI isn't an efficient way to spend an engineer's time. Because of that, everyone is thinking about how to automate the creation of services, platforms, and systems.
Infrastructure-as-Code is used to automatically create any service or system in the cloud or on-prem with code. The code is typically a provisioning language, like JSON or YAML. However, that's changing rapidly with HashiCorp Configuration Language (HCL), which is a much easier and human-readable language compared to JSON and YAML to write infrastructure code.
The key differentiator between Infrastructure-as-Code and the manual way of creating systems and services is that it's done by writing code. If you're not a developer, that's perfectly fine. A lot of the IaC tools are geared towards non-developers to help them get up to speed. That's why HCL is so human-readable compared to standard programming languages.
You may also hear IaC called Provisioning, as in a provisioning tool. The two phrases are both valid and you'll hear one or the other used depending on who you're talking to.
What is Configuration Management?
Configuration Management refers to configuring the infrastructure as and according to the requirements throughout the lifespan.
When you think about ConfigMgmt, think about it like this - ConfigMgmt configures the thing.
Several years back, virtualization hit the world. A lot of folks didn't think it would end up being as big as it was, but it ended up sweeping the tech nation. Everyone was trying to get on board with VMWare and Hyper-V to get a bigger bang for their buck when it came to servers. Even though creating servers and systems was easier with virtualization, there was still one problem; everything was manual. You had to click around a GUI to provision servers and then you had to RDP or SSH into the servers to configure them. Configuration could consist of starting services, installing dependencies, installing applications, running updates, and much more, so it was a lot of manual effort.
A few companies saw this problem and decided to make a type of tool to automate these tasks. The tool was Configuration Management.
Configuration Management is a way to configure servers. The configuration could be:
Installing applications
Ensuring services are stopped or started
Installing updates
Opening up ports
And much, much more.
What's the difference between Infrastructure as Code (IaC) and Configuration Management(CM)?
The main difference between Infrastructure as Code (IaC) and Configuration Management (CM) is that IaC focuses on managing and provisioning infrastructure through code, while CM focuses on automating the configuration and management of software applications, operating systems, and servers.
While IaC focuses on the infrastructure layer, CM focuses on the application layer. However, both concepts work together to help teams automate and manage their IT infrastructure more efficiently.
What are the most commonIaC and Config Management Tools?
Iac : Terraform, AWS Cloud Formation
CM: Ansible, Chef