Production-ready DevOps infrastructure automation showcasing modern cloud-native practices
🔥 Live Demo • 📖 Documentation • 🛠️ Getting Started • 💼 Portfolio
- 🎯 Project Overview
- 🏗️ Architecture
- 🧰 Technology Stack
- ✨ Key Features
- 🚀 Quick Start
- 📁 Project Structure
- 🔄 CI/CD Pipeline
- 💡 Implementation Highlights
- 🎯 Challenges & Solutions
- 📈 Monitoring & Observability
- 🔮 Future Roadmap
- 🤝 Contributing
- 👨💻 Author
- 📄 License
This project demonstrates enterprise-grade infrastructure automation by building a complete DevOps pipeline that provisions, deploys, and manages a containerized Node.js application on AWS using modern Infrastructure-as-Code (IaC) practices.
- 🔄 Fully Automated: Zero-touch deployment from code commit to production
- 🏗️ Modular Infrastructure: Reusable Terraform modules for scalability
- 🛡️ Security First: IAM roles, security groups, and secrets management
- 📊 Production Ready: Application Load Balancer, health checks, and monitoring
- 💰 Cost Optimized: Efficient resource utilization with AWS free tier
Category | Technologies |
---|---|
☁️ Cloud Platform | AWS (EC2, VPC, ALB, IAM, Route 53) |
🏗️ Infrastructure as Code | Terraform (Modular Architecture) |
🐳 Containerization | Docker, DockerHub Registry |
🔄 CI/CD Pipeline | GitHub Actions, Automated Workflows, Jenkins |
🌐 Application | Node.js, Express.js, RESTful APIs |
🔒 Security | IAM Roles, Security Groups, SSH Keys |
📊 Monitoring | Prometheus, Grafana, AWS CloudWatch |
🔐 Secrets Management | GitHub Secrets, AWS Secrets Manager |
- 🧩 Modular Terraform Design: Separate modules for VPC, EC2, ALB, and IAM, Others
- 🌍 Multi-Environment Support: Dev, staging, and production configurations
- 🔄 State Management: Remote state storage with S3 backend and DynamoDB locking
- ⚡ Automated Builds: Trigger on every commit to main branch
- 🐳 Container Registry: Automated push to DockerHub
- 📡 Remote Deployment: SSH-based deployment to EC2 instances
- 🔍 Health Monitoring: Application health checks and status monitoring
- 🔐 Secrets Management: Secure handling of credentials and API keys
- 🌐 Network Security: Custom VPC with public/private subnet architecture
- 🚪 Access Control: IAM roles and security groups with least privilege
- 🔒 SSH Hardening: Key-based authentication and secure connections
# Required tools
aws --version # AWS CLI
terraform --version # Terraform >= 1.0
docker --version # Docker
git --version # Git
git clone https://github.com/elonerajeev/Enterprise-Grade-Infrastructure-Automation-with-Terraform-AWS.git
cd Enterprise-Grade-Infrastructure-Automation-with-Terraform-AWS
cd terraform/environments/dev
aws configure
# Enter your AWS Access Key ID, Secret Access Key, and preferred region
terraform init
terraform plan
terraform apply -auto-approve
# Push to main branch triggers automatic deployment
# In Root Directory
git add .
git commit -m "feat: deploy application"
git push origin main
📦 Enterprise-Grade-Infrastructure-Automation/
├── 🏗️ terraform/
│ ├── 🌍 environments/
│ │ └── dev/
│ │ ├── main.tf # Main configuration
│ │ ├── variables.tf # Input variables
│ │ ├── outputs.tf # Output values
│ │ └── terraform.tfvars # Variable values
│ └── 📚 modules/
│ ├── vpc/ # VPC module
│ ├── ec2/ # EC2 module
│ ├── alb/ # Load balancer module
│ └── iam/ # IAM roles module
├── 🐳 app/
│ ├── src/ # Application source
│ ├── Dockerfile.prod # Production dockerfile
│ ├── package.json # Dependencies
│ └── healthcheck.js # Health endpoint
├── 🔄 .github/
│ └── workflows/
│ └── build-and-push.yml # CI pipeline
| |__ deploy-to-ec2.yml # CD Pipeline
├── 📊 monitoring/ # Monitoring configs
├── 🔒 secrets/ # Secret templates
└── 📖 docs/ # Documentation
name: Build and Deploy to AWS EC2
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout Code
- name: 🐳 Build Docker Image
- name: 📤 Push to DockerHub
- name: 🚀 Deploy to EC2
Stage | Action | Status |
---|---|---|
🔍 Code Analysis | Lint and security scan | ✅ Active |
🏗️ Build | Docker image creation | ✅ Active |
🧪 Test | Unit and integration tests | ✅ Active |
📤 Publish | Push to DockerHub registry | ✅ Active |
🚀 Deploy | SSH deployment to EC2 | ✅ Active |
✅ Verify | Health check validation | ✅ Active |
# Example: VPC Module Usage
module "vpc" {
source = "../../modules/vpc"
vpc_cidr = var.vpc_cidr
availability_zones = var.availability_zones
public_subnet_cidrs = var.public_subnet_cidrs
tags = local.common_tags
}
# Multi-stage build for production
FROM node:18-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production && npm cache clean --force
FROM node:18-alpine AS runtime
WORKDIR /app
COPY --from=builder /app/node_modules ./node_modules
COPY . .
EXPOSE 3000
CMD ["node", "index.js"]
#!/bin/bash
# Deployed via GitHub Actions
docker pull elonerajeev/infra-app:latest
docker stop app-container || true
docker run -d --name app-container -p 80:3000 elonerajeev/infra-app:latest
🔧 Infrastructure Challenges
Challenge | Solution | Impact |
---|---|---|
VPC Module Dependencies | Implemented proper output references | ✅ Resolved |
ALB Subnet Requirements | Configured multi-AZ public subnets | ⚡ Performance |
State File Conflicts | S3 backend with DynamoDB locking | 🔒 Consistency |
Security Group Rules | Least privilege access principles | 🛡️ Security |
🚀 Deployment Challenges
Challenge | Solution | Impact |
---|---|---|
SSH Key Management | GitHub Secrets integration | 🔐 Security |
Docker Registry Auth | Automated token refresh | 🔄 Reliability |
Zero-Downtime Deployment | Blue-green deployment strategy | ⚡ Availability |
Container Health Checks | Custom health endpoint | 📊 Monitoring |
GET /metrics Response: Prometheus-formatted metrics
- 📊 Prometheus: Metrics collection and alerting
- 📈 Grafana: Visualization dashboards
- 🔍 AWS CloudWatch: Infrastructure monitoring
- 📱 Slack Integration: Alert notifications
Rajeev Kumar
AWS DevOps Engineer & Cloud Architect
"Building scalable cloud infrastructure with modern DevOps practices"
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License - Feel free to use this project for learning and development!