A Story of Infrastructure as Code (IaC)


One day Minnie was shopping at the grocery store where she saw Mickey

Minnie: Hey Mickey! How are you?

Mickey: Err Ah! Minnie, I m good!

Minnie: You look lost, What happened?

Mickey: Nothing much!

Minnie: Common, you can tell me

Mickey: Hey Minnie, I heard this term “Infrastructure as Code” (IaC). What does it mean?

Minnie: Oh, Mickey, that’s an interesting topic! Imagine if you could build a magical castle with just a spell, and every time you wanted a castle, you could use the same spell to create it instantly. Well, that’s kind of what Infrastructure as Code is all about.

Mickey: Hmmm, that sounds cool, but what’s “Infrastructure“?

Minnie: Great question! Infrastructure is like the foundation and all the things a computer system needs to work properly. Think of it as the bricks, pipes, and wires that make a house comfortable. In the computer world, it’s the servers, databases, networks, and all those components that run software.

Mickey: Got it! But what do you mean by “Code“?

Minnie: Terrific! Code is like a set of instructions that tells the computer what to do. Just like how you follow a recipe to bake cookies, computers follow code to perform tasks.

Mickey: So, Infrastructure as Code is like instructions telling the computer how to build things?

Minnie: Exactly! Imagine you’re creating a magical playground for your toys. Instead of manually placing every swing, slide, and sandbox, you write down a special recipe (code) that says, “Put the swings here, the slide there, and the sandbox in that corner.” When you run this recipe, your playground appears without you having to do all the work manually.

Mickey: Oh, that sounds so much easier! Can you give me an example?

Minnie: Absolutely! Let’s say you want to set up a special playroom for your video games. Instead of setting up each computer, one by one, you write down a magical recipe (code) that says, “Create five gaming computers, connect them to the internet, and install the games.” When you use this code, the playroom is set up with all the computers and games without you lifting a finger!

Mickey: Wow, that’s like having a magic wand for setting up things!

Minnie: You’ve got it, Mickey! It’s like a magic wand for computers. And the best part is, if you want to make changes to your playroom, you just update the recipe (code) and run it again. No more redoing everything from scratch!

Mickey: That sounds super helpful! But how do people write this special recipe (code)?

Minnie: Great question! People use special tools and languages to write this code. It’s like writing a letter to your toys in a secret toy language. One popular language is called “YAML,” which is like writing down instructions step by step.

Mickey: So, it’s like telling my toys how to set up their own playground?

Minnie: Exactly, Mickey! You’re like a magical architect telling the toys how to create their playground. That’s what Infrastructure as Code is all about—making computer systems and setups easy to create and manage with special recipes that work like magic spells.

Mickey: What are some common tools used for IaC

Minnie: Great, here are some popular tools:

  • Terraform: Terraform is a widely used tool that allows you to define and provision infrastructure using a declarative configuration language. It supports multiple cloud providers and services
  • AWS CloudFormation: If you’re using Amazon Web Services (AWS), CloudFormation allows you to define and deploy infrastructure using JSON or YAML templates
  • Ansible: Ansible is an automation tool that can be used for both configuration management and provisioning infrastructure. It uses YAML-based playbooks to define tasks and configurations
  • Puppet: Puppet is a configuration management tool that helps you automate the deployment and management of software and configurations across different systems
  • Chef: Chef is another configuration management tool that uses a domain-specific language (DSL) to define how systems should be configured. It offers a lot of flexibility and automation capabilities
  • Azure Resource Manager (ARM) Templates: Similar to CloudFormation, ARM Templates are used in Microsoft Azure to define and deploy infrastructure resources
  • Google Cloud Deployment Manager: For Google Cloud Platform (GCP) users, Deployment Manager provides a way to define and deploy infrastructure using YAML or Python configurations
  • Kubernetes: While primarily known for container orchestration, Kubernetes also allows you to define and manage infrastructure resources through YAML files using its concept of “declarative infrastructure.”
  • Packer: Packer is a tool for creating machine images for different platforms. It allows you to define how your images should be built in a JSON or HCL configuration
  • SaltStack: SaltStack combines configuration management and remote execution capabilities. It uses a domain-specific language (DSL) for defining configurations and tasks.

Mickey: This sounds amazing, Minnie! I want to learn how to use this magic too!

Minnie: That’s the spirit, Mickey! With a bit of practice, you’ll become a master at creating magical computer setups with Infrastructure as Code. Can take up any of the tools from the list above and get started. It’s a fantastic way to build and manage things in the computer world!

Mickey: Great, I now know all about IaC

Minnie: Great so do you want to go home now

Mickey: No, let’s go to the riverside and watch the sunset

Minnie: Sure, let’s go

Mickey: You are my best friend Minnie

Minnie:  I am always here for you 🙂

about the author more stories

2