Skip to content

Parshant1231/cloud-native-devops-platform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

☁️ Cloud-Native DevOps Deployment Platform


AWS Terraform Docker GitHub Actions Nginx


🚀 Project Overview

This project demonstrates a production-style cloud-native deployment pipeline built using modern DevOps principles.

It automates:

  • Infrastructure provisioning (Infrastructure as Code)
  • Containerized application deployment
  • CI/CD pipeline execution
  • Reverse proxy configuration
  • Secure remote deployment to AWS

The goal is to simulate a real-world enterprise deployment workflow.


🏗️ Architecture Flow

graph TD
    Developer((fa:fa-code Developer))
    GitHub["fa:fa-github GitHub Repository"]
    
    subgraph GH_Actions [GitHub Actions CI/CD]
        Build["fa:fa-hammer Build Docker Image"]
        DockerPush["fa:fa-docker Push to DockerHub"]
    end

    DockerHub["fa:fa-box DockerHub Registry"]

    subgraph AWS_Cloud [AWS EC2 Infrastructure]
        Terraform["fa:fa-cloud Terraform Provisioning"]
        
        subgraph Instance [EC2 Instance]
            Nginx["fa:fa-server Nginx Reverse Proxy"]
            DockerRun["fa:fa-container Docker Runtime"]
        end
    end

    LiveApp((fa:fa-globe Live Production App))

    Developer -- "git push" --> GitHub
    GitHub --> Build
    Build --> DockerPush
    DockerPush -. "kanvit279/devops-app" .-> DockerHub
    DockerHub -- "docker pull" --> DockerRun
    Terraform -- "IaC" --> AWS_Cloud
    Nginx -- "Proxy (80 -> 3000)" --> DockerRun
    LiveApp --- Nginx
Loading

⚡ Technology Ecosystem

☁️ Cloud Layer 🏗️ Infrastructure 🐳 Container

AWS EC2
Elastic Compute Cloud

Terraform
Infrastructure as Code

Docker
Container Runtime

Security Groups
Network Firewall

HCL
Hashicorp Config

Compose
Multi-Container

IAM
Identity & Access

State Mgmt
Remote Backend

Registry
Image Repository
🔄 CI/CD 🌐 Reverse Proxy 💻 Backend 🖥 OS

GitHub Actions
Automation Engine

Nginx
Load Balancer

Node.js
JavaScript Runtime

Ubuntu
Linux OS

Auto Deploy
Continuous Delivery

Reverse Proxy
Request Routing

Express
Web Framework

Bash/Zsh
Shell Environment

Testing
Quality Gates

SSL/TLS
Secure Transport

NPM
Package Manager

Systemd
Service Manager

☁️ 3 Cloud Services 🏗️ 3 IaC Components 🐳 3 Container Tools 🔄 3 CI/CD Stages



📦 Project Architecture

Modular Directory Structure

Clean separation of concerns for maintainable infrastructure


🚀 Click to explore the architecture
📦 cloud-native-devops-platform
├── 📂 .github                          # GitHub Configuration Hub
│   └── 📂 workflows
│       └── 📜 deploy.yml                # ⚡ CI/CD Automation Engine
│                                          └── Triggers: push, PR to main
│
├── 📂 app                               # 🎯 Application Core
│   ├── 📜 index.js                       # 🧠 Node.js Core Logic
│   │                                       ├── Express server
│   │                                       ├── Health endpoints
│   │                                       └── API routes
│   ├── 📜 package.json                    # 📦 Dependency Manifest
│   │                                       ├── Scripts
│   │                                       ├── Dependencies
│   │                                       └── Metadata
│   └── 📜 Dockerfile                       # 🐳 Container Blueprint
│                                              ├── Multi-stage build
│                                              ├── Production optimization
│                                              └── Security hardening
│
├── 📂 terraform                          # 🏗️ Infrastructure as Code
│   ├── 📜 main.tf                          # 🏛️ Infrastructure Definition
│   │                                          ├── EC2 instances
│   │                                          ├── Security groups
│   │                                          └── IAM roles
│   ├── 📜 variables.tf                      # ⚙️ Environment Variables
│   │                                          ├── Instance types
│   │                                          ├── Region config
│   │                                          └── Key pairs
│   └── 📜 outputs.tf                        # 📍 Resource Mapping
│                                              ├── Public IPs
│                                              ├── DNS names
│                                              └── Instance IDs
│
├── 📂 nginx                              # 🌐 Reverse Proxy Layer
│   └── 📜 default.conf                     # 🔀 Proxy Rules
│                                              ├── Load balancing
│                                              ├── SSL termination
│                                              └── Request routing
│
└── 📜 README.md                          # 📚 Project Documentation
                                              ├── Setup guide
                                              ├── Deployment steps
                                              └── API reference

