An Introduction to Infrastructure as Code

An Introduction to Infrastructure as Code

"IaC" or Infrastructure as Code, is simply the ability to provision, manage and support your computing infrastructure through code, as opposed to doing it manually. What this means is that instead of going to the console of the cloud provider you're using and provisioning instances from there, you'd instead have files with chunks of code that specify the desired configuration of your resource, which would then have to be run in order to deploy the resource.

Largely, there's two ways of using IaC - Declarative and Imperative. In the Declarative approach, you "declare" the end desired state of your solution in your code, and the IaC tool takes care of getting to that state. So, for a certain set of deployment commands, the IaC tool will always produce the same exact output regardless of target environment, meaning that you have a guarantee that the tool will produce identical results across environments. This makes the Declarative approach of IaC "Idempotent" - meaning that for a given operation, you have a guarantee that you'll always get the same results.

So ultimately we need to ask - "Why would you want to use IaC and what are the benefits of it?"

IaC is a desirable tool for all the benefits it provides. I've listed a few below.

  • Since you're deploying resources through code, you can set up exactly identical configuration across environments with ease and speed.
  • As deploying resources becomes easy and fast, you can scale rapidly.
  • Deploying through code reduces the risk of human errors that arise while configuring resources manually. You can even monitor your code to verify that you're abiding by compliance rules if any.
  • Because you use code to deploy resources, there is consistency and it becomes easier to maintain standards and follow compliance rules.
  • Detecting "configuration drift" becomes easy. Configuration drift is basically when there's some configuration change that isn't in sync with your standards. Since your standards are enforced through your code, any misconfigurations are easily detected.

Keeping the above the points in mind, we can see how IaC is a practice that will greatly assist us in building consistent and compliant architecture with ease and speed, and why it is a great concept to become familiar with.


To view or add a comment, sign in

More articles by Om Kudalkar

  • Deploying a Server using IaC

    In my previous article, I gave a quick run-down of what IaC is, why it's lucrative, and why adopting it is beneficial…

  • How to add dependencies to a Lambda Function in AWS

    The Lambda Python runtimes includes the AWS SDK for Python (Boto3) and its dependencies, but this does not include a…

    1 Comment
  • Unpaid Internships - yea or nay? Nay.

    Today, I came across this post by Ishan Arora and I was initially reluctant to say anything especially on a…

  • How Good Design Implementation Prevents Errors

    Over this semester I’m taking Object Oriented Programming and Design and till now, I’ve learned a lot. I now have a…

  • How java stores array length safely.

    Quite recently, in my Object Oriented Programming class, we learnt what constitutes good software design and what…

  • Useful Intraday Trading Indicators

    Top Indicators for day trading - 5 and 10 EMA (Exponential Moving Average) Bollinger Band (BB) RSI Volume A. 5 and 10…

    2 Comments
  • How you can gain control of your free time.

    This was a particularly interesting talk and a very powerful one. It opened my eyes to some of the mistakes I was doing…

    2 Comments
  • Yes, Binary Search is O(log(n)), but how?

    We know that the Binary Search algorithm is of O(log(n)) complexity, but how do we arrive at this conclusion? Is there…

    2 Comments
  • HOW YOU CAN SELL ANYTHING

    Derek Thompson shares the 4-letter code to sell anything. Quite recently, I watched Derek Thompson's Ted talk which…

Others also viewed

Explore content categories