<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Navyashri P G</title>
    <description>The latest articles on DEV Community by Navyashri P G (@navyabhat).</description>
    <link>https://dev.to/navyabhat</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3153023%2F547ddb4d-f122-4d01-9113-7977c23ac8aa.jpg</url>
      <title>DEV Community: Navyashri P G</title>
      <link>https://dev.to/navyabhat</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/navyabhat"/>
    <language>en</language>
    <item>
      <title>From Terraform to Production: Automating AWS Infrastructure with CI/CD Pipelines</title>
      <dc:creator>Navyashri P G</dc:creator>
      <pubDate>Mon, 15 Jun 2026 05:02:18 +0000</pubDate>
      <link>https://dev.to/navyabhat/from-terraform-to-production-automating-aws-infrastructure-with-cicd-pipelines-p57</link>
      <guid>https://dev.to/navyabhat/from-terraform-to-production-automating-aws-infrastructure-with-cicd-pipelines-p57</guid>
      <description>&lt;h2&gt;
  
  
  Introduction****
&lt;/h2&gt;

&lt;p&gt;Infrastructure as Code (IaC) has transformed how we build and manage cloud infrastructure. Tools like Terraform allow us to define infrastructure in code, but in real-world DevOps environments, writing code is only the beginning.&lt;br&gt;
The real power comes when we automate infrastructure deployment using CI/CD pipelines.&lt;/p&gt;

&lt;p&gt;In this blog, we will take Terraform beyond local execution and build a fully automated AWS infrastructure deployment pipeline.&lt;/p&gt;

&lt;p&gt;Why CI/CD for Terraform?&lt;/p&gt;

&lt;p&gt;Running Terraform manually is fine for learning, but in production environments it creates challenges:&lt;/p&gt;

&lt;p&gt;Manual execution increases human errors&lt;br&gt;
No proper review or approval process&lt;br&gt;
No consistency across environments&lt;br&gt;
Difficult to track changes&lt;/p&gt;

&lt;h2&gt;
  
  
  CI/CD pipelines solve these problems by introducing:
&lt;/h2&gt;

&lt;p&gt;Automated validation and testing&lt;br&gt;
Controlled deployment workflow&lt;br&gt;
Approval mechanisms&lt;br&gt;
Version-controlled infrastructure deployment&lt;/p&gt;

&lt;h2&gt;
  
  
  Project Goal
&lt;/h2&gt;

&lt;p&gt;We will build a simple DevOps workflow where:&lt;/p&gt;

&lt;p&gt;Infrastructure code is stored in GitHub&lt;br&gt;
Every code push triggers a CI/CD pipeline&lt;br&gt;
Terraform automatically validates and plans infrastructure&lt;br&gt;
AWS resources are deployed after approval&lt;/p&gt;

&lt;h2&gt;
  
  
  Architecture Overview
&lt;/h2&gt;

&lt;p&gt;Developer&lt;br&gt;
   |&lt;br&gt;
   v&lt;br&gt;
GitHub Repository&lt;br&gt;
   |&lt;br&gt;
   v&lt;br&gt;
CI/CD Pipeline (Jenkins / GitHub Actions)&lt;br&gt;
   |&lt;br&gt;
   +--&amp;gt; terraform fmt&lt;br&gt;
   +--&amp;gt; terraform validate&lt;br&gt;
   +--&amp;gt; terraform plan&lt;br&gt;
   +--&amp;gt; manual approval (optional)&lt;br&gt;
   +--&amp;gt; terraform apply&lt;br&gt;
   |&lt;br&gt;
   v&lt;br&gt;
AWS Cloud Infrastructure (EC2 / VPC / S3)&lt;/p&gt;

&lt;h2&gt;
  
  
  Tools Used
&lt;/h2&gt;

&lt;p&gt;Terraform (Infrastructure as Code)&lt;br&gt;
AWS (Cloud Platform)&lt;br&gt;
Jenkins / GitHub Actions (CI/CD Pipeline)&lt;br&gt;
Git &amp;amp; GitHub (Version Control)&lt;br&gt;
Linux (Execution Environment)&lt;/p&gt;




