DEV Community

loading...
Cover image for Explain IaC like I'm Five

Explain IaC like I'm Five

ari_hacks profile image Ari 🪐 ・2 min read

What is Infrastructure as Code?

Historically, creating infrastructure involved manually setting up servers and configuring systems to run applications, operating systems, databases...etc. Infrastructure was imperatively configured and maintained, meaning this was done with step by step instructions and executed by the admin. This process becomes unsustainable with large & complex systems leaving room for issues with cost, availability, and consistency.

Infrastructure as Code solves these problems by automating setup and management by writing code in a high-level descriptive language.

Alt text of image

With Iac we can produce secure,reliable, and robust infrastructure

HashiCorp's Founder, Armon Dadgar explains IaC simply and eloquently in this short video


Why should we use it?

Alt text of image

Accidents happen, human error happens. By automating infrastructure with code we reduce error and produce more reliable code.

Complexity, with the emergence of cloud-based infrastructure IaC is paramount for scaling distributed systems, cloud-native applications, and service-based architecture.


How do we use it?

Sai Vennam with IBM Cloud discusses approaches to IaC with a quick example

Terraform Example

Terraform is a cloud provider agnostic orchestration tool. This means we can build, version, and destroy resources across multiple providers at the same time. We can also easily look up modules to use directly from the Terraform Registry saving time on creating common configurations. These features make it a leader in IaC. Now let's take a look at the power of Terraform with an example.

Alt text of image

This is a Terraform module which creates a private S3 bucket resource on AWS with versioning enabled in HCL(HashiCorps's configuration language)

Other IaC Tools

Another Orchestration tool is AWS CloudFormation, this tool is similar to Terraform but it is only AWS focused.

Along with orchestration tools, there are configuration management tools. They are used to install and manage software on existing servers.

Common configuration management tools:

** Some configuration management tools can be used for orchestration. It all depends on the best fit for your needs or the task.

Discussion (0)

pic
Editor guide