Together, Configuration Management (CM) and Infrastructure as Code (IaC) are related but separate techniques that automate IT infrastructure. While CM concentrates on customizing the software and services operating on that infrastructure (such as installing applications, managing settings, and enforcing policies), IaC concentrates on provisioning and managing the underlying infrastructure resources (such as servers, networks, and databases).
The question of when to use Configuration Management (ConfigMgmt) and Infrastructure-as-Code (IaC) is a recurring one. In addition to engineers, the firms that developed the Infrastructure-as-Code and Configuration Management platforms are now being asked this issue.
Which path should you take and what is the best course of action? This blog post will explain the distinctions between ConfigMgmt and IaC, as well as which platform and tool are best for your environment.
Let’s look at some of the fundamentals from an infrastructure standpoint before moving on to the key concepts.
- Infrastructure: Infrastructure refers to the combination of hardware and software components that make up the IT environment, such as servers, storage, network devices, firewall devices, routers, and more.
- Provisioning: In IT, provisioning is the process of creating infrastructure and making it available to end users.
- Configuration: It is the process of configuring the provisioned IT infrastructure resources. For example, installing and configuring a database on a server or configuring network and firewall settings.
- Automation: It is the process of automating infrastructure tasks, such as automating the installation of software packages, setting up users and permissions, or configuring network devices.
- Orchestration: Orchestration is the process of coordinating multiple automation tasks. The output from one automation task can be used as input for another, allowing for a more complex and streamlined workflow. For example, to deploy a server, you may first need to provision network resources, and then use the output from that automation (network details) to deploy the server.
What is Infrastructure-as-Code
When you consider IaC, keep this in mind: IaC generates the thing.
You must consider how to automate the creation of cloud services, virtualized servers, or even scalable orchestration solutions like Kubernetes. For good reason, nobody wants to develop anything by hand these days. Manual labor cannot be replicated, and navigating a user interface is not a productive use of an engineer’s time. As a result, everyone is considering ways to automate the development of platforms, systems, and services.
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. Another huge concept becoming popular is Infrastructure-as-Software, which is defining your infrastructure with a general-purpose programming language like Python or Go.
The key differentiator with 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
Consider ConfigMgmt in this way: ConfigMgmt configures the system.
Virtualization first appeared in the globe a few years ago. Many people didn’t anticipate it would become as widespread as it did, but it ultimately swept the tech nation. In order to gain more value for their money when it came to servers, everyone was attempting to adopt VMware and Hyper-V. Virtualization made it easier to create servers and systems, but there was still one issue: everything had to be done by hand. To supply servers, you had to navigate a graphical user interface (GUI). To configure the servers, you had to RDP or SSH into them.
Read Also: How IaC Fits into DevOps and CI/CD Pipelines
It required a lot of human labor because configuration may include launching services, installing dependencies, installing apps, executing updates, and much more.
A few businesses opted to create a program to automate these processes after realizing this issue. Configuration Management was the instrument.
Server configuration can be accomplished with Configuration Management. The setup might be:
- Installing applications
- Ensuring services are stopped or started
- Installing updates
- Opening up ports
- And much, much more.
You might be wondering, “Why can’t ConfigMgmt be used for IaC?”
It can, is the response. Technically and practically, ConfigMgmt can be used for IaC. Configuration drift is the main issue.
When someone uses ConfigMgmt, for example, to automate a deployment, configuration drift occurs when someone logs into the server and modifies the configuration. There is no real barrier to prevent the person from doing that, and nobody will find out.
It’s different with IaC technologies like Terraform, which include State files that basically tell the server how you should appear. Don’t alter yourself for anyone.
Summary
Infrastructure as Code (IaC)
IaC is the practice of managing and provisioning infrastructure through machine-readable definition files (code) instead of manual processes or interactive tools.
- Scope: Manages the entire lifecycle of infrastructure resources, including creation, modification, and destruction.
- Purpose: To automate the provisioning of environments consistently and repeatedly, treating infrastructure like application code (using version control, testing, etc.).
- Approach: Typically uses a declarative approach, where you define the desired end state of the infrastructure, and the IaC tool figures out how to achieve it.
- Tools: Terraform, AWS CloudFormation, Azure Resource Manager, Google Cloud Deployment Manager.
Configuration Management (CM)
CM is the process of ensuring that a system’s servers, applications, and other environments remain in a known, consistent, and desired state over time.
- Scope: Focuses on the software and settings within existing servers and systems.
- Purpose: To automate the installation, configuration, and ongoing management of software, ensuring consistency and preventing configuration drift.
- Approach: Often uses an imperative approach (though many modern tools also support declarative), where scripts define specific, ordered steps to perform actions on a given infrastructure.
- Tools: Ansible, Chef, Puppet, SaltStack.
Key Differences
| Feature | Infrastructure as Code (IaC) | Configuration Management (CM) |
|---|---|---|
| Primary Focus | Provisioning and managing underlying infrastructure (VMs, networks, storage, etc.). | Configuring software, applications, and settings on existing infrastructure. |
| Lifecycle | Manages the full lifecycle (create, update, delete) of resources. | Manages the ongoing state and consistency of deployed resources. |
| Approach | Primarily Declarative (what the end state should be). | Can be Declarative or Imperative (how to get to the end state). |
| When it runs | During specific deployment events (new environments, scaling). | Continuously or at scheduled intervals to enforce system state. |
| Examples | Terraform, CloudFormation, Pulumi. | Ansible, Chef, Puppet, SaltStack. |
How They Work Together
IaC and CM are complementary and often used together in modern DevOps practices. A common workflow is to use:
- IaC tools (e.g., Terraform) to provision the basic infrastructure, such as spinning up virtual machines and configuring networks.
- CM tools (e.g., Ansible) to then install and configure the necessary software and applications on those provisioned machines.
This combined approach ensures both the environment and the software within it are consistently and reliably managed through code.







Comments