&lt;p&gt;Step 1: Terraform Project Structure&lt;/p&gt;

&lt;p&gt;A clean project structure improves readability and scalability:&lt;/p&gt;

&lt;p&gt;terraform-project/&lt;br&gt;
│&lt;br&gt;
├── provider.tf&lt;br&gt;
├── main.tf&lt;br&gt;
├── variables.tf&lt;br&gt;
├── outputs.tf&lt;br&gt;
└── backend.tf&lt;/p&gt;

&lt;p&gt;Step 2: Writing Terraform Configuration&lt;br&gt;
Let’s create a simple EC2 instance using Terraform.&lt;/p&gt;

&lt;p&gt;&amp;lt;/&amp;gt; hcl &lt;/p&gt;

&lt;p&gt;provider "aws" {&lt;br&gt;
  region = "ap-south-1"&lt;br&gt;
}&lt;br&gt;
resource "aws_instance" "dev_server" {&lt;br&gt;
  ami           = "ami-0c55b159cbfafe1f0"&lt;br&gt;
  instance_type = "t2.micro"&lt;br&gt;
  tags = {&lt;br&gt;
    Name = "DevOps-Server"&lt;br&gt;
  }&lt;br&gt;
}&lt;br&gt;
Step 3: Remote State Management (Best Practice)&lt;br&gt;
Instead of storing state locally, we use remote backend storage.&lt;/p&gt;

&lt;p&gt;terraform {&lt;br&gt;
  backend "s3" {&lt;br&gt;
    bucket = "my-terraform-state-bucket"&lt;br&gt;
    key    = "dev/terraform.tfstate"&lt;br&gt;
    region = "ap-south-1"&lt;br&gt;
  }&lt;br&gt;
}&lt;br&gt;
Why remote state?&lt;br&gt;
Prevents state loss&lt;br&gt;
Enables team collaboration&lt;br&gt;
Provides locking mechanism&lt;br&gt;
Ensures consistency across environments&lt;br&gt;
Step 4: CI/CD Pipeline (Jenkins Example)&lt;br&gt;
We now automate Terraform using a Jenkins pipeline.&lt;/p&gt;

&lt;p&gt;&amp;lt;/&amp;gt; groovy &lt;/p&gt;

