<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Anthony Elorm Zottor on Medium]]></title>
        <description><![CDATA[Stories by Anthony Elorm Zottor on Medium]]></description>
        <link>https://medium.com/@aezottor?source=rss-99e9d8049518------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*CdNQ29PL20JYNEH3</url>
            <title>Stories by Anthony Elorm Zottor on Medium</title>
            <link>https://medium.com/@aezottor?source=rss-99e9d8049518------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 10:27:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aezottor/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Ready for Terraform Certification: My Final 3 Days of Exam Preparation]]></title>
            <link>https://medium.com/@aezottor/ready-for-terraform-certification-my-final-3-days-of-exam-preparation-8083e0d6fa4f?source=rss-99e9d8049518------2</link>
            <guid isPermaLink="false">https://medium.com/p/8083e0d6fa4f</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[terraform]]></category>
            <dc:creator><![CDATA[Anthony Elorm Zottor]]></dc:creator>
            <pubDate>Sat, 25 Apr 2026 05:25:43 GMT</pubDate>
            <atom:updated>2026-04-25T05:25:43.240Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oN5iLHLwawnVMWTsgy8vtg.jpeg" /></figure><p>Over the last 30 days, I went from learning the basics of Terraform to building real infrastructure — servers, modules, state management workflows, and CI/CD pipelines.</p><p>But the final three days were different.</p><p>This wasn’t about learning new concepts. It was about <strong>proving readiness, identifying gaps, and locking in confidence before the exam</strong>.</p><p>Here’s exactly how I approached Days 28–30 — and what made the difference.</p><h3>Day 28: Simulating the Real Exam</h3><p>Day 28 was my first serious test under pressure: <strong>two full practice exams, back-to-back</strong>.</p><p>Each exam:</p><ul><li>57 questions</li><li>60 minutes</li><li>No notes, no Google</li></ul><h3>My Scores</h3><ul><li>Exam 1: <strong>42/57 (73.7%)</strong></li><li>Exam 2: <strong>46/57 (80.7%)</strong></li></ul><p>The improvement wasn’t luck. It was a <strong>warm-up effect</strong> — my brain started recognizing patterns, commands, and scenarios faster.</p><p>But the real value wasn’t the score.</p><p>It was the <strong>wrong answers</strong>.</p><h3>The Most Important Exercise: Wrong-Answer Analysis</h3><p>Instead of just checking answers, I broke every mistake down:</p><ul><li>What I answered</li><li>What the correct answer was</li><li>Why my thinking was wrong</li><li>What Terraform actually does</li><li>A command I could run to reinforce it</li></ul><p>This changed everything.</p><p>I realized most of my mistakes came from:</p><ul><li>Confusing plan vs apply</li><li>Misunderstanding state behavior</li><li>Weak clarity on modules</li></ul><p>Not lack of knowledge — but <strong>mixing up similar concepts</strong>.</p><h3>Day 29: Turning Data into Strategy</h3><p>By Day 29, I had four exam results. Now the goal was clear:</p><blockquote><em>Stop practicing blindly. Start practicing </em><strong><em>precisely</em></strong><em>.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y98GWx0Um7C_R-aQcZkitQ.png" /></figure><p>This trend told me something important:</p><ul><li>I wasn’t guessing anymore</li><li>My understanding was stabilizing</li><li>My speed was improving</li></ul><h3>Persistent Weak Areas</h3><p>Across multiple exams, the same topics kept showing up:</p><h4>1. State Management</h4><ul><li>terraform state rm does NOT destroy infrastructure</li><li>terraform import does NOT create configuration</li></ul><h4>2. Workspace Behavior</h4><ul><li>Each workspace = separate state</li><li>CLI workspaces ≠ Terraform Cloud workspaces</li></ul><h4>3. Provider Version Constraints</h4><ul><li>~&gt; 1.0 vs ~&gt; 1.0.0 matters more than you think</li></ul><h4>4. Command Workflow</h4><pre>terraform init → terraform validate → terraform plan → terraform apply</pre><h3>Hands-On Fix (The Game Changer)</h3><p>Instead of rereading docs, I ran commands:</p><pre>terraform state list<br>terraform state show random_id.test<br>terraform state rm random_id.test</pre><p>That single exercise made state behavior <em>click instantly</em>.</p><p>This was the biggest lesson of the entire challenge:</p><blockquote><em>You don’t learn Terraform by reading it.<br> You learn Terraform by </em><strong><em>breaking and fixing it</em></strong><em>.</em></blockquote><h3>Day 30: Final Validation</h3><p>The last day wasn’t about learning — it was about <strong>confidence</strong>.</p><h3>Final Exam Score</h3><ul><li>Exam 5: <strong>50/57 (87.7%)</strong></li></ul><p>From 73% → 87% in three days.</p><p>That improvement told me everything I needed to know:</p><ul><li>My knowledge is consistent</li><li>My mistakes are now edge cases</li><li>I am ready</li></ul><h3>Fill-in-the-Blank Test: Real Recall</h3><p>Unlike multiple choice, this forced pure memory:</p><ul><li>terraform fmt</li><li>prevent_destroy = true</li><li>terraform.workspace</li><li>.terraform.lock.hcl</li></ul><p>No guessing. No hints.</p><p>This confirmed something critical:</p><blockquote><em>I wasn’t recognizing answers anymore — I was </em><strong><em>recalling them</em></strong><em>.</em></blockquote><h3>What Actually Changed (The Real Reflection)</h3><p>At the start, I saw infrastructure as:</p><ul><li>Manual</li><li>Environment-specific</li><li>Fragile</li></ul><p>Now I see it as:</p><ul><li>Version-controlled</li><li>Repeatable</li><li>Automated</li><li>Predictable</li></ul><p>Terraform didn’t just teach me a tool.</p><p>It changed how I think about systems.</p><h3>The Hardest Thing I Learned</h3><p>State management.</p><p>At first, it felt abstract and confusing:</p><ul><li>Why does state exist?</li><li>Why doesn’t Terraform just “know”?</li></ul><p>But once it clicked, everything made sense:</p><ul><li>Why drift happens</li><li>Why remote state matters</li><li>Why teams need locking</li></ul><p>That moment shifted my understanding from beginner to practitioner.</p><h3>Final Takeaways</h3><p>If you’re preparing for the Terraform Associate exam:</p><h3>1. Practice Exams Are Everything</h3><p>They expose what you <em>think</em> you know vs what you actually know.</p><h3>2. Wrong Answers Are Gold</h3><p>Every mistake is a guaranteed future point — if you analyze it properly.</p><h3>3. Hands-On Beats Reading</h3><p>Run the command. Break the state. Fix it.</p><h3>4. Consistency &gt; High Scores</h3><p>A steady 80% is better than random 90% and 60%.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8083e0d6fa4f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Build a Multi-Region, Highly Available Web App on AWS — Concepts First, Code Second]]></title>
            <link>https://medium.com/@aezottor/how-to-build-a-multi-region-highly-available-web-app-on-aws-concepts-first-code-second-cf28832125f0?source=rss-99e9d8049518------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf28832125f0</guid>
            <category><![CDATA[high-availability]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Anthony Elorm Zottor]]></dc:creator>
            <pubDate>Thu, 23 Apr 2026 10:59:16 GMT</pubDate>
            <atom:updated>2026-04-23T10:59:50.900Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Day 27 of my 30-Day Terraform Challenge: pre-baked AMIs (bonus), DNS failover, cross-region databases — and what “high availability” actually means in practice.</em></p><p>There’s a point in every engineer’s journey where:</p><blockquote><em>“It works on my machine”<br> becomes<br> “It works in production.”</em></blockquote><p>And if you keep going, you eventually reach:</p><blockquote><em>“It still works… even when parts of the cloud fail.”</em></blockquote><p>That’s the level this project is about.</p><p>On Day 27 of my 30-Day Terraform Challenge, I built a <strong>multi-region, highly available web application on AWS</strong> — entirely defined in Terraform, spanning two regions, with automated failover, replicated data, and self-healing infrastructure.</p><p>This isn’t just about making things work.<br>It’s about designing systems that <strong>keep working when things break</strong>.</p><h3>What High Availability Really Means</h3><p>High availability isn’t zero downtime.</p><p>It’s the ability of a system to <strong>absorb failures without becoming unavailable</strong>.</p><p>Two metrics define it:</p><ul><li><strong>RTO (Recovery Time Objective):</strong> how long recovery takes</li><li><strong>RPO (Recovery Point Objective):</strong> how much data you can afford to lose</li></ul><p>This architecture targets:</p><ul><li>~90 seconds RTO for AZ failures</li><li>~10–30 minutes RTO for full regional failures</li><li>RPO of seconds to minutes (not zero — and that trade-off is intentional)</li></ul><h3>The System at a Glance</h3><pre>Internet<br>    │<br>    ▼<br>Route53 (Failover DNS)<br>    │<br>    ├──► us-east-1 (PRIMARY)<br>    │        ALB → ASG → RDS (Multi-AZ)<br>    │<br>    └──► us-west-2 (SECONDARY)<br>             ALB → ASG → RDS (Read Replica)</pre><p>Everything here — across both regions — is deployed with a single terraform apply.</p><p>Terraform defines the infrastructure.<br>The architecture defines the resilience.</p><h3>Availability Zones: The First Layer of Resilience</h3><p>Every AWS region is split into Availability Zones — isolated data centres with independent power and networking.</p><p>Designing for HA starts here.</p><p>A single-AZ deployment fails when that AZ fails.<br>A multi-AZ system continues operating.</p><p>In this project:</p><ul><li>Load balancers span AZs</li><li>EC2 instances are distributed across AZs</li><li>RDS runs with a standby in another AZ</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BE2Kh3XQs7by1JttTU4sLg.png" /></figure><p>This protects against the most common failures — hardware, networking, and localized outages.</p><h3>VPC Design: Isolation by Default</h3><p>The system is built on a standard three-tier network:</p><ul><li><strong>Public subnets</strong> → load balancer</li><li><strong>Private subnets</strong> → application servers</li><li><strong>Private subnets</strong> → database</li></ul><p>Nothing talks to the internet unless it absolutely must.</p><p>This is less about architectural elegance and more about <strong>risk reduction</strong>.</p><h3>The NAT Gateway Decision</h3><p>Private instances still need outbound access. That’s where NAT Gateways come in.</p><p>There are two options:</p><ul><li>One NAT Gateway (cheaper, fragile)</li><li>One per AZ (more expensive, resilient)</li></ul><p>This architecture uses <strong>one per AZ</strong>.</p><p>Because a single NAT Gateway in one AZ is a hidden single point of failure.</p><p>This is a recurring theme:<br><strong>resilience often costs money — and that’s a deliberate choice.</strong></p><h3>VPC Flow Logs</h3><p>Enabled by default.</p><p>Not for convenience — for <strong>forensics</strong>.</p><p>When something breaks in production, flow logs are often the only way to reconstruct what actually happened.</p><h3>The Load Balancer: Traffic Control and Truth Source</h3><p>The Application Load Balancer does two critical things:</p><ol><li>Distributes traffic</li><li>Decides which instances are healthy</li></ol><p>That second role is more important than most people realise.</p><h3>Health Checks Done Right</h3><p>We use a dedicated endpoint:</p><pre>/health → returns OK</pre><p>Not /.</p><p>Because health checks should answer one question:</p><blockquote><em>“Can this instance serve traffic?”</em></blockquote><p>Nothing more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*naF_MfApZh1z1e_di774-w.png" /></figure><h3>Graceful Draining</h3><pre>deregistration_delay = 30</pre><p>Instances aren’t killed immediately.<br>They finish in-flight requests first.</p><p>Small setting. Big impact on user experience.</p><h3>Auto Scaling Groups: Self-Healing Compute</h3><p>The ASG ensures:</p><ul><li>failed instances are replaced</li><li>traffic spikes are absorbed</li><li>deployments happen without downtime</li></ul><p>The most important setting:</p><pre>health_check_type = &quot;ELB&quot;</pre><p>This means health is determined by <strong>real traffic behaviour</strong>, not just VM status.</p><h3>IMDSv2: Closing a Real Attack Vector</h3><pre>http_tokens = &quot;required&quot;</pre><p>This prevents attackers from exploiting SSRF vulnerabilities to steal IAM credentials.</p><p>Security at this level isn’t optional — it’s baseline.</p><h3>Pre-Baked AMIs (Bonus — and a Big One)</h3><p>This was my upgrade to the base project.</p><h3>The Problem</h3><p>Installing software at boot time:</p><ul><li>is slow (minutes)</li><li>introduces variability</li><li>delays scaling and recovery</li></ul><h3>The Shift: Immutable Infrastructure</h3><p>Instead of installing at runtime, we bake everything into the AMI using Packer.</p><p>By the time an instance launches:</p><ul><li>OS is updated</li><li>Apache is installed</li><li>health endpoint exists</li><li>permissions are set</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eZgXqh2OtiUfk-g12LijDA.png" /></figure><h3>Runtime Becomes Minimal</h3><p>The instance now only:</p><ul><li>fetches metadata</li><li>renders dynamic content</li><li>starts services</li></ul><p>Boot time drops to ~30–60 seconds.</p><h3>Why This Matters</h3><p>During failover or scaling events:</p><blockquote><em>Speed is resilience.</em></blockquote><p>Pre-baked AMIs are one of the clearest upgrades from “working system” → “production system”.</p><h3>RDS: Two Layers of Protection</h3><p>This architecture uses two distinct mechanisms.</p><h3>Multi-AZ (Within Region)</h3><ul><li>synchronous replication</li><li>automatic failover</li><li>zero data loss</li></ul><h4>Cross-Region Read Replica</h4><ul><li>asynchronous replication</li><li>protects against regional failure</li><li>introduces replication lag</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wLq_U99ExBdi_lQeFJVh-w.png" /></figure><h4>The Hidden Gotcha: Cross-Region Encryption and KMS</h4><p>One thing that isn’t obvious until you hit it:</p><p>If your primary database is encrypted, your cross-region replica must be encrypted too.</p><p>That sounds simple — until you realise that AWS KMS keys are region-specific.</p><p>You cannot reuse the same encryption key across regions. The replica in us-west-2 cannot “see” the KMS key from us-east-1.</p><p>The first time I applied this configuration, Terraform failed with:</p><pre>InvalidParameterCombination: Cannot create a cross region unencrypted read replica from encrypted source</pre><p>The fix was to explicitly define a separate KMS key in the secondary region and pass that into the replica configuration.</p><p>This is one of those details that doesn’t show up in architecture diagrams — but absolutely matters in real deployments.</p><p>Terraform caught the issue early, before AWS even attempted the build. That’s one of the underrated advantages of Infrastructure as Code: validation happens before failure.</p><h3>The Trade-Off</h3><p>Failover is not symmetrical:</p><ul><li>Web tier → automatic (~150 seconds)</li><li>Database → manual (10–30 minutes)</li></ul><p>This is the real-world compromise between:</p><ul><li>cost</li><li>complexity</li><li>resilience</li></ul><h3>Route53: The Failover Brain</h3><p>Route53 controls traffic using DNS failover.</p><p>Two records:</p><ul><li>PRIMARY → us-east-1</li><li>SECONDARY → us-west-2</li></ul><h4>A Reality Check: Route53 vs Cloudflare</h4><p>In the reference architecture, Route53 is the “brain” that handles DNS failover between regions. However, in my live implementation, I didn’t end up using Route53 for DNS.</p><p>The domain for this project was already managed through Cloudflare, which meant DNS resolution and edge routing were handled outside AWS. Instead of duplicating DNS layers, I pointed Cloudflare directly to the Application Load Balancer.</p><p>The important takeaway is that the provider doesn’t matter — the pattern does.</p><p>Whether you use Route53 or Cloudflare:</p><ul><li>You define a primary endpoint</li><li>You define a secondary endpoint</li><li>You use health signals to decide when to fail over</li></ul><p>DNS is the control plane of high availability. It’s the layer that decides where users go when something breaks — regardless of which vendor implements it.</p><h3>Critical Setting</h3><pre>evaluate_target_health = true</pre><p>This ensures failover considers:</p><ul><li>ALB health</li><li>instance health</li></ul><p>Not just “is something responding.”</p><h3>S3 Replication: Completing the Picture</h3><p>Static assets replicate across regions.</p><p>So during failover:</p><ul><li>no cross-region dependency</li><li>no latency penalties</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c2nGrHjv1zGeTpSu09b8KQ.png" /></figure><h3>Terraform: The Glue That Makes This Possible</h3><p>Everything — both regions, all layers — is defined as code.</p><pre>modules/<br>├── vpc<br>├── alb<br>├── asg<br>├── rds<br>└── route53</pre><p>This gives you:</p><ul><li>repeatability</li><li>version control</li><li>safe evolution</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r3Jjp0YmEDrLT8NHrV6w3Q.png" /></figure><p>High availability is not free.<br>It’s a series of intentional trade-offs.</p><h3>Deletion Protection: The Feature That Blocked My Own Destroy</h3><p>After building everything, I ran terraform destroy, expecting a clean teardown.</p><p>It failed.</p><p>Not because Terraform was broken — but because the infrastructure was doing exactly what it was designed to do.</p><p>Both the Application Load Balancers and RDS instances had deletion protection enabled. This prevented Terraform from removing them, even though it created them.</p><p>The result was a dependency deadlock:</p><ul><li>ALBs couldn’t be deleted (protected)</li><li>VPC couldn’t be deleted (because ALBs were still inside it)</li></ul><p>Terraform returned errors like:</p><pre>OperationNotPermitted<br>DependencyViolation</pre><p>The fix required manually disabling deletion protection in the AWS console — in both regions — before running destroy again.</p><p>At first, this felt like friction.</p><p>But it’s actually a security feature.</p><p>Deletion protection is the safeguard that prevents:</p><ul><li>accidental deletions</li><li>misconfigured pipelines</li><li>“fat-finger” production outages</li></ul><p>In a real production environment, this is not optional. It’s the difference between a mistake and an incident.</p><p>The system was resilient — even against me.</p><h3>Closing Thought</h3><p>What changed for me on Day 27 wasn’t just technical.</p><p>It was perspective.</p><p>High availability isn’t something you “add” later.</p><p>It’s something that <strong>emerges from hundreds of small, correct decisions</strong>:</p><ul><li>a NAT Gateway per AZ</li><li>a /health endpoint</li><li>a single boolean like evaluate_target_health = true</li></ul><p>Each one seems minor.<br>Together, they determine whether your system stays up — or doesn’t.</p><p><strong>Note: ALWAYS remember to delete all your resources after. You are creating 90+ resources.</strong></p><p>Check project out <a href="https://github.com/elorm116/30-days-terraform">https://github.com/elorm116/30-days-terraform</a></p><p><em>#Terraform #AWS #DevOps #CloudArchitecture #HighAvailability #30DayTerraformChallenge</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf28832125f0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Scalable Web Application on AWS with EC2, ALB, and Auto Scaling using Terraform]]></title>
            <link>https://medium.com/@aezottor/building-a-scalable-web-application-on-aws-with-ec2-alb-and-auto-scaling-using-terraform-69b7b66a9e3b?source=rss-99e9d8049518------2</link>
            <guid isPermaLink="false">https://medium.com/p/69b7b66a9e3b</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-architecture]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <dc:creator><![CDATA[Anthony Elorm Zottor]]></dc:creator>
            <pubDate>Sun, 19 Apr 2026 09:54:11 GMT</pubDate>
            <atom:updated>2026-04-19T09:54:11.145Z</atom:updated>
            <content:encoded><![CDATA[<p>Yesterday I deployed a static website on S3.<br>Today, I built something much closer to production reality — a <strong>dynamic web application that scales automatically with demand</strong>.</p><p>This system:</p><ul><li>Adds instances when CPU is high</li><li>Removes them when traffic drops</li><li>Routes traffic through a load balancer</li><li>Self-heals when instances fail</li></ul><p>All powered by <strong>three Terraform modules</strong> working together.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1I61pmCaITi8Iv6JFxJcig.png" /></figure><h3>Why Three Modules Instead of One?</h3><p>It’s tempting to put everything in one main.tf. That works… until you need to reuse or scale it.</p><p>I split the architecture into three modules because each solves a different problem:</p><ul><li><strong>ec2 module</strong> → defines <em>what instances are</em></li><li><strong>alb module</strong> → defines <em>how traffic enters</em></li><li><strong>asg module</strong> → defines <em>how the system scales</em></li></ul><p>This separation gives:</p><ul><li>Reusability</li><li>Clear ownership</li><li>Easier debugging</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rB6xfF_4Xep4NsLrjKDRCA.png" /></figure><h3>The Three Wires That Make Everything Work</h3><p>The real architecture isn’t the resources — it’s how they connect.</p><h3>1. ALB Security Group → EC2</h3><pre>module &quot;ec2&quot; {<br>  alb_security_group_id = module.alb.alb_security_group_id<br>}</pre><p>Ensures:</p><ul><li>EC2 is not publicly accessible</li><li>ALB is the only entry point</li></ul><h3>2. Launch Template → ASG</h3><pre>module &quot;asg&quot; {<br>  launch_template_id = module.ec2.launch_template_id<br>}</pre><p>Defines what instances the ASG launches.</p><h3>3. Target Group → ASG</h3><pre>module &quot;asg&quot; {<br>  target_group_arns = [module.alb.target_group_arn]<br></pre><p>Ensures:</p><ul><li>Instances automatically receive traffic</li><li>Only healthy instances are used</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cz1kbbH9NiIjOhr75RurbA.png" /></figure><h3>The Most Important Line of Configuration</h3><pre>health_check_type = &quot;ELB&quot;</pre><h3>Without it:</h3><ul><li>Only VM health is checked</li><li>Broken apps stay “healthy”</li></ul><h3>With it:</h3><ul><li>ALB checks /health endpoint</li><li>ASG replaces unhealthy instances automatically</li></ul><p>This enables <strong>self-healing infrastructure</strong></p><h3>How Auto Scaling Works</h3><p>When traffic increases:</p><ol><li>CPU ≥ 70%</li><li>CloudWatch alarm triggers</li><li>ASG adds instance</li><li>ALB starts routing traffic</li></ol><p>When traffic drops:</p><ol><li>CPU ≤ 30%</li><li>ASG removes instance</li></ol><p>Cooldowns prevent instability.</p><h3>Live Application</h3><p>After deployment:</p><pre>terraform output alb_dns_name</pre><p>Open in browser → you’ll see:</p><ul><li>Custom HTML page</li><li>Instance ID changes on refresh</li><li>Traffic distributed across AZs</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_zmUfXYWxqL-sBqY6ZvRKA.png" /></figure><h3>Observability with CloudWatch</h3><p>Dashboard tracks:</p><ul><li>CPU utilization</li><li>Instance count</li><li>Alarm states</li></ul><p>At idle:</p><ul><li>CPU ~10%</li><li>Stable instance count</li></ul><h3>Cleanup</h3><pre>terraform destroy</pre><ul><li>All resources removed</li><li>No ongoing charges</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QMJUuTm0fUwNWM7wclGGEw.png" /></figure><h3>Key Takeaways</h3><ul><li>Modular Terraform = scalable architecture</li><li>Connections between modules matter most</li><li>health_check_type = &quot;ELB&quot; is critical</li><li>Auto Scaling = metrics → alarms → action</li></ul><p>This project shifted my mindset from <strong>deploying infrastructure</strong> to <strong>designing systems</strong>.</p><p><em>Part of the 30-Day Terraform Challenge</em><br> <em>#Terraform #AWS #AutoScaling #IaC #CloudEngineering</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=69b7b66a9e3b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying a Static Website with Terraform on AWS: What Broke, What Worked, and the Fix]]></title>
            <link>https://medium.com/@aezottor/deploying-a-static-website-with-terraform-on-aws-what-broke-what-worked-and-the-fix-db1ac9f06081?source=rss-99e9d8049518------2</link>
            <guid isPermaLink="false">https://medium.com/p/db1ac9f06081</guid>
            <category><![CDATA[infrastructure-as-code]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[terraform]]></category>
            <dc:creator><![CDATA[Anthony Elorm Zottor]]></dc:creator>
            <pubDate>Sun, 19 Apr 2026 06:53:19 GMT</pubDate>
            <atom:updated>2026-04-19T06:53:19.689Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Day 25 of the 30-Day Terraform Challenge</strong></p><p>I tried to deploy a production-grade S3 + CloudFront static website using Terraform…</p><p>…and AWS blocked me with a <strong>403 error before I could finish</strong>.</p><p>This post is the full breakdown — the architecture, what failed, how I adapted, and the key lessons that actually matter in real-world infrastructure work.</p><h3>Project Goals</h3><p>The objective wasn’t just to “host a website.”</p><p>I wanted to build something closer to real-world infrastructure:</p><ul><li>A <strong>reusable Terraform module</strong> for static website hosting</li><li>Proper <strong>environment separation</strong> (dev vs production)</li><li><strong>Remote state management</strong> with native locking</li><li>A flexible architecture that can <strong>handle failure without breaking</strong></li></ul><h3>Architecture Overview</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YHGrM-JPhxYcMYDD" /></figure><p><strong>Planned setup:</strong></p><ul><li><strong>S3 bucket</strong> → stores static website files</li><li><strong>CloudFront</strong> → CDN layer for performance + HTTPS</li><li><strong>Terraform</strong> → provisions everything as code</li></ul><h3>Project Structure</h3><pre>day25-static-website/<br>├── bootstrap/                     # Creates S3 state bucket<br>├── modules/<br>│   └── s3-static-website/<br>│       ├── main.tf<br>│       ├── variables.tf<br>│       └── outputs.tf<br>└── envs/<br>    └── dev/<br>        ├── main.tf<br>        ├── terraform.tfvars<br>        ├── provider.tf<br>        ├── backend.tf<br>        ├── backend.hcl<br>        └── templates/</pre><h3>Key Architecture Decisions</h3><h4>1. Centralized Module</h4><p>All heavy lifting (S3, IAM, optional CloudFront) lives inside a reusable module.</p><h4>2. Thin Environment Layer</h4><p>The dev environment simply calls the module with variables — clean and scalable.</p><h4>3. Partial Backend Configuration</h4><p>Separating backend config improves security and flexibility:</p><pre># backend.hcl<br>bucket       = &quot;mali-terraform-state-day25&quot;<br>key          = &quot;day25/static-website/dev/terraform.tfstate&quot;<br>region       = &quot;us-east-1&quot;<br>use_lockfile = true<br>encrypt      = true</pre><h4>4. Native State Locking (Big Win)</h4><p>Using:</p><pre>use_lockfile = true</pre><p>No DynamoDB table needed. Simpler setup, fewer moving parts.</p><h3>What Broke</h3><p>When I tried to create the CloudFront distribution, Terraform failed with:</p><pre>AccessDenied: Your account must be verified before you can add new CloudFront resources.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vL5u02JKfHV5-PrViPft5g.png" /></figure><p>This is an <strong>AWS account-level restriction</strong>, common with newer accounts.</p><p>No CloudFront = no CDN layer<br>No CDN layer = deployment blocked (if not designed properly)</p><h3>The Fix: Design for Failure</h3><p>Instead of stopping the deployment, I introduced a <strong>feature flag</strong>.</p><pre>variable &quot;enable_cloudfront&quot; {<br>  description = &quot;Enable CloudFront distribution&quot;<br>  type        = bool<br>  default     = true<br>}</pre><p>Then in dev:</p><pre>enable_cloudfront = false</pre><h3>Result:</h3><ul><li>Terraform apply <strong>succeeds</strong></li><li>S3 static website is fully deployed</li><li>CloudFront can be enabled later without refactoring</li></ul><p>The system remains <strong>functional under constraints</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J2KnPIo0FXel22LUHdRXjA.png" /></figure><h3>Deployment Workflow</h3><pre># 1. Bootstrap remote state<br>cd bootstrap<br>terraform init<br>terraform apply<br><br># 2. Deploy environment<br>cd ../envs/dev<br>terraform init -reconfigure -backend-config=backend.hcl<br>terraform plan<br>terraform apply</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v2YbYexDOKMjBWgnhwViig.png" /></figure><h3>Key Lessons</h3><h4>1. Design for Failure, Not Perfection</h4><p>If one component fails (like CloudFront), the entire system shouldn’t collapse.</p><h4>2. Feature Flags Are Essential in Terraform</h4><p>Using enable_* variables makes your modules adaptable and production-ready.</p><h4>3. Keep Architecture Flexible</h4><p>Optional layers (CDN, monitoring, etc.) should never block core functionality.</p><h4>4. State Management Matters Early</h4><p>Using use_lockfile = true simplified state locking without extra infrastructure.</p><h4>5. Real DevOps ≠ Perfect Deployments</h4><p>Real engineering is about:</p><ul><li>adapting quickly</li><li>debugging effectively</li><li>shipping anyway</li></ul><h3>Final Thoughts</h3><p>Day 25 wasn’t about deploying everything perfectly.</p><p>It was about <strong>handling constraints without breaking the system</strong>.</p><p>Even without CloudFront:</p><ul><li>The website is live</li><li>The Terraform code is clean</li><li>The architecture is scalable</li></ul><p>And when AWS verification is complete?</p><p>→ Flip one variable<br> → Re-run terraform apply<br> → CloudFront goes live</p><p>No redesign needed.</p><h3>Next Steps</h3><ul><li>Verify AWS account → enable CloudFront</li></ul><h4>Let’s Talk</h4><p>If you’re learning Terraform, this is the part most tutorials skip.</p><p>Not everything works the first time.</p><p>The real skill is knowing how to <strong>adapt without breaking your architecture</strong>.</p><p>Have you ever hit an AWS limitation that forced you to rethink your design?</p><p>#Terraform #AWS #S3 #CloudFront #DevOps #InfrastructureAsCode #30DayTerraformChallenge</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db1ac9f06081" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My Final Preparation for the Terraform Associate Exam]]></title>
            <link>https://medium.com/@aezottor/my-final-preparation-for-the-terraform-associate-exam-3153b01b56eb?source=rss-99e9d8049518------2</link>
            <guid isPermaLink="false">https://medium.com/p/3153b01b56eb</guid>
            <category><![CDATA[exams-preparation]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[terraform-associate-exam]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <dc:creator><![CDATA[Anthony Elorm Zottor]]></dc:creator>
            <pubDate>Sat, 11 Apr 2026 21:39:58 GMT</pubDate>
            <atom:updated>2026-04-11T21:39:58.543Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Up56iTppCWI79GtI6eJqtw.jpeg" /></figure><p><em>Day 24 of the 30-Day Terraform Challenge</em></p><p>I ran a full Terraform Associate exam simulation today:</p><p><strong>57 questions · 60 minutes · Score: 46/57 (80.7%)</strong></p><p>Not perfect — but enough to reveal something more important than the score:</p><p><em>The exam rewards precision, not just understanding.</em></p><p>This is the post I wish I had when I started — the exact gaps, mistakes, and patterns that actually show up under pressure.</p><h3>What the Simulation Exposed</h3><ul><li><strong>Weakest domain:</strong> CLI Commands (67%) → highest exam weight (26%)</li><li><strong>Strongest domains:</strong></li><li>IaC Concepts → 100%</li><li>Terraform Purpose → 91%</li></ul><p>The pattern was clear:</p><ul><li>Hands-on concepts → strong</li><li>CLI flags, edge cases, behavior → weak</li></ul><p>And that’s exactly where the exam lives.</p><h3>The Mistakes That Actually Matter</h3><p>These weren’t random — they were <em>pattern failures</em>:</p><ul><li><strong>terraform workspace new</strong> → creates <em>and</em> switches (not just create)</li><li><strong>terraform import</strong> → updates state only (no .tf generated)</li><li><strong>prevent_destroy</strong> → fails at <em>plan time</em>, not apply</li><li><strong>terraform plan</strong> → runs an <em>implicit refresh</em></li><li><strong>for_each with set</strong> → each.key == each.value</li><li><strong>init -upgrade vs </strong><strong>-reconfigure</strong> → completely different behaviors</li></ul><p>These are not “nice-to-know” details — they are <strong>exam traps</strong>.</p><h3>Three Traps Most People Miss</h3><h4>1. ?ref=main is NOT versioning</h4><pre>source = &quot;github.com/org/module?ref=main&quot;</pre><ul><li>main = branch (mutable)</li><li>v1.0.0 = tag (immutable)</li></ul><p>Always use tags in production.</p><h4>2. ~&gt; 4.0 vs ~&gt; 4.0.0</h4><pre>~&gt; 4.0     # allows all 4.x<br>~&gt; 4.0.0   # allows only 4.0.x</pre><p>Small difference, big exam trap.</p><h4>3. terraform plan -target</h4><p>Looks useful. It’s not (for normal workflows).</p><p>Only for:</p><ul><li>emergencies</li><li>state repair</li></ul><p>Never standard practice.</p><h3>What Changed for Me</h3><p>The biggest shift wasn’t learning more Terraform.</p><p>It was this:</p><blockquote><em>The gap between </em>“I understand this”<em> and </em>“I can answer this under time pressure”<em> is huge.</em></blockquote><p>Closing that gap required:</p><ul><li>drilling weak domains</li><li>understanding exact CLI behavior</li><li>practicing under real exam conditions</li></ul><h3>My Exam-Day Strategy</h3><ul><li><strong>Max 90 seconds per question</strong> → flag and move on</li><li><strong>Eliminate wrong answers first</strong></li><li><strong>Multi-select? Count answers before reading options</strong></li><li><strong>Mark negative questions (“NOT”) clearly</strong></li><li><strong>Return to flagged questions at the end</strong></li></ul><p>Simple — but this is what prevents careless mistakes.</p><h3>What Actually Helped Me</h3><p><strong>Most useful:</strong></p><ul><li>Official HashiCorp docs</li><li>Practice exams (timed)</li><li>Building real infrastructure</li><li>Writing my own questions</li></ul><p><strong>Least useful:</strong></p><ul><li>Surface-level tutorials</li><li>Passive learning (watching without doing)</li></ul><h3>Final Thought</h3><p>This wasn’t about getting 80%.</p><p>It was about identifying exactly where I fail under pressure — and fixing it before the real exam.</p><p><strong>Day 23 exposed the gaps.<br>Day 24 proved I can close them.</strong></p><p>#Terraform #TerraformAssociate #DevOps #IaC #CertificationPrep #30DayTerraformChallenge</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3153b01b56eb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Preparing for the Terraform Associate Exam — Key Resources and Tips]]></title>
            <link>https://medium.com/@aezottor/preparing-for-the-terraform-associate-exam-key-resources-and-tips-1c62e3512496?source=rss-99e9d8049518------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c62e3512496</guid>
            <category><![CDATA[terraform-associate-exam]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <category><![CDATA[exam-preparation]]></category>
            <dc:creator><![CDATA[Anthony Elorm Zottor]]></dc:creator>
            <pubDate>Fri, 10 Apr 2026 10:24:14 GMT</pubDate>
            <atom:updated>2026-04-10T10:24:14.848Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/679/1*DH24FV9A-sD__hkGoKcqTg.jpeg" /></figure><p>The book is done.</p><p>22 days of hands-on infrastructure — VPCs, ASGs, EKS clusters, multi-region deployments, Sentinel policies, and a full CI/CD pipeline.</p><p>Now it’s exam time.</p><p>If you’re preparing for the Terraform Associate exam, this is the roadmap I wish I had before starting.</p><h3>Start With an Honest Self-Audit</h3><p>The official study guide is the only source that truly matters:<br>HashiCorp Terraform Associate Study Guide</p><p>I went through every domain and rated myself:</p><ul><li>🟢 <strong>Green</strong> — I can explain it and have done it hands-on</li><li>🟡 <strong>Yellow</strong> — I understand it, but need practice</li><li>🔴 <strong>Red</strong> — I’m not confident</li></ul><h3>My Results After 22 Days</h3><ul><li><strong>65% Green</strong> — covered through hands-on work</li><li><strong>33% Yellow</strong> — needs reinforcement</li><li><strong>6% Red</strong> — barely touched</li></ul><p>The key insight:</p><blockquote><em>“Review state management” is not a study plan.<br> “Run </em><em>terraform state mv on real infrastructure and write 3 questions about it” is.</em></blockquote><h3>The Most Underestimated Domain: CLI (26%)</h3><p>This is the <strong>highest-weighted domain</strong> — and where I think most people may lose marks.</p><p>It’s not just:</p><blockquote><em>“What does </em><em>terraform plan do?”</em></blockquote><p>It’s:</p><ul><li>What does it <strong>NOT</strong> do?</li><li>How does it affect <strong>real infrastructure vs state</strong>?</li><li>Which <strong>flags change behavior</strong>?</li></ul><h3>Example: terraform state rm</h3><p><strong>What it does:</strong></p><ul><li>Removes the resource from the <strong>state file only</strong></li></ul><p><strong>What it does NOT do:</strong></p><ul><li>Does NOT delete anything in AWS</li></ul><p><strong>What happens next:</strong></p><ul><li>terraform plan shows the resource as <strong>new (to be created)</strong></li></ul><p><strong>Real-world use:</strong></p><ul><li>Handing off infrastructure to another team</li></ul><h3>Example: taint vs -replace</h3><ul><li>terraform taint → <strong>deprecated</strong></li><li>terraform apply -replace → <strong>current method</strong></li></ul><p>The exam still tests both.</p><h3>Example: Backend Flags</h3><ul><li>-reconfigure → ignore existing backend, <strong>no state migration</strong></li><li>-migrate-state → move state to new backend</li></ul><p>This distinction shows up in exam questions.</p><h3>Example: Output Flags</h3><ul><li>-raw → clean string (for scripts)</li><li>-json → structured output (for automation)</li></ul><h3>Example: terraform graph</h3><p>Outputs <strong>DOT format</strong> → visualize with Graphviz:</p><pre>terraform graph | dot -Tsvg &gt; graph.svg</pre><h3>Must-Know Commands</h3><ul><li>init, validate, fmt</li><li>plan, apply, destroy</li><li>output</li><li>state (list, show, mv, rm)</li><li>import</li><li>taint / replace</li><li>workspace</li><li>providers</li><li>login</li><li>graph</li></ul><p>For each:</p><ul><li>What it does</li><li>What it doesn’t do</li><li>When to use it</li></ul><h3>Provider Aliases — Easy to Get Wrong</h3><pre>provider &quot;aws&quot; {<br>  region = &quot;us-east-1&quot;<br>}<br><br>provider &quot;aws&quot; {<br>  alias  = &quot;west&quot;<br>  region = &quot;us-west-2&quot;<br>}<br>resource &quot;aws_s3_bucket&quot; &quot;west&quot; {<br>  provider = aws.west<br>  bucket   = &quot;my-west-bucket&quot;<br>}</pre><h3>Key Exam Insight</h3><p><strong>Aliases are NOT automatically passed to modules.</strong></p><p>You must pass them explicitly:</p><pre>module &quot;west_resources&quot; {<br>  source = &quot;./modules/bucket&quot;<br><br>providers = {<br>    aws = aws.west<br>  }<br>}</pre><p>If you don’t → module uses default provider.</p><h3>Non-Cloud Providers (Frequently Tested)</h3><p>Terraform is not just cloud.</p><h3>random</h3><ul><li>Unique naming</li><li>Password generation</li></ul><h3>local</h3><ul><li>Writes files (inventory, configs)</li></ul><h3>tls</h3><ul><li>Key/cert generation</li></ul><h3>null_resource</h3><ul><li>Trigger-based execution</li></ul><h3>Example</h3><pre>resource &quot;random_id&quot; &quot;suffix&quot; {<br>  byte_length = 4<br>}<br><br>resource &quot;random_password&quot; &quot;db&quot; {<br>  length  = 24<br>  special = true<br>}</pre><p><strong>Important exam point:</strong></p><ul><li>Sensitive values are <strong>hidden in output</strong></li><li>BUT stored in <strong>plaintext in state</strong></li></ul><h3>What sensitive = true Actually Does</h3><pre>output &quot;db_password&quot; {<br>  value     = random_password.db.result<br>  sensitive = true<br>}</pre><h4>It DOES:</h4><ul><li>Hide value in CLI output</li><li>Hide value in plan output</li></ul><h4>It DOES NOT:</h4><ul><li>Encrypt state</li><li>Remove value from state</li><li>Prevent reuse</li></ul><p>It’s a <strong>display feature</strong>, not security.</p><h3>Practice Exam Results</h3><p><strong>Score: 17/20 (85%)</strong></p><p>The misses were more valuable than the correct answers.</p><h3>What I Got Wrong</h3><p><strong>1. Terraform Cloud execution modes</strong><br> Remote runs don’t inherit local env variables.</p><p><strong>2. Backend flags</strong><br> Confused -reconfigure vs -migrate-state.</p><p><strong>3. Apply without saved plan</strong><br> Terraform <strong>re-generates plan</strong> — doesn’t reuse the reviewed one.</p><h3>My Study Plan (Days 24–30)</h3><ul><li><strong>Day 24:</strong> state commands hands-on</li><li><strong>Day 25:</strong> backend migration + init flags</li><li><strong>Day 26:</strong> non-cloud providers + aliases</li><li><strong>Day 27:</strong> functions + provisioners</li><li><strong>Day 28:</strong> timed practice exam</li><li><strong>Day 29:</strong> CLI speed run + state deep dive</li><li><strong>Day 30:</strong> light review only</li></ul><p>Each session produces:</p><ul><li>Code</li><li>Questions</li><li>Notes</li></ul><p>No passive studying.</p><h3>The Biggest Mistake to Avoid</h3><p>Spending time on what you already know.</p><p>Green feels productive.<br>Yellow and red are where progress happens.</p><h3>Final Thought</h3><p>22 days down.<br>7 days to sharpen the edge.</p><h3>Resources</h3><ul><li>Official Study Guide:<br> <a href="https://developer.hashicorp.com/terraform/tutorials/certification-003/associate-study-003">https://developer.hashicorp.com/terraform/tutorials/certification-003/associate-study-00</a>4</li><li>Full Challenge Repo:<br> <a href="https://github.com/elorm116/30-day-terraform-challenge">https://github.com/elorm116/30-day-terraform-challenge</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c62e3512496" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Putting It All Together: The “Promotion” Pattern in Terraform]]></title>
            <link>https://medium.com/@aezottor/putting-it-all-together-the-promotion-pattern-in-terraform-6e07147f265f?source=rss-99e9d8049518------2</link>
            <guid isPermaLink="false">https://medium.com/p/6e07147f265f</guid>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Anthony Elorm Zottor]]></dc:creator>
            <pubDate>Thu, 09 Apr 2026 20:58:45 GMT</pubDate>
            <atom:updated>2026-04-09T21:02:30.434Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Day 22 of the 30-Day Terraform Challenge</blockquote><p>Twenty-two days ago, I was a DevOps engineer who provisioned infrastructure primarily through the “ClickOps” method of the AWS console. Today, I finished <em>Terraform: Up &amp; Running</em> and merged the final piece of an integrated CI/CD system that runs from git push to production with zero manual intervention—except where human judgment is explicitly required.</p><p>This post breaks down that end-to-end system, explores why application and infrastructure workflows are finally converging, and offers an honest reflection on 22 days of intensive learning.</p><h3>The Integrated Pipeline</h3><p>The key architectural insight from the final chapters of the challenge is this:</p><p><strong>Infrastructure code is just code.</strong></p><p>It deserves the same version control discipline, testing culture, and immutable artifact promotion as your application logic.</p><h3>The CI/CD Flow</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gwWj58rVC6WZY227xbUq9A.png" /><figcaption>Screenshot of your GitHub Actions run showing the sequence from Validate -&gt; Plan Dev -&gt; Plan Prod -&gt; Apply Dev -&gt; Apply Prod.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wHmRfYCTIFrsjkQgL-AjiQ.png" /></figure><h3>The “Immutable Artifact” Pattern</h3><p>In the app world, we promote Docker images. In the Terraform world, we promote <strong>Plan Files</strong>.</p><p>When I run terraform plan -out=ci.tfplan, I am creating a binary &quot;snapshot&quot; of exactly what will change.</p><p>In my Day 22 lab, <strong>Job 4</strong> creates the plan, and <strong>Job 6</strong> applies it.</p><p><strong>We never re-run the plan in Production.</strong> This prevents &quot;State Drift&quot; from sneaking in between your review and your deployment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QlVGZ67oR4pn6qX5xbJ5ow.png" /><figcaption>“Artifacts” section at the bottom of your GitHub run showing the <em>dev-plan-xxx</em> and <em>prod-plan-xxx</em> zip files.</figcaption></figure><pre># The CI Build Step<br>terraform plan -var-file=prod.tfvars -out=prod.tfplan<br><br># The Promotion Step (Manual Approval Triggered)<br>terraform apply prod.tfplan</pre><h3>Policy as Code: Sentinel &amp; Governance</h3><p>Governance shouldn’t be a PDF document; it should be code. Using Sentinel (or Open Policy Agent), we can block non-compliant infrastructure before it costs us money.</p><h3>The Day 22 Policy Guardrails:</h3><ul><li><strong>Allowed Instance Types:</strong> Hard-mandatory. Blocks any engineer from accidentally spinning up an m5.4xlarge when a t3.micro will do.</li><li><strong>Mandatory Tagging:</strong> Ensures the ManagedBy = &quot;Terraform&quot; tag is present for auditing.</li><li><strong>Cost Estimation Gate:</strong> A soft-mandatory gate that triggers an alert if a plan increases the monthly bill by more than $50.</li></ul><h3>Side-by-Side: App Code vs. Infra Code</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qT7Z02kUQHyP6GsOzGfweQ.png" /><figcaption>Note: I did not use Dynamodb in my project but just thought to add it here. I used the native S3 state lock featrure</figcaption></figure><h3>Reflection: What 22 Days Actually Built</h3><h4>1. The Mental Shift: Blast Radius</h4><p>Before this challenge, I thought about changes in terms of resources: <em>“I’m changing this Security Group.”</em> Now, I think in terms of dependencies: <em>“What services lose connectivity if this SG change fails?”</em> The blast radius is always larger than the resource itself.</p><h4>2. What was harder than expected?</h4><p>State management at module boundaries. When modules reference each other’s outputs across different state files, the dependency graph becomes a coordination problem.</p><p><strong>The Lesson:</strong> Keep tightly coupled resources in the same state file. Only reach for terraform_remote_state when the relationship is genuinely loose.</p><h4>3. What I would do differently</h4><p><strong>Start with modules on Day 1.</strong> I spent the first week writing flat resource blocks. Refactoring those into reusable modules on later was painful. If I did it again, I’d treat every resource as a module from the start.</p><h3>The Single Most Important Insight</h3><blockquote><strong><em>The gap between </em></strong><strong><em>terraform plan and </em></strong><strong><em>terraform apply is where incidents are born.</em></strong></blockquote><p>Running terraform apply without a saved plan means:</p><ul><li>You are applying something new</li><li>Not what was reviewed</li></ul><p>Plan file pinning makes deployments <strong>deterministic</strong>.</p><p>Terraform isn’t just a tool.</p><p>It’s a <strong>deployment system</strong>.</p><p>#30DayTerraformChallenge #DevOps #IaC #AWS #Terraform #CloudEngineering</p><p><strong>Full Code Repository:</strong> <a href="https://www.google.com/search?q=https://github.com/elorm116/30-day-terraform-challenge">github.com/elorm116/30-days-terraform</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6e07147f265f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Workflow for Deploying Infrastructure Code with Terraform]]></title>
            <link>https://medium.com/@aezottor/i-treated-terraform-like-code-until-it-took-down-my-infrastructure-51d3f3310de0?source=rss-99e9d8049518------2</link>
            <guid isPermaLink="false">https://medium.com/p/51d3f3310de0</guid>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <category><![CDATA[mindset]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Anthony Elorm Zottor]]></dc:creator>
            <pubDate>Thu, 09 Apr 2026 08:02:57 GMT</pubDate>
            <atom:updated>2026-04-09T08:17:09.415Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B2xMkdsokCs3bYQ0BFYu9A.png" /></figure><p>Yesterday, I mapped out a 7-step workflow for deploying application code.</p><p>Today, I applied that same framework to infrastructure.</p><p>That’s when it hit me:</p><blockquote><strong><em>A bad application deploy returns a 500 error.<br>A bad infrastructure deploy can destroy your production database.</em></strong></blockquote><p>That’s not theoretical.</p><p>I’ve seen a terraform apply trigger a subnet change across AZs mid-deploy. The result?<br> A 40-minute outage because instances couldn’t communicate.</p><p>That experience changed how I deploy infrastructure forever.</p><p>This post is the workflow I use now — and the safeguards that prevent those kinds of failures.</p><h3>The 7-Step Terraform Deployment Workflow</h3><h4>Step 1 — Version Control (Non-Negotiable)</h4><p>Terraform lives in Git. No exceptions.</p><p>My main branch rules:</p><ul><li>At least 1 approval before merge</li><li>All checks must pass</li><li>No direct pushes</li><li>Branch cannot be deleted</li></ul><p>Without this?</p><p>Code review is just a suggestion.</p><h4>Step 2 — Run the Code Locally</h4><p>This is where Terraform diverges from application code.</p><p>You’re not just “running code.”<br> You’re comparing <strong>desired state vs real infrastructure</strong>.</p><pre>terraform workspace select dev<br>terraform plan -var-file=dev.tfvars -out=day21.tfplan</pre><p>What I always check:</p><ul><li>Any <strong>destroy</strong> actions → pause immediately</li><li>-/+ (replacement) vs ~ (in-place update)</li><li>Unexpected resource changes</li></ul><p>If the plan surprises you…production will too.</p><h4>Step 3 — Make Changes (Then Re-Plan)</h4><p>Create a branch:</p><pre>git checkout -b add-cloudwatch-alarms</pre><p>Make your changes, then <strong>run plan again</strong>.</p><p>Why?</p><p>Because Terraform doesn’t fail when you write code.<br> It fails when it plans.</p><p>That second plan is the one that matters — it reflects reality.</p><h4>Step 4 — Submit for Review</h4><p>Your PR should answer one question:</p><blockquote><strong><em>“What exactly will happen in production?”</em></strong></blockquote><p>My PR template:</p><pre>## What this changes  <br>## Terraform plan output  <br>## Resources affected  <br>## Blast radius  <br>## Rollback plan</pre><p>If your reviewer has to run Terraform to understand your change…</p><p>You’ve already failed the review.</p><h4>Step 5 — Automated Checks</h4><p>My pipeline runs:</p><ul><li>terraform fmt --check</li><li>terraform validate</li><li>terraform plan (posted as PR comment)</li><li>terraform test</li></ul><p>Everything must pass before merge.</p><p>No exceptions.</p><h4>Step 6 — Merge and Version</h4><p>Once approved:</p><pre>git tag -a &quot;v1.4.0&quot; -m &quot;Add CloudWatch alarms&quot;<br>git push origin v1.4.0</pre><p>Versioning matters.</p><p>Without it, downstream systems can break silently on the next terraform init -upgrade.</p><h4>Step 7 — Apply (The Most Dangerous Step)</h4><p>This is where most teams get it wrong.</p><p>I never run:</p><pre>terraform apply</pre><p>Instead:</p><pre>terraform apply day21.tfplan</pre><p>Why?</p><p>Because this:</p><pre>terraform apply</pre><p>…generates a <strong>new plan at apply time</strong>.</p><p>That means:</p><ul><li>What you reviewed ≠ what gets applied</li></ul><p>That gap is where outages happen.</p><h3>The 4 Safeguards That Changed Everything</h3><p>These don’t exist in application deployments.</p><p>They exist because infrastructure failures are different.</p><h3>1. Destruction Requires Extra Approval</h3><p>If a plan includes:</p><ul><li>- (delete)</li><li>-/+ (replace)</li></ul><p>It gets a second approval.</p><p>Not optional.</p><p>Because deletes are permanent.</p><h3>2. Plan File Pinning (Most Important Rule)</h3><p>Always:</p><pre>terraform plan -out=reviewed.tfplan<br>terraform apply reviewed.tfplan</pre><p>Never:</p><pre>terraform apply</pre><p>Between plan and apply:</p><ul><li>State can change</li><li>Resources can drift</li><li>Data sources can update</li></ul><p>Plan pinning eliminates that risk.</p><h3>3. State Backup</h3><p>Terraform state is your <strong>source of truth</strong>.</p><p>If it breaks, Terraform can:</p><ul><li>Destroy real infrastructure</li><li>Lose track of resources</li></ul><p>My fix:</p><ul><li>S3 backend</li><li>Versioning enabled</li></ul><p>Recovery becomes possible.</p><h3>4. Blast Radius Thinking</h3><p>Before every PR, I ask:</p><ul><li>What depends on this?</li><li>What breaks if this fails halfway?</li><li>How do I recover?</li></ul><p>For small changes, impact is low.</p><p>For VPCs, IAM, or networking?</p><p>This thinking is the difference between:</p><ul><li>5-minute fix</li><li>3-hour outage</li></ul><h3>Sentinel: Guardrails for Terraform</h3><p>Think of Sentinel as:</p><blockquote><strong><em>“A firewall for bad infrastructure decisions.”</em></strong></blockquote><p>It runs between plan and apply.</p><h3>Example: Restrict Instance Types</h3><pre>allowed_instance_types = [<br>  &quot;t2.micro&quot;, &quot;t2.small&quot;, &quot;t3.micro&quot;<br>]</pre><p>Prevents:</p><ul><li>Expensive instances</li><li>Accidental scaling mistakes</li></ul><h3>Example: Protect Production</h3><p>Blocks:</p><ul><li>Deletes in prod</li></ul><p>Unless explicitly overridden.</p><h3>Example: Cost Control</h3><p>Prevents:</p><ul><li>Unexpected cost spikes</li><li>Oversized dev environments</li></ul><p>Terraform validates syntax.</p><p>Sentinel validates <strong>intent</strong>.</p><h3>Infrastructure vs Application Deployments</h3><p>Here’s the real difference:</p><h3>1. State Exists</h3><p>Applications don’t track history.</p><p>Terraform does.</p><p>Corrupt state = dangerous behavior.</p><h3>2. Destruction Is Real</h3><p>App failure → restart</p><p>Infra failure → rebuild</p><p>Sometimes with data loss.</p><h3>3. Everything Is Connected</h3><p>Change a VPC → affect every service</p><p>Change IAM → break access everywhere</p><p>Infrastructure has <strong>lateral impact</strong>.</p><h3>The One Rule I Never Break Now</h3><p>I never run:</p><pre>terraform apply</pre><p>Without a saved plan file.</p><p>Ever.</p><p>Because the one time I didn’t…</p><p>…it caused downtime.</p><h3>Final Thought</h3><p>This workflow isn’t a checklist.</p><p>It’s a system.</p><p>Each step forces the next:</p><ul><li>Branch protection → enables real review</li><li>Plan output → makes review meaningful</li><li>Plan pinning → makes apply deterministic</li></ul><p>And the safeguards?</p><p>They exist because infrastructure failures are:</p><ul><li>Slower to detect</li><li>Harder to fix</li><li>Much more expensive</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51d3f3310de0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Seven-Step Workflow That Made My Terraform Setup Feel Production-Ready]]></title>
            <link>https://medium.com/@aezottor/the-seven-step-workflow-that-made-my-terraform-setup-feel-production-ready-4f2f49af0837?source=rss-99e9d8049518------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f2f49af0837</guid>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[team-collaboration]]></category>
            <dc:creator><![CDATA[Anthony Elorm Zottor]]></dc:creator>
            <pubDate>Sun, 05 Apr 2026 18:47:48 GMT</pubDate>
            <atom:updated>2026-04-05T18:47:48.227Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2xnhHTeSvuSKgipJRxALJQ.png" /></figure><p>Most of my Terraform workflow used to look like this:</p><pre>terraform apply → check AWS console → “looks fine” → move on</pre><p>No versioning discipline. No real review. No guarantee that what I applied was actually what I intended.</p><p>It worked… until I started thinking about what would happen at scale.</p><p>So today, I did something different—I followed the same seven-step deployment workflow application teams have trusted for years—and applied it to my Terraform setup while updating my webserver cluster from <strong>v2 → v3.</strong></p><p>That’s when things started to click.</p><h3>The Seven Steps (What Changed for Me)</h3><h3>Step 1 — Version Control</h3><p>I already had my Terraform code in Git, but this step made me think more clearly about <em>what Git is actually responsible for</em>.</p><p>One thing became very obvious:</p><blockquote><em>Git tracks intent — not reality.</em></blockquote><p>The .tf files show what I <em>want</em> the infrastructure to look like.<br>But the actual infrastructure state lives somewhere else entirely.</p><p>That’s when it really clicked why:</p><ul><li>terraform.tfstate should never be in Git</li><li>Remote state (S3 / Terraform Cloud) is not optional — it’s foundational</li></ul><p>Before this, it felt like a best practice. Now it feels non-negotiable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-FvgKAnXB2guHnYny4KEEQ.png" /><figcaption>Git repository showing Terraform files and .gitignore excluding state</figcaption></figure><h3>Step 2 — Run Locally (Plan)</h3><pre>terraform plan -out=day20.tfplan<br>terraform show day20.tfplan</pre><p>This step hit differently this time.</p><p>Instead of just glancing at the output, I actually treated the plan like something I needed to <em>trust</em>.</p><pre>Plan: 0 to add, 1 to change, 0 to destroy.<br>~ user_data: v2 → v3<br>~ Version tag: v2 → v3</pre><p>Only one resource changed — exactly what I intended.</p><p>What really changed my mindset was using:</p><pre>terraform plan -out=day20.tfplan</pre><p>Saving the plan made me realize:</p><blockquote><em>This is the exact change I’m approving — nothing more, nothing less.</em></blockquote><p>Before this, I would just run terraform apply directly.<br> Now I can see how dangerous that actually is.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9ywEOlP6zkSShlRv2JkIdA.png" /><figcaption>terraform plan output showing v2 → v3 change</figcaption></figure><h3>Step 3 — Make the Code Change</h3><pre>git checkout -b update-app-version-day20<br># update app_version to v3<br>git commit -m &quot;Update app response to v3&quot;<br>git push origin update-app-version-day20</pre><p>This part felt familiar — just like application development.</p><p>But the key difference I noticed:</p><blockquote><em>Changing Terraform code doesn’t change anything… until apply runs.</em></blockquote><p>That separation between <em>writing</em> and <em>executing</em> infrastructure is something I didn’t fully appreciate before.</p><h3>Step 4 — Submit for Review</h3><p>This is where things really shifted for me.</p><p>Instead of just pushing code, I included the <strong>plan output in the PR</strong>:</p><pre>Plan: 0 to add, 1 to change, 0 to destroy.<br><br>~ aws_launch_template.web<br>  ~ user_data: v2 → v3<br>  ~ Version tag: v2 → v3</pre><p>And that’s when it clicked:</p><blockquote><em>The plan output is the real diff — not the </em><em>.tf code.</em></blockquote><p>A small change in a .tf file can have a huge impact in AWS.<br>Without the plan, you’re basically reviewing blind.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aVxbtZM6PDbM_7QwDuJ2pQ.png" /><figcaption>Pull Request with terraform plan output in description</figcaption></figure><h3>Step 5 — Automated Tests</h3><p>My GitHub Actions pipeline ran automatically:</p><pre>Success! 13 passed, 0 failed.</pre><p>This step made me think about something I hadn’t fully considered before:</p><blockquote><em>Infrastructure tests are not the same as application tests.</em></blockquote><ul><li>Unit tests are fast and cheap</li><li>Integration tests actually create resources → they cost money</li></ul><p>So running everything on every PR doesn’t make sense.</p><p>That balance between speed and cost is something I’m starting to understand better now.</p><h3>Step 6 — Merge and Release</h3><pre>git tag -a &quot;v1.3.0&quot; -m &quot;Update app to v3&quot;<br>git push origin v1.3.0</pre><p>Tagging felt like a small step — but it changed how I think about deployments.</p><blockquote><em>This tag represents a fixed, reproducible version of my infrastructure.</em></blockquote><p>Rollback isn’t “fix it quickly” anymore — it’s:</p><p>→ go back to a known version<br>→ apply it again</p><p>That’s a much safer mental model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fIC4yuEpBHXie4Bysg1F3g.png" /></figure><h3>Step 7 — Deploy</h3><pre>terraform apply day20.tfplan</pre><p>This part felt very different from how I used to deploy.</p><pre>Apply complete! Resources: 0 added, 1 changed, 0 destroyed.</pre><p>Then I verified:</p><pre>curl http://&lt;ALB_DNS&gt;</pre><pre>&lt;h1&gt;webservers-day20 (dev) — v3 🚀&lt;/h1&gt;</pre><p>Everything rolled out cleanly with no downtime.</p><p>But the biggest realization here was this:</p><blockquote><em>Infrastructure deployments are not always reversible.</em></blockquote><p>That’s something I never really felt when I was just running apply casually.</p><p>Now it makes sense why:</p><ul><li>plan review matters</li><li>saved plans matter</li><li>workflow discipline matters</li></ul><h3>Terraform Cloud — What Changed for Me</h3><p>Up to this point, I was running everything locally.</p><p>That works — but it comes with problems:</p><ul><li>Credentials live on my machine</li><li>No centralized history</li><li>Different environments per developer</li></ul><p>Switching to Terraform Cloud changed that.</p><pre>terraform {<br>  cloud {<br>    organization = &quot;your-org&quot;<br><br>workspaces {<br>      name = &quot;webserver-cluster-dev&quot;<br>    }<br>  }<br>}</pre><pre>terraform login<br>terraform apply</pre><p>Now:</p><ul><li>Runs execute in a consistent environment</li><li>Every apply is logged</li><li>There’s a clear audit trail</li></ul><p>That alone makes it feel more “production-ready.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JLGyk_GyR-Fo3hBA3dUN1Q.png" /><figcaption>Terraform Cloud run UI (plan history)</figcaption></figure><h3>Variable Management (Big Realization)</h3><p>Moving variables into Terraform Cloud made something very clear:</p><blockquote><em>Secrets should never live in code or logs. Ever.</em></blockquote><ul><li>AWS keys → stored as sensitive variables</li><li>Hidden in UI</li><li>Never printed in output</li></ul><p>Before, I understood this conceptually.<br>Now I’ve actually implemented it — and it feels completely different.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rSQoWh_CBbdizmFp30cCpw.png" /></figure><h3>Private Registry</h3><p>Publishing my module to the private registry was another shift.</p><p>Instead of:</p><pre>source = &quot;github.com/...&quot;</pre><p>I now use:</p><pre>source  = &quot;app.terraform.io/&lt;org&gt;/webserver-cluster/aws&quot;<br>version = &quot;0.0.4&quot; #any version of the module you want to deploy</pre><p>What stood out to me:</p><blockquote><em>A module being available isn’t enough — it needs to be discoverable and usable.</em></blockquote><p>The registry adds:</p><ul><li>versioning</li><li>documentation</li><li>structure</li></ul><p>That’s what makes it actually usable in a team setting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v-yCjxoWkZcuejCeKBkfFg.png" /></figure><h3>What Actually Changed for Me</h3><p>Before this, I thought I was “using Terraform properly.”</p><p>Now I can see I was skipping the parts that actually make it safe.</p><p>The biggest shift wasn’t technical — it was mindset:</p><ul><li>From running commands → to following a workflow</li><li>From “it works” → to “it’s controlled and predictable”</li></ul><p>And probably the biggest realization:</p><blockquote><em>Without a proper workflow, Terraform isn’t really engineering — it’s just controlled risk.</em></blockquote><h3>Key Takeaways</h3><ul><li>Following a real workflow changed how I trust my infrastructure</li><li>Saving and applying a reviewed plan feels significantly safer</li><li>The plan output matters more than the .tf diff</li><li>Terraform Cloud removes a lot of hidden risks</li><li>Infrastructure changes carry more risk than I initially thought</li></ul><h3>Final Thought</h3><p>This is the first time my Terraform setup has actually felt <strong>production-ready</strong>.</p><p>Not because of new tools—but because of the workflow behind how I use them.</p><p>And looking back at how I started:</p><pre>terraform apply → check console → hope</pre><p>Yeah… I wouldn’t rely on that entirely anymore.</p><p>If you’re still relying on casual terraform apply workflows for your projects, I think it&#39;s time to switch it up. I suggest implementing the complete seven steps in your next change. The difference is night and day.</p><p>What’s one workflow habit that transformed how you use Terraform (or any IaC tool)? Share in the comments.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f2f49af0837" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Convince Your Team to Adopt Infrastructure as Code]]></title>
            <link>https://medium.com/@aezottor/how-to-convince-your-team-to-adopt-infrastructure-as-code-aa643879ba2b?source=rss-99e9d8049518------2</link>
            <guid isPermaLink="false">https://medium.com/p/aa643879ba2b</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <category><![CDATA[automation]]></category>
            <dc:creator><![CDATA[Anthony Elorm Zottor]]></dc:creator>
            <pubDate>Sat, 04 Apr 2026 19:58:41 GMT</pubDate>
            <atom:updated>2026-04-05T12:00:30.267Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IY6myuucSswNCVY3-U57Xg.png" /></figure><p>After 18 days of writing Terraform, I can tell you something honestly:</p><p><strong>The technical part is not the hard part.</strong></p><p>You learn the syntax.<br>You understand state.<br>You build modules.<br>You write tests.</p><p>Eventually… it clicks.</p><p>But then you hit the real challenge:</p><ul><li>Convincing your team it’s worth it</li><li>Getting buy-in from people who’ve used the AWS console for years</li><li>Migrating infrastructure that was never designed to be managed as code</li></ul><p>That’s where Infrastructure as Code (IaC) actually <strong>lives or dies</strong>.</p><h3>Before Building the Adoption Plan</h3><p>Before jumping into solutions, I did an honest audit of where I actually am as a solo engineer in this challenge.</p><p>Right now, I’m in a <strong>hybrid state</strong>.</p><p>Some infrastructure is already managed with Terraform — for example, I’ve set up remote state in S3 and started building reusable modules. But not everything is fully codified yet. There are still parts of the setup that rely on manual steps or prior console-based decisions.</p><p>If something new needs to exist, I <em>can</em> define it in Terraform — but the discipline to make that the <strong>only way</strong> isn’t fully established yet.</p><p>Since I’m working alone, there’s no formal approval workflow. Changes happen directly, which makes things fast — but also means there’s no review layer to catch mistakes or enforce consistency.</p><p>Incidents haven’t really been an issue yet—but that’s not because the process is solid. It’s because the scale is still small. As complexity increases, the risk of misconfiguration or missed details will grow with it.</p><p>There’s also a clear drift:</p><ul><li>Some infrastructure exists in Terraform, but not everything</li><li>Parts of the environment were created before IaC was introduced</li><li>Rebuilding everything from scratch would still require memory and manual verification</li></ul><p>Secrets management is partially handled but not standardized. Some values are passed via environment variables or local configuration, but there’s no enforced pattern across everything yet.</p><p>On the positive side, this is the <strong>best possible moment to fix it</strong>.</p><p>Working solo means there’s zero resistance to change. I can enforce good practices early—remote state, version control, testing, and eventually CI/CD—without needing to undo years of bad habits.</p><p>The real challenge isn’t learning Terraform.</p><p>It’s building the discipline to treat infrastructure like code <strong>every single time</strong>, before shortcuts become the default.</p><h3>Where Most Teams Actually Start</h3><p>Most people provision infrastructure by logging into AWS… and clicking.</p><ul><li>No review process</li><li>No documentation</li><li>No clear ownership</li></ul><p>If you ask:</p><blockquote><em>“Who created this resource and why?”</em></blockquote><p>The answer is usually:</p><ul><li>“I think I did…”</li><li>or “Let me check…”</li></ul><p>And honestly—this works.</p><p><strong>Until it doesn’t.</strong></p><ul><li>An incident happens</li><li>Someone leaves with critical knowledge</li><li>A new team member tries to recreate an environment and gets stuck</li></ul><p>That’s when the cracks show.</p><p><strong>But here’s the truth:</strong></p><blockquote><em>The best time to adopt IaC is </em>before<em> the pain becomes obvious.</em></blockquote><h3>Why Most IaC Adoptions Fail</h3><p>The biggest mistake teams make?</p><blockquote><em>Trying to migrate everything at once.</em></blockquote><p>They look at:</p><ul><li>Dozens of resources</li><li>Multiple environments</li><li>Years of manual setup</li></ul><p>… and decide:</p><blockquote><em>“Let’s move everything to Terraform in one go.”</em></blockquote><p>What happens next:</p><ul><li>High risk</li><li>Slow progress</li><li>No visible wins</li><li>Something breaks</li></ul><p>And then…</p><p>They go back to the console.</p><h3>The Strategy That Actually Works</h3><p>Instead of a big-bang migration, the winning approach is <strong>incremental adoption</strong>.</p><p>Each phase is small.<br>Each phase produces value.<br>Each phase builds trust.</p><h3>The 4 Phases of IaC Adoption</h3><p><strong>Phase 1—Start with something new</strong><br>Win: Zero risk, visible success</p><p><strong>Phase 2 — Import existing infrastructure</strong><br>Win: Auditability and control</p><p><strong>Phase 3 — Establish team practices</strong><br>Win: No more drift</p><p><strong>Phase 4—Automate deployments</strong><br>Win: Full CI/CD integration</p><p>Each phase takes ~2–4 weeks<br>Each phase builds confidence</p><h3>Phase 1 — Start With Something New</h3><p>This is where most people go wrong.</p><p>They try to migrate the existing infrastructure immediately.</p><p><strong>Don’t do that.</strong></p><p>Instead:</p><blockquote><em>Pick one new resource your team already needs.</em></blockquote><p>Examples:</p><ul><li>S3 bucket for logs</li><li>Monitoring dashboard</li><li>IAM role</li></ul><h3>Goal</h3><p>Not migration — <strong>confidence</strong></p><h3>Deliverables</h3><ul><li>Terraform config in version control</li><li>Remote state configured</li><li>Team reviews the PR</li><li>Someone else runs terraform plan and understands it</li></ul><p>And most importantly:</p><blockquote><strong><em>No one uses the console to create it</em></strong></blockquote><p>That habit starts here.</p><h3>Phase 2 — Import Existing Infrastructure</h3><p>Once the team is comfortable, start bringing existing resources under Terraform.</p><p>But slowly.</p><h3>The Import Workflow</h3><pre># Inspect the resource<br>aws s3api get-bucket-versioning --bucket my-existing-bucket<br><br><br># Import into Terraform<br>terraform import aws_s3_bucket.existing my-existing-bucket<br># Verify<br>terraform plan<br># Expected: No changes</pre><p>I tested this by importing my existing state bucket:</p><pre>Import successful!<br><br>terraform plan<br>No changes. Your infrastructure matches the configuration.</pre><h3>Critical Insight</h3><p>If terraform plan shows changes after import:</p><p>Your config doesn’t match reality<br>Terraform will try to modify the infrastructure</p><p>Fix the config first. Always.</p><h3>What to import first</h3><ul><li>Frequently changed resources</li><li>Resources that caused past issues</li></ul><p>Not everything. Just what matters.</p><h3>Phase 3 — The Rule Nobody Likes</h3><p>This is where IaC adoption succeeds or fails.</p><blockquote><strong><em>Never touch the console for Terraform-managed resources.</em></strong></blockquote><p>Not:</p><ul><li>For quick fixes</li><li>For emergencies</li><li>Because “it’s faster.”</li></ul><p>Because the moment you do:</p><ul><li>State drifts</li><li>Plans become unpredictable</li><li>Trust in Terraform breaks</li></ul><p>And once trust is gone…</p><p>Engineers start bypassing it.</p><h3>The Required Practices</h3><p>To make this work:</p><ul><li>Every change goes through a PR</li><li>terraform plan output is required</li><li>CI runs:</li><li>terraform validate</li><li>terraform fmt</li><li>Modules are versioned</li><li>State locking is enforced</li></ul><p>This is not just tooling.</p><p>It’s a <strong>culture shift</strong></p><h3>Phase 4 — Automate Everything</h3><p>Now you connect Terraform to CI/CD.</p><pre>- name: Terraform Apply<br>  run: terraform apply -auto-approve</pre><p>From this point:</p><ul><li>No one runs terraform apply manually</li><li>Every change is tracked in Git</li><li>Rollbacks = revert a commit</li></ul><p>The AWS console becomes:</p><blockquote><strong><em>Read-only — for observation, not changes</em></strong></blockquote><h3>The Business Case (What Leadership Actually Cares About)</h3><p>Let’s be honest—leadership doesn’t care about Terraform.</p><p>They care about outcomes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Vd92ql3FlLsdAQhhPfdIIg.png" /></figure><h3>For startups, the biggest value is simple:</h3><blockquote><strong><em>Reproducibility</em></strong></blockquote><p>If one person disappears today…</p><p>Can your team rebuild everything?</p><p>With IaC → Yes<br>Without IaC → Probably not</p><h3>The Hardest Part (No One Talks About This)</h3><p>It’s not Terraform.</p><p>It’s discipline.</p><p>The console is:</p><ul><li>Fast</li><li>Familiar</li><li>Always available</li></ul><p>Terraform is:</p><ul><li>Slower (at first)</li><li>Structured</li><li>Requires process</li></ul><p>For a small team, that feels like friction.</p><h3>The Reality</h3><ul><li>Console = short-term speed</li><li>Terraform = long-term safety</li></ul><p>The earlier you build the habit, the easier it is.</p><p>Two people can enforce discipline.</p><p>Ten people with bad habits?</p><p>Much harder.</p><h3>Key Takeaways</h3><ul><li>Start small—don&#39;t migrate everything</li><li>Prove value early with zero-risk wins</li><li>Import infrastructure gradually</li><li>Culture matters more than tools</li><li>Never mix console changes with Terraform</li><li>Automate only after trust is built</li><li>Testing builds confidence faster than documentation</li></ul><h3>Final Thought</h3><blockquote><em>Infrastructure as Code is not a tooling upgrade.<br>It’s a </em><strong><em>behavior change</em></strong><em>.</em></blockquote><p>The teams that succeed aren’t the ones with the best Terraform code.</p><p>They’re the ones who:</p><ul><li>Commit to the process</li><li>Build trust in automation</li><li>And stay disciplined when it’s easier not to</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aa643879ba2b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>