🚀 New Project: Multi-Environment Terraform Deployment with GitLab CI/CD One thing every DevOps engineer encounters early on: how do you manage dev, staging, and prod infrastructure without duplicating code or risking state conflicts? Here's what I built to solve exactly that What the project does: A fully automated IaC pipeline that provisions isolated AWS environments (develop + prod) from a single Terraform codebase, triggered automatically by GitLab CI/CD on every push. How it works: → Push to develop → pipeline runs → staging EC2 deployed (manual approval required) → Merge to main → pipeline runs → prod EC2 deployed (automatic) → Each environment gets its own isolated Terraform state in S3 → State locking prevents concurrent pipeline runs from corrupting infrastructure Stack: • Terraform Workspaces: one codebase, multiple isolated environments • AWS S3: remote backend for shared, versioned state storage • GitLab CI/CD: 3-stage pipeline: validate → plan → apply • AWS EC2 + Security Groups: environment-tagged resources • IAM: least-privilege service account for the pipeline Key lessons learned: • TF_WORKSPACE is a reserved Terraform variable, naming your CI variable the same breaks workspace selection silently (fun one to debug 🙃) • GitLab Protected variables are only injected into protected branches, unprotect them if your pipeline runs on feature/develop branches • Terraform 1.10+ native S3 locking (use_lockfile) replaces the DynamoDB dependency, simpler and cleaner • Manual approval gates in CI aren't just a safety net, they're standard practice in real teams Why this matters for interviews: Remote state, workspace isolation, and branch-based deployment strategies are questions I now get asked about, and can answer from real hands-on experience, not just theory. Full project with README guide on GitHub: https://lnkd.in/dgNT_NTe #DevOps #Terraform #GitLabCI #AWS #InfrastructureAsCode #CloudEngineering #IaC #Berlin #OpenToWork
Arash Mohammadi’s Post
More Relevant Posts
-
🚀 Built a Production-Ready Terraform Project on AWS (Real DevOps Implementation) As part of strengthening my DevOps expertise, I designed and deployed a modular Terraform project to provision AWS infrastructure — following real-world practices used in organizations. Instead of writing everything in a single file, I implemented a scalable and reusable architecture using Terraform modules 👇 🏗️ What I built: ✔️ VPC with public subnet ✔️ Internet Gateway & Route Table configuration ✔️ Security Group (SSH & HTTP access) ✔️ EC2 instance deployment 📁 Project Approach (Industry-Level): 🔹 Separate modules for VPC and EC2 🔹 Environment-based structure (dev) 🔹 Clean and maintainable code design 💡 Real Challenges I Solved (Hands-on Debugging): 🔸 Fixed invalid AMI issue (region-specific problem) 🔸 Resolved instance type restriction (Free Tier eligibility) 🔸 Handled Git large file error by cleaning .terraform and using .gitignore 👉 These are the exact issues you face in real production environments. 📌 Key Learnings: ✔ Modular Terraform = scalable infrastructure ✔ Proper Git practices are critical in DevOps ✔ Debugging skills matter more than just writing code 🔗 GitHub Project Link: https://lnkd.in/d4JKWgGE #DevOps #Terraform #AWS #InfrastructureAsCode #CloudEngineering #SRE #GitHub #LearningInPublic
To view or add a comment, sign in
-
-
Terraform + Ansible in DevOps (Who Does What?) People confuse these two all the time. They’re not competitors. They’re teammates. 👉 Terraform = Infrastructure Builder 👉 Ansible = Configuration Manager Together? That’s where things start looking like real DevOps. 🔹 🧱 Step 1: Terraform (Create Infrastructure) 📌 What it does: Creates cloud resources like servers, networks, load balancers 📌 Real Example: 👉 You want to deploy a web app on AWS Terraform creates EC2 instance Sets up VPC, subnet, security groups 💡 Think: “Build the house” 🔹 ⚙️ Step 2: Ansible (Configure the Server) 📌 What it does: Installs software and configures the system 📌 Real Example: 👉 After EC2 is created Install Nginx Deploy your app Start services 💡 Think: “Furnish and set up the house” 🔹 🔗 Step 3: Integration (How They Work Together) 📌 Flow: Terraform creates infra Outputs IP addresses Ansible uses those IPs as inventory Configures everything automatically 📌 Real Example: 👉 You deploy a startup app Terraform → creates 3 servers Ansible → installs app + DB + configs 💡 No manual SSH. No chaos. No “it works on my machine.” 🔹 📦 Real DevOps Pipeline Flow 👉 Code pushed to Git ➡️ CI/CD pipeline runs ➡️ Terraform → Infra ready ➡️ Ansible → App deployed ➡️ App live 🚀 🔹 🔥 Why Use Both? ✔ Clear separation of responsibilities ✔ Scalable and repeatable ✔ Faster deployments ✔ Less human error 🔹 🧠 Reality Check Using only Terraform: 👉 Infra ready, but empty server 😐 Using only Ansible: 👉 Config ready, but where’s the server? 🤡 Using both: 👉 Full automation like a civilized engineer 🎯 Takeaway Terraform and Ansible together = 👉 Provision + Configure = Complete Deployment If you’re serious about DevOps, you don’t pick one. You combine them intelligently. #DevOps 🚀 #Terraform 🌍 #Ansible ⚙️ #InfrastructureAsCode #ConfigurationManagement #CloudComputing ☁️ #AWS #Azure #GCP #Automation 🔁 #CI_CD #Docker 🐳 #Kubernetes ☸️ #SystemDesign 🧠 #Scalability 📈 #PlatformEngineering
To view or add a comment, sign in
-
-
🚨 I thought Terraform dependencies were “automatic”… until this happened. I was building a simple setup: 👉 Resource Group 👉 Storage Account Sounds basic, right? So I wrote my Terraform code, ran terraform apply… and boom 💥 Unexpected errors. That’s when I discovered something that every DevOps engineer must understand 👇 🧠 𝗧𝗵𝗲 𝗠𝗼𝗺𝗲𝗻𝘁 𝗼𝗳 𝗥𝗲𝗮𝗹𝗶𝘇𝗮𝘁𝗶𝗼𝗻 While creating resources, I came across 2 methods: 1️⃣ 𝗜𝗺𝗽𝗹𝗶𝗰𝗶𝘁 𝗗𝗲𝗽𝗲𝗻𝗱𝗲𝗻𝗰𝘆 2️⃣ 𝗘𝘅𝗽𝗹𝗶𝗰𝗶𝘁 𝗗𝗲𝗽𝗲𝗻𝗱𝗲𝗻𝗰𝘆 At first, I ignored it… But Terraform had other plans 😅 🔹 𝗪𝗵𝗮𝘁 𝗶𝘀 𝗜𝗺𝗽𝗹𝗶𝗰𝗶𝘁 𝗗𝗲𝗽𝗲𝗻𝗱𝗲𝗻𝗰𝘆? This is Terraform being smart. If one resource 𝗿𝗲𝗳𝗲𝗿𝗲𝗻𝗰𝗲𝘀 𝗮𝗻𝗼𝘁𝗵𝗲𝗿 𝗿𝗲𝘀𝗼𝘂𝗿𝗰𝗲’𝘀 𝗮𝘁𝘁𝗿𝗶𝗯𝘂𝘁𝗲, Terraform automatically understands the dependency. 👉 Example: If your storage account uses the resource group name like this: resource_group_name = https://lnkd.in/gXffzhNe Terraform says: “Got it 👍 Storage Account depends on Resource Group” ✅ No need to tell explicitly ✅ Clean & preferred approach 🔹 𝗪𝗵𝗮𝘁 𝗶𝘀 𝗘𝘅𝗽𝗹𝗶𝗰𝗶𝘁 𝗗𝗲𝗽𝗲𝗻𝗱𝗲𝗻𝗰𝘆? This is YOU telling Terraform: “Bhai, pehle ye bana… phir wo banana!” 😄 👉 Example: depends_on = [azurerm_resource_group.rg] Here, even if there is 𝗻𝗼 𝗱𝗶𝗿𝗲𝗰𝘁 𝗿𝗲𝗳𝗲𝗿𝗲𝗻𝗰𝗲, you are forcing Terraform to follow an order. ✅ Useful when dependency is not obvious ❌ Overuse makes code messy ⚔️ 𝗜𝗺𝗽𝗹𝗶𝗰𝗶𝘁 𝘃𝘀 𝗘𝘅𝗽𝗹𝗶𝗰𝗶𝘁 (𝗥𝗲𝗮𝗹 𝗗𝗶𝗳𝗳𝗲𝗿𝗲𝗻𝗰𝗲) 🔸 𝗜𝗺𝗽𝗹𝗶𝗰𝗶𝘁 𝗗𝗲𝗽𝗲𝗻𝗱𝗲𝗻𝗰𝘆 Automatic 🔁 Based on reference 📌 Cleaner & recommended ✅ 🔸 𝗘𝘅𝗽𝗹𝗶𝗰𝗶𝘁 𝗗𝗲𝗽𝗲𝗻𝗱𝗲𝗻𝗰𝘆 Manual control 🎮 Uses depends_on ⚙️ Use only when needed ⚠️ #terraform #cloud DevOps Insiders #devops #infra
To view or add a comment, sign in
-
-
I'm excited to share one of my recent cloud engineering projects: CloudTask Pro — a production-grade task management platform deployed on AWS. The goal of this project was not only to build a web application, but to design and deploy it using a realistic production-style cloud architecture and DevOps workflow. 𝗞𝗲𝘆 𝗵𝗶𝗴𝗵𝗹𝗶𝗴𝗵𝘁𝘀 𝗼𝗳 𝘁𝗵𝗲 𝗽𝗿𝗼𝗷𝗲𝗰𝘁: • Infrastructure as Code using Terraform modules • CI/CD pipeline with Jenkins and GitHub webhooks • Dockerized backend deployment with Docker Hub • Frontend hosting using Amazon S3 and CloudFront • Backend deployment on EC2 Auto Scaling Group behind an Application Load Balancer • PostgreSQL database hosted on Amazon RDS • Secrets management with AWS Secrets Manager • Monitoring and logging using CloudWatch • Public/private subnet separation inside a custom VPC • Internal deployment automation using AWS Systems Manager (SSM) 𝗔𝗿𝗰𝗵𝗶𝘁𝗲𝗰𝘁𝘂𝗿𝗲 𝗰𝗼𝗺𝗽𝗼𝗻𝗲𝗻𝘁𝘀 𝘂𝘀𝗲𝗱: • VPC, public/private subnets, route tables, NAT Gateway • EC2, Auto Scaling Group, Launch Template • Application Load Balancer • Amazon RDS PostgreSQL • Amazon S3 and CloudFront • IAM roles and security groups • Jenkins, Docker, GitHub, Terraform 𝗙𝗼𝗿 𝗱𝗲𝘁𝗮𝗶𝗹𝘀, 𝗽𝗹𝗲𝗮𝘀𝗲 𝗰𝗵𝗲𝗰𝗸 𝗼𝘂𝘁 𝘁𝗵𝗲 𝗚𝗶𝘁𝗛𝘂𝗯 𝗿𝗲𝗽𝗼𝘀𝗶𝘁𝗼𝗿𝘆: https://lnkd.in/d6fiEi3m #AWS #DevOps #Terraform #Jenkins #Docker #CICD #CloudEngineer #AWSSolutionsArchitect #InfrastructureAsCode
To view or add a comment, sign in
-
🚀 End-to-End DevOps CI/CD Pipeline Implementation on AWS I recently completed a hands-on project focused on building and automating the deployment of a containerized application using AWS and modern CI/CD practices. https://lnkd.in/edPryFaF 🔹 Project Overview Designed and implemented a complete CI/CD pipeline to automate application build, containerization, infrastructure provisioning, and deployment on AWS. 🔹 Key Responsibilities & Implementation • Containerized application using Docker for consistent and portable deployment • Configured GitHub Actions to automate: * Docker image build process * Secure push of images to AWS Elastic Container Registry (ECR) • Provisioned cloud infrastructure using Terraform (Infrastructure as Code): * Created custom VPC with networking components * Configured Security Groups for controlled access * Deployed EC2 instance for application hosting • Automated deployment workflow: * Pulled latest Docker image from ECR to EC2 * Deployed and managed container lifecycle on EC2 🔹 Technology Stack Docker | GitHub Actions | AWS (ECR, EC2, VPC) | Terraform | Linux 🔹 Key Outcomes ✔ Built a fully automated CI/CD pipeline from code commit to deployment ✔ Gained practical experience with Infrastructure as Code (IaC) ✔ Strengthened understanding of cloud-based container deployment #CloudEngineering#AWS #Terraform #Docker #GitHubActions #DevOps #CI_CD #InfrastructureAsCode #NewZealandJobs
To view or add a comment, sign in
-
-
Terraform Intro — Infrastructure as Code (IaC) made simple (How DevOps engineers create infrastructure like code) After working with AWS, one problem becomes clear: “Creating infrastructure manually is slow, error-prone, and not scalable.” That’s where Terraform comes in. ↘️ What is Terraform? Terraform is a tool that lets us: 👉 Create, update, and manage infrastructure using code Instead of clicking in AWS console, we write code like: <Hcl> resource "aws_instance" "app" { ami = "ami-123456" instance_type = "t2.micro" } Run: terraform apply 👉 our server is created automatically. ↘️ Simple understanding Terraform = “Code to create servers, networks, and cloud resources” ↘️ Why DevOps engineers use Terraform ✓ No manual setup ✓ Same environment every time ✓ Easy to scale infrastructure ✓ Version control (Git) ✓ Reusable configurations ↘️ Real DevOps use cases Create EC2 instances Setup VPC, subnets, security groups Provision S3 buckets Deploy full cloud architecture ↘️ How Terraform works (basic flow) Write code → terraform plan → terraform apply → Infrastructure created ↘️ Key concepts Providers → AWS, Azure, GCP Resources → EC2, S3, VPC State file → Tracks infrastructure Modules → Reusable code blocks ↘️ Real-world thinking Before Terraform: 👉 Manual setup → errors → inconsistency With Terraform: 👉 Automated → repeatable → reliable ↘️ Interview Tip If asked: “What is Infrastructure as Code?” Answer: “It is the practice of managing infrastructure using code instead of manual processes, and Terraform is one of the most popular tools for this.” Infrastructure is no longer manual — it’s programmable. #Terraform #DevOps #InfrastructureAsCode #AWS
To view or add a comment, sign in
-
-
🔧 Lab Title: 5 - Create EKS cluster with eksctl command line tool🚀 Project Steps PDF Your Easy-to-Follow Guide:https://lnkd.in/gNwMSi2y 🔗 GitLab Repo Code:https://lnkd.in/gG3uJBvK 🔗 DevsecOps Portfolio:https://lnkd.in/g6AP-FNQ 💼 DevOps Portfolio: https://lnkd.in/gT-YQE5U 🔗 Kubernetes Portfolio:https://lnkd.in/gUqZrdYh 🔗 GitLab CI/CD Portfolio:https://lnkd.in/g2jhKsts Summary: Today, I worked on setting up an Amazon EKS cluster using the eksctl CLI. I automated Kubernetes cluster provisioning, managed node groups, and integrated AWS services like EC2, VPC, and IAM. This lab strengthened my skills in deploying scalable Kubernetes environments and troubleshooting cross-platform CLI issues. Tools Used: eksctl ⚙️: Automated EKS cluster and resource provisioning AWS CLI 🖥️: Configured AWS credentials and region for deployment CloudFormation 📜: Managed infrastructure as code behind the scenes Skills Gained: Automation & Provisioning 🤖: Streamlined Kubernetes cluster creation AWS Integration ☁️: Connected EC2, VPC, IAM with Kubernetes CLI Mastery 💻: Improved command-line management of cloud infra Challenges Faced: Cross-Platform Commands ❌: Resolved Linux commands failing on Windows PowerShell Resource Validation ✔️: Verified AWS resources to ensure cluster readiness Why It Matters: This lab builds essential DevOps skills in automating Kubernetes on AWS, enabling fast, reliable, and scalable cloud deployments. Mastering eksctl and AWS CLI boosts efficiency in managing production-grade clusters. 🚀 📌 hashtag#DevOps hashtag#eksctl hashtag#AmazonEKS hashtag#AWS hashtag#Kubernetes hashtag#CloudAutomation hashtag#InfraAsCode 🚀 Stay tuned! The next project 6 - Deploy to EKS Cluster from Jenkins Pipeline is coming soon. 🔥
To view or add a comment, sign in
-
-
🚀 CI/CD Pipeline for Automated Portfolio Deployment (GitHub Actions + AWS S3) I built and implemented a CI/CD pipeline to automate the deployment of my personal portfolio website. With every push to my GitHub repository, a GitHub Actions workflow automatically builds and deploys the latest changes to an AWS S3 bucket hosting my static website. ⚙️ Tech Stack: GitHub Actions | AWS S3 | IAM Roles | GitHub Secrets | HTML/CSS/JavaScript 📌 What I Demonstrated: • CI/CD pipeline automation using GitHub Actions • AWS S3 static website hosting & deployment • Secure credential management using IAM & GitHub Secrets • End-to-end DevOps workflow understanding 🎯 Impact: This project helped me gain hands-on experience in building real-world deployment pipelines and strengthened my understanding of DevOps automation on AWS. I am continuously improving my skills in AWS, DevOps, and Infrastructure Automation. 🔗 Project Repository: https://lnkd.in/gMdFK-mq 👨💻 GitHub Profile: https://lnkd.in/gqG_G7Me ⭐ Feel free to follow my GitHub for more DevOps & cloud projects — more coming soon! #DevOps #AWS #GitHubActions #CICD #CloudComputing #AWSDevOps #Automation
To view or add a comment, sign in
-
-
👨💻 50-day journey to revisit and strengthen my DevOps engineering skills 📌 Day 4/50 📌 ⚙️ Tools I’ll be working with: GitHub Actions | Terraform Continuing my DevOps revision, today I focused on two important areas in real-world DevOps—secure CI/CD practices and a basic understanding of Infrastructure as Code using Terraform. ➡️ In CI/CD pipelines, handling sensitive data like credentials, API keys, and tokens is very important. These should never be written directly in code. Instead, they should be stored securely and used during pipeline execution. Also, separating environments like dev, staging, and production, along with adding approval steps for production, helps avoid mistakes and ensures safe deployments. 🔄 CI/CD Secure Flow : Code Push → Pipeline Triggered → Access Secrets Securely → Select Environment (Dev/Staging/Prod)→ Approval Check→ Deploy → Monitor 🚨 Possible Issue Scenario: Deployment failed due to incorrect secret configuration or wrong environment mapping, leading to authentication errors. 🛠️ Resolution: Checked secret names, fixed the mappings, and ensured proper access for the required environment before re-running the pipeline. ➡️ Terraform (Infrastructure as Code – Basics) : To go further in application deployment, I explored Terraform, which is used to create and manage infrastructure using code. Instead of manually setting up servers or resources, everything can be defined in configuration files and deployed automatically. This makes infrastructure easy to manage, reusable, and consistent across environments. 🔗 For a deeper understanding of Terraform and Infrastructure as Code, I’ve referred to the official documentation: https://lnkd.in/gBH9UDt8 🔄 Terraform Flow: Write Config → Initialize → Plan Changes → Apply Infrastructure→ Resources Created/Updated 🛜 DevOps is not just about deploying applications. It also involves securing pipelines and automating infrastructure to make the entire process reliable and consistent. #DevOps #CICD #GitHubActions #Terraform #InfrastructureAsCode #Automation #Cloud #LearningInPublic #Engineering #InfraAsCode #ContinuousDelivery #BuildInPublic #DevOpsJourney #Secure #DevOpsEngineering
To view or add a comment, sign in
-
🚀 Terraform Concept Every DevOps Engineer Must Know 👉 Implicit vs Explicit Dependency 🔍 What is Dependency in Terraform? Dependency defines the 𝗼𝗿𝗱𝗲𝗿 𝗼𝗳 𝗿𝗲𝘀𝗼𝘂𝗿𝗰𝗲 𝗰𝗿𝗲𝗮𝘁𝗶𝗼𝗻. Terraform uses a 𝗗𝗔𝗚 (𝗗𝗶𝗿𝗲𝗰𝘁𝗲𝗱 𝗔𝗰𝘆𝗰𝗹𝗶𝗰 𝗚𝗿𝗮𝗽𝗵) to decide what runs first. ⚡ Implicit Dependency (Automatic) 👉 When one resource references another Example: EC2 uses Security Group → Terraform auto-manages order ✔ No extra code ✔ Clean & scalable ✔ Best practice 💡 Insight: "Terraform is smart enough to understand relationships if you write clean references." ⚙️ Explicit Dependency (Manual) 👉 Defined using depends_on Used when Terraform 𝙘𝙖𝙣𝙣𝙤𝙩 𝙙𝙚𝙩𝙚𝙘𝙩 𝙙𝙚𝙥𝙚𝙣𝙙𝙚𝙣𝙘𝙮 ✔ Full control on execution ✔ Useful for hidden dependencies ⚠️ But: Overuse makes code complex 🎯 Real Interview Tip 💬 Best Answer: "I prefer implicit dependencies for cleaner architecture and rely on explicit dependencies only when Terraform cannot infer relationships." 🔥 Pro Tip If you are using too many depends_on 👉 You are solving the problem incorrectly 📌 Final Thought "Good engineers write Terraform code. Great engineers design dependency flow." #Terraform #DevOps #Cloud #AWS #Azure #InfrastructureAsCode #Automation #DevOpsEngineer Learning with DevOps Insiders
To view or add a comment, sign in
-
Explore related topics
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development