Posts

Showing posts from December, 2025

AWS with Terraform (Day 17)

Image
Blue-Green Deployment on AWS Elastic Beanstalk Using Terraform Seamless Releases. Zero Downtime. Maximum Confidence. Today’s focus was on one of the most essential real-world DevOps deployment strategies: Blue-Green Deployment using AWS Elastic Beanstalk + Terraform . I cloned the repository, applied file permissions, packaged application versions, deployed both blue & green environments, and even executed the final DNS swap. Everything worked smoothly end-to-end. This blog captures the full journey. What is Blue-Green Deployment? Blue-Green deployment maintains two identical environments : Blue → Active production environment Green → Staging/testing environment You deploy updates to Green, validate everything, then swap traffic to Green using DNS/CNAME. Rollback? One click. Swap back. No downtime, no user impact, no surprises. Why Elastic Beanstalk + Terraform? Combining Elastic Beanstalk with Terraform provides: Automation Infrastructure is codified — no ...

AWS with Terraform (Day 16)

Image
Advanced AWS IAM User Management with Terraform (CSV-Driven, MFA Enabled, Policies Added) Today I pushed my IAM automation project further by turning a basic CSV-driven setup into a production-ready IAM onboarding system powered entirely by Terraform. This wasn’t just about creating IAM users — the goal was to build a repeatable, scalable, secure identity-management workflow that any DevOps team can adopt. What I Built Today A complete IAM onboarding automation pipeline , including: Bulk IAM user creation from CSV Extended CSV now includes: first_name , last_name , email , phone , employe_id , department , job_title , location Terraform loads the CSV with csvdecode() Creates a typed list/map for dynamic iteration Automated username generation Normalized, lowercase usernames Combines first name + last name + emp_id Ensures uniqueness & traceability Console access + MFA-first login Users get a login profile password_reset_required = true Enfo...

AWS with Terraform (Day 15)

Image
AWS VPC Peering Using Terraform Today I completed Day 15 of the #30DaysOfAWSTerraform challenge , and this was one of the most meaningful and practical lessons so far: Building a fully functional AWS VPC Peering setup between two regions using Terraform , protected with routing, security rules, and private connectivity across networks. As DevOps engineers, we often need multiple VPCs for environment isolation such as dev, staging, and prod , or multi-region deployments for latency reduction and high availability . VPC Peering helps us enable private communication without exposing traffic to the public internet . What is VPC Peering? VPC Peering allows private, low-latency, encrypted communication between two VPCs using private IP addresses . It’s useful when deploying: Multi-region microservices Shared services like monitoring, logging, authentication Hybrid cloud or cross-VPC database access It’s important because it improves: ✔ Security (no internet traversal, no...

AWS with Terraform (Day 14)

Image
Hosting a Static Website on AWS S3 + CloudFront + Rout53 Using Terraform Today in my “30 Days of AWS & Terraform” learning journey, I explored how to host a production-grade static website using AWS S3 and CloudFront , with the entire setup automated via Terraform . This combination provides high availability, global content delivery, strong security, and low cost — all while remaining fully repeatable through Infrastructure-as-Code. Why CloudFront with S3? A static site hosted directly on S3 works, but it isn’t ideal for real users worldwide. Problems include: High latency for users far from the S3 region Increased cost due to regional data transfer Security risks when buckets are made public CloudFront solves these by caching content in global edge locations, reducing load time and ensuring users never directly access the S3 bucket. Instead, CloudFront communicates with S3 using Origin Access Control (OAC) , keeping the bucket private and secure. High-Level A...

AWS with Terraform (Day 13)

Image
Terraform Data Sources in AWS: Safely Using Existing VPCs, Subnets & AMIs Today’s learning in my “30 Days of AWS & Terraform” series focuses on one of the most powerful concepts that enable real-world infrastructure management— Terraform Data Sources . Many teams struggle with repeatedly hardcoding AMI IDs, VPC IDs, and subnet IDs inside Terraform configuration. These values change frequently and are usually managed externally by platform teams. Hardcoding them introduces fragility, makes templates non-portable, and requires manual changes on every update. Terraform solves this problem through data sources , which allow you to query and reference existing cloud resources safely , instead of defining or recreating them. Why Terraform Data Sources Matter Data sources let you look up resources dynamically from AWS and consume their attributes without manually storing IDs. Key benefits Problem Solution with Data Sources Hardcoded AMI, VPC, or subnet IDs      ...

AWS with Terraform (Day 12)

Image
AWS Terraform Functions - Part 2 (Day 12) This guide continues building practical Terraform skills by exploring a set of commonly used functions: variable validations, type conversions, numeric helpers, timestamp formatting, and file operations. The goal is to show how these functions help enforce inputs, transform data, perform calculations, and read configuration files safely and predictably. Why use Terraform functions? Functions let you validate and manipulate values before they reach resource creation. They reduce human error, make modules more robust, and keep your plans predictable. Instead of handling mistakes after apply, you can catch them early with variable validation and transform inputs into the exact shape needed for further logic. Validation functions: guardrails for variables Place validations inside the variable declaration using the validation block. Each validation requires a boolean condition and an error_message . Common checks include length, pattern match...

AWS with Terraform (Day 11)

Image
Mastering Terraform Functions (Part 1): Transforming Inputs into Production-Ready Values As a DevOps Engineer with 2 years of experience, today I explored one of the most powerful concepts in Terraform — built-in functions . These functions allow us to transform raw input values into clean, validated, production-ready outputs that prevent runtime failures and improve the reusability of Infrastructure as Code. Terraform doesn’t support custom functions (like Python or JavaScript), so everything depends on built-in utility functions that help us manipulate strings, numbers, collections, timestamps, and types . Why Terraform Functions Matter Functions help in: Avoiding invalid resource names and runtime errors Processing inputs to match AWS resource constraints Building complex locals using modular and reusable expressions Quickly testing logic using terraform console terraform console is the fastest way to test functions without writing any resource code. Key Fun...

AWS with Terraform (Day 10)

Image
Conditional Expressions, Dynamic Blocks & Splat Expressions Explained Today’s learning in #30DaysOfAWSTerraform was a complete game-changer in how I think about writing Terraform code. I explored three powerful expression techniques that transform Terraform from repetitive configuration to clean, automated, and scalable Infrastructure-as-Code: 1. Conditional Expressions 2. Dynamic Blocks 3. Splat Expressions These expressions solve real-world DevOps challenges—avoiding repetitive blocks of code, enabling smart decision-making, and extracting values from multiple resources effortlessly. Why Terraform Expressions Matter Many beginners (including me earlier) start by hardcoding values and copy-pasting blocks repeatedly. This quickly creates problems: Manual edits = mistakes Huge files = hard to read & maintain Different environments = inconsistent results Expressions fix all of this by making Terraform: More concise More efficient More reusable More ...