<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Iac on Ansuman Satapathy</title><link>https://ansuman-satapathy.github.io/tags/iac/</link><description>Recent content in Iac on Ansuman Satapathy</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sun, 15 Mar 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://ansuman-satapathy.github.io/tags/iac/index.xml" rel="self" type="application/rss+xml"/><item><title>IaC Evolution: Deploying the Same App Three Ways to Understand Why Modern Infrastructure Exists</title><link>https://ansuman-satapathy.github.io/projects/iac-evolution/</link><pubDate>Sun, 15 Mar 2026 00:00:00 +0000</pubDate><guid>https://ansuman-satapathy.github.io/projects/iac-evolution/</guid><description>&lt;p&gt;&lt;a href="https://github.com/ansuman-satapathy/IaC-Evolution"&gt;&lt;img src="https://img.shields.io/badge/GitHub-View_on_GitHub-181717?style=for-the-badge&amp;amp;logo=github" alt="View on GitHub"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This repository demonstrates the evolution of Infrastructure as Code (IaC) and Configuration Management. It is structured as a 3-part journey, taking a raw Linux environment and progressively upgrading the deployment methodology to solve the limitations of the previous stage.&lt;/p&gt;
&lt;h2 id="tech-stack"&gt;Tech Stack&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Provisioning &amp;amp; Orchestration:&lt;/strong&gt; Terraform, Vagrant&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Configuration Management:&lt;/strong&gt; Ansible, Bash&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cloud Provider:&lt;/strong&gt; Amazon Web Services (AWS)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Application Stack:&lt;/strong&gt; Node.js (Express), PostgreSQL, Redis, Nginx, PM2&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Local Hypervisor:&lt;/strong&gt; KVM / libvirt&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="goal"&gt;Goal&lt;/h2&gt;
&lt;p&gt;To provision the infrastructure for a standard 3-tier web application using three entirely different DevOps philosophies.&lt;/p&gt;</description></item><item><title>Terraform Best Practices: How to Not Nuke Production</title><link>https://ansuman-satapathy.github.io/blog/terraform-best-practices-how-not-to-nuke-production/</link><pubDate>Sun, 25 Jan 2026 20:30:00 +0530</pubDate><guid>https://ansuman-satapathy.github.io/blog/terraform-best-practices-how-not-to-nuke-production/</guid><description>&lt;p&gt;Writing Terraform is easy. Managing Terraform at scale without destroying your company’s infrastructure is hard.&lt;/p&gt;
&lt;p&gt;If your idea of &amp;ldquo;state management&amp;rdquo; is a file on your laptop named &lt;code&gt;terraform.tfstate.backup2&lt;/code&gt;, stop. Here are some tips to not embarrass yourself in front of management.&lt;/p&gt;
&lt;h3 id="1-remote-state-is-non-negotiable"&gt;1. Remote State is Non-Negotiable&lt;/h3&gt;
&lt;p&gt;If you work on a team (or ever plan to), your state file cannot live on your local machine.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The Problem:&lt;/strong&gt; If two people run &lt;code&gt;terraform apply&lt;/code&gt; at the same time with different local states, you get a race condition that corrupts everything.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The Fix:&lt;/strong&gt; Use a &lt;strong&gt;Remote Backend&lt;/strong&gt; (like AWS S3).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;The Lock:&lt;/strong&gt; Use &lt;strong&gt;DynamoDB&lt;/strong&gt; for state locking. This prevents &amp;ldquo;Person B&amp;rdquo; from writing to the state while &amp;ldquo;Person A&amp;rdquo; is still deploying.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-hcl" data-lang="hcl"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#75715e"&gt;# backend.tf
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#66d9ef"&gt;terraform&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &lt;span style="color:#66d9ef"&gt;backend&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;s3&amp;#34;&lt;/span&gt; {
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; bucket &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;my-corp-terraform-state&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; key &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;prod/app-server/terraform.tfstate&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; region &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;us-east-1&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; dynamodb_table &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#e6db74"&gt;&amp;#34;terraform-state-locks&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; encrypt &lt;span style="color:#f92672"&gt;=&lt;/span&gt; &lt;span style="color:#66d9ef"&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; }
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;img src="fear.png" alt="Fear" style="width: 100%; height: auto; border-radius: 8px;"&gt;
*Fig: Actual footage of a DevOps engineer looking at a local state file.*
&lt;h3 id="2-keep-it-dry-dummy"&gt;2. Keep it DRY Dummy!&lt;/h3&gt;
&lt;p&gt;Stop Copy-Pasting resource blocks. If you need 5 web servers, do not write the &lt;code&gt;aws_instance&lt;/code&gt; block 5 times. Use &lt;strong&gt;Modules&lt;/strong&gt;.&lt;/p&gt;</description></item></channel></rss>