&lt;p&gt;pipeline {&lt;br&gt;
    agent any&lt;br&gt;
    stages {&lt;br&gt;
        stage('Checkout') {&lt;br&gt;
            steps {&lt;br&gt;
                git branch: 'main', url: '&lt;a href="https://github.com/your-repo.git" rel="noopener noreferrer"&gt;https://github.com/your-repo.git&lt;/a&gt;'&lt;br&gt;
            }&lt;br&gt;
        }&lt;br&gt;
        stage('Terraform Init') {&lt;br&gt;
            steps {&lt;br&gt;
                sh 'terraform init'&lt;br&gt;
            }&lt;br&gt;
        }&lt;br&gt;
        stage('Terraform Format') {&lt;br&gt;
            steps {&lt;br&gt;
                sh 'terraform fmt'&lt;br&gt;
            }&lt;br&gt;
        }&lt;br&gt;
        stage('Terraform Validate') {&lt;br&gt;
 steps {&lt;br&gt;
                sh 'terraform validate'&lt;br&gt;
            }&lt;br&gt;
        }&lt;br&gt;
        stage('Terraform Plan') {&lt;br&gt;
            steps {&lt;br&gt;
                sh 'terraform plan'&lt;br&gt;
            }&lt;br&gt;
        }&lt;br&gt;
        stage('Approval') {&lt;br&gt;
            steps {&lt;br&gt;
                input message: 'Approve Terraform Apply?'&lt;br&gt;
            }&lt;br&gt;
        }&lt;br&gt;
        stage('Terraform Apply') {&lt;br&gt;
            steps {&lt;br&gt;
                sh 'terraform apply -auto-approve'&lt;br&gt;
            }&lt;br&gt;
        }&lt;br&gt;
    }&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;Step 5: AWS Authentication in Pipeline&lt;br&gt;
To allow Jenkins to deploy to AWS:&lt;/p&gt;

&lt;p&gt;Configure AWS credentials securely in Jenkins&lt;br&gt;
Or use IAM roles (recommended for production environments)&lt;/p&gt;

&lt;p&gt;⚠️ Never hardcode AWS credentials in code.&lt;/p&gt;

&lt;p&gt;Step 6: End-to-End Workflow&lt;/p&gt;

&lt;p&gt;Here’s what happens in a real DevOps pipeline:&lt;/p&gt;

&lt;p&gt;Developer pushes Terraform code to GitHub&lt;br&gt;
Jenkins detects the change&lt;br&gt;
CI/CD pipeline starts execution&lt;br&gt;
Terraform initializes infrastructure&lt;br&gt;
Code is validated&lt;br&gt;
Execution plan is generated&lt;br&gt;
Manual approval is requested&lt;br&gt;
Infrastructure is deployed to AWS&lt;br&gt;
Key DevOps Concepts Covered&lt;br&gt;
This project demonstrates:&lt;/p&gt;

&lt;p&gt;Infrastructure as Code (Terraform)&lt;br&gt;
Continuous Integration / Continuous Deployment&lt;br&gt;
Automated cloud provisioning&lt;br&gt;
Version-controlled infrastructure&lt;br&gt;
Approval-based deployment workflow&lt;br&gt;
Common Issues and Fixes&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Terraform State Conflicts&lt;br&gt;
✔ Fix: Use S3 backend with state locking (DynamoDB)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;AWS Permission Issues&lt;br&gt;
✔ Fix: Proper IAM roles and policies&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Pipeline Failures&lt;br&gt;
✔ Fix: Always test Terraform locally before CI/CD&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Why This Matters in Real DevOps&lt;br&gt;
In modern DevOps environments:&lt;/p&gt;

&lt;p&gt;Infrastructure is never deployed manually&lt;br&gt;
Every change goes through pipelines&lt;br&gt;
Everything is traceable and auditable&lt;br&gt;
Automation reduces human error&lt;br&gt;
This workflow is exactly how production systems are managed.&lt;/p&gt;

&lt;p&gt;Conclusion&lt;br&gt;
This project demonstrates how Terraform evolves from a simple infrastructure tool into a production-grade automation system when combined with CI/CD pipelines.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>cicd</category>
      <category>devops</category>
      <category>terraform</category>
    </item>
    <item>
      <title>Terraform in Real Life — Building Your First Cloud Infrastructure Step by Step</title>
      <dc:creator>Navyashri P G</dc:creator>
      <pubDate>Sat, 06 Jun 2026 09:54:07 +0000</pubDate>
      <link>https://dev.to/navyabhat/terraform-in-real-life-building-your-first-cloud-infrastructure-step-by-step-5bjp</link>
      <guid>https://dev.to/navyabhat/terraform-in-real-life-building-your-first-cloud-infrastructure-step-by-step-5bjp</guid>
      <description>&lt;p&gt;&lt;strong&gt;### Introduction&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If Infrastructure as Code (IaC) is the concept of managing infrastructure using code, then Terraform is one of the most powerful tools that brings it to life in the real world.&lt;/p&gt;

&lt;p&gt;Instead of clicking through cloud dashboards, Terraform lets you write what you want once and it builds everything for you automatically.&lt;/p&gt;

&lt;p&gt;🧠 What is Terraform?&lt;br&gt;
Terraform is an open-source IaC tool created by HashiCorp that allows you to:&lt;/p&gt;

&lt;p&gt;Define infrastructure using code&lt;br&gt;
Create cloud resources automatically&lt;br&gt;
Manage AWS, Azure, GCP, and more&lt;br&gt;
Track changes safely over time&lt;/p&gt;

&lt;p&gt;👉 In simple words:&lt;br&gt;
“You describe your infrastructure, Terraform builds it.”&lt;/p&gt;

&lt;p&gt;🏗️ Real-Life Analogy&lt;br&gt;
Think of it like ordering food in a restaurant:&lt;br&gt;
You don’t go to the kitchen and cook yourself&lt;br&gt;
You just place an order (your code)&lt;br&gt;
The kitchen (Terraform) prepares everything&lt;br&gt;
You receive your final dish (working infrastructure)&lt;/p&gt;

&lt;p&gt;☁️ Real Example: AWS EC2 with Terraform&lt;br&gt;
Let’s say you want a virtual machine in AWS.&lt;/p&gt;

&lt;h2&gt;
  
  
  📝 Step 1: Provider setup
&lt;/h2&gt;

&lt;p&gt;provider "aws" {&lt;br&gt;
  region = "us-east-1"&lt;br&gt;
}&lt;br&gt;
👉 This tells Terraform:&lt;/p&gt;

&lt;p&gt;“We are working with AWS in this region.”&lt;/p&gt;

&lt;p&gt;🖥️ Step 2: Create EC2 instance&lt;/p&gt;

&lt;p&gt;resource "aws_instance" "my_server" {&lt;br&gt;
  ami           = "ami-12345678"&lt;br&gt;
  instance_type = "t2.micro"&lt;/p&gt;

&lt;p&gt;tags = {&lt;br&gt;
    Name = "MyFirstServer"&lt;br&gt;
  }&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;👉 This tells Terraform:&lt;/p&gt;

&lt;p&gt;“Create a virtual machine for me.”&lt;/p&gt;

&lt;p&gt;⚙️ Step 3: Initialize Terraform&lt;/p&gt;

&lt;p&gt;terraform init&lt;/p&gt;

&lt;p&gt;This downloads required plugins.&lt;/p&gt;

&lt;p&gt;🚀 Step 4: Apply infrastructure&lt;/p&gt;

&lt;p&gt;terraform apply&lt;br&gt;
Terraform will:&lt;/p&gt;

&lt;p&gt;Show what will be created&lt;/p&gt;

&lt;p&gt;Ask for confirmation&lt;/p&gt;

&lt;p&gt;Build your infrastructure in AWS&lt;/p&gt;

&lt;p&gt;🔁 Why Terraform is Powerful in Real Life&lt;/p&gt;

&lt;p&gt;✅ 1. Repeatable Infrastructure&lt;br&gt;
You can rebuild the same setup anytime.&lt;/p&gt;

&lt;p&gt;✅ 2. No Manual Errors&lt;br&gt;
No clicking through AWS console mistakes.&lt;/p&gt;

&lt;p&gt;✅ 3. Version Control&lt;br&gt;
Your infrastructure behaves like code (Git-friendly).&lt;/p&gt;

&lt;p&gt;✅ 4. Scalable&lt;br&gt;
From 1 server → 100 servers easily.&lt;/p&gt;

&lt;p&gt;🏢 Real Industry Use Cases&lt;br&gt;
Terraform is used in companies for:&lt;/p&gt;

&lt;p&gt;Setting up cloud servers&lt;/p&gt;

&lt;p&gt;Creating Kubernetes clusters&lt;/p&gt;

&lt;p&gt;Managing databases&lt;/p&gt;

&lt;p&gt;Automating networking (VPCs, subnets)&lt;/p&gt;

&lt;p&gt;💡 Simple Summary&lt;br&gt;
Terraform is like a remote control for your entire cloud infrastructure.&lt;/p&gt;

&lt;p&gt;Instead of managing things manually, you just define them once and let automation do the work&lt;/p&gt;

</description>
      <category>terraform</category>
      <category>devops</category>
      <category>aws</category>
      <category>infrastructureascode</category>
    </item>
  </channel>
</rss>