🔄 End-to-End DevOps Workflow

Automated pipeline from development to production


    ┌──────────────┐     ┌──────────────┐     ┌──────────────┐     ┌──────────────┐
    │   💻 DEV     │────▶│   🔄 GITHUB  │────▶│   🐳 DOCKER  │────▶│   ☁️ AWS     │
    │   PUSH       │     │   ACTIONS    │     │   BUILD      │     │   EC2        │
    └──────────────┘     └──────────────┘     └──────────────┘     └──────┬───────┘
           ▲                       ▲                      ▲                      │
           └───────────────────────┴──────────────────────┴──────────────────────┘
                                    🚀 CONTINUOUS DEPLOYMENT PIPELINE
  

⏱️ Deployment Timeline

1
Code Push
0s
2
CI/CD Trigger
5s
3
Docker Build
30s
4
Push to Hub
45s
5
EC2 Deploy
60s

📋 Step-by-Step Execution

🎯 Phase 1: Trigger

  1. 01 Developer pushes code to main branch
  2. 02 GitHub Actions detects the push event

🔄 Phase 2: Build

  1. 03 Docker image built from /app directory
  2. 04 Image pushed to DockerHub registry

🚀 Phase 3: Deploy

  1. 05 GitHub connects via SSH to AWS EC2 instance
  2. 06 EC2 pulls latest Docker image

✅ Phase 4: Live

  1. 07 Old container stopped and removed
  2. 08 New container starts with updated code
  3. 09 Nginx routes traffic port 80 → 3000
✨ Application Live → Zero Downtime Deployment Achieved ✨



⚡ CI/CD Pipeline Architecture

Automated GitHub Actions workflow for continuous delivery

🔄 GitHub Actions Pipeline

Checkout
🔑
Docker Login
🏗️
Build Image
📤
Push Image
🔌
SSH Connect to EC2
⬇️
Pull Image
🛑
Stop Old
🚀
Deploy New

🎯 Why CI/CD?

🚫 No Manual Work

Eliminates human intervention in deployment process

100% Automated

⚠️ Zero Errors

Reduces human mistakes in production

99.9% Reliable

⚡ Faster Releases

Deploy multiple times per day

2-min cycle



🏗️ Infrastructure as Code (Terraform)

Version-controlled infrastructure provisioning

📦 Terraform Manages

  • EC2 Instance - t2.micro
  • Security Group - Ports 22,80,3000
  • IAM Roles - Permissions
  • Network Config - VPC setup

🎯 Why Terraform?

📝 Version Control
🔄 Reproducible
🚫 No Manual Console
⚡ Auto Provision
📊 No Drift

💻 Terraform CLI Commands

The following Terraform commands are used to manage the infrastructure lifecycle:

# Initialize the working directory
terraform init

# Preview infrastructure changes before applying
terraform plan

# Deploy infrastructure
terraform apply -auto-approve

# Destroy all managed infrastructure
terraform destroy

🏛️ Infrastructure Architecture

    ┌─────────────────────────────────────────────────────────────┐
    │                      AWS Cloud                              │
    │  ┌─────────────────────────────────────────────────────┐    │
    │  │  Security Group (Ports: 22, 80, 3000)               │    │
    │  │  ┌─────────────────────────────────────────────┐    │    │
    │  │  │  EC2 Instance (t2.micro)                    │    │    │
    │  │  │  ┌─────────────────────────────────────┐    │    │    │
    │  │  │  │  Docker Container                   │    │    │    │
    │  │  │  │  Node.js App on Port 3000           │    │    │    │
    │  │  │  └─────────────────────────────────────┘    │    │    │
    │  │  └─────────────────────────────────────────────┘    │    │
    │  └─────────────────────────────────────────────────────┘    │
    └─────────────────────────────────────────────────────────────┘
  

🔄 Terraform Workflow

1
Write
.tf files
2
Plan
terraform plan
3
Apply
terraform apply
4
Manage
version control

✅ Fully Automated | 🔄 Zero Downtime | 🏗️ Infrastructure as Code | ⚡ CI/CD Enabled

🚀 Deployment Workflow

📦 Step-by-Step Deployment Guide

1

🏗️ Provision

Terraform

2

⚙️ Configure

EC2 Setup

3

📤 Push

Git Commit

4

🔄 Deploy

CI/CD

5

🌐 Access

Live App



Step 0. Create a key-par (Terraform used)

ssh-keygen -t rsa -b 4096 -f ~/.ssh/key-name
image

Step 1. Clone the Repository

git clone https://github.com/your-username/cloud-native-devops-platform.git
cd cloud-native-devops-platform

Step 2. Setup AWS Credentials (Required for Terraform)

# Install AWS CLI and configure:
aws configure

ℹ️ Provide: AWS Access Key, AWS Secret Key, Region (e.g., ap-south-1)

image

Step-3 Provision Infrastructure

# Navigate to the terraform directory:
cd terraform
terraform init
terraform plan
terraform apply

ℹ️ This creates the EC2 instance and required security groups with ports 22 (SSH), 80 (HTTP), and 3000 (Node.js) open.

image

Step-4 Configure EC2 (One-Time Setup)

# Connect to your EC2 instance
ssh -i your-key-pair.pem ubuntu@<public-ip>
image

Then install Docker and Nginx:

# Update package lists
sudo apt update && sudo apt upgrade -y

# Install Docker
sudo apt install docker.io -y
sudo systemctl start docker
sudo systemctl enable docker
sudo usermod -aG docker $USER  # Add user to docker group

# Install Nginx
sudo apt install nginx -y
sudo systemctl start nginx
sudo systemctl enable nginx

# Verify installations
docker --version
nginx -v

ℹ️ EC2 instance is prepared with all necessary tools for containerization and reverse proxy.

Step-5 Configure Nginx Reverse Proxy

Edit Nginx configuration:

sudo nano /etc/nginx/sites-available/default

Replace with:

server {
    listen 80;

    location / {
        proxy_pass http://localhost:3000;
    }
}

Restart nginx. Nginx listen on port 80 and forward all incoming web traffic to your application running on port 3000 inside the server.

image

Step-6 Push Code to GitHub

# Add all changes
git add .

# Commit with a meaningful message
git commit -m "Deploy: Update application with new features"

# Push to main branch (triggers CI/CD)
git push origin main

Step-7 CI/CD Handles Deployment

Before proceeding further, ensure that all required credentials are added under: Repository Settings → Secrets and Variables → Actions.


image

Step-8 Workflows Status

If it appears like this, it means everything is configured correctly.

image

Website View

image

📈 Future Improvements & Scalability

This project can be extended with:

  • Auto Scaling Groups for horizontal scaling
  • Application Load Balancer for high availability
  • HTTPS configuration using SSL certificates
  • Blue-Green or Rolling deployments
  • Monitoring stack (Prometheus + Grafana)
  • Centralized logging
  • Kubernetes-based deployment

These enhancements would make the system production-grade at enterprise level.

💰 Cost Management

To avoid unnecessary AWS charges:

terraform destroy

📊 Monitoring & Observability

  • EC2 metrics monitored via CloudWatch
  • CPU and memory usage can be tracked
  • Docker container status verified using docker ps
  • Logs accessible using docker logs

Monitoring ensures application health and availability.

🎯 Conclusion

This project demonstrates a complete DevOps production workflow, including infrastructure provisioning, containerization, CI/CD automation, and secure cloud deployment.

It reflects real-world engineering practices used in modern cloud-native environments.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors