Skip to content

rey26341-sudo/ENVIRONMENT-ACCESS-VALIDATION

Repository files navigation

Environment Access Validation

Python Shell AWS CloudShell CI/CD Status

A DevOps practice project that simulates and automates the pre-deployment environment validation process using a real Linux environment on AWS CloudShell.

image

Built and executed entirely in AWS CloudShell (ap-south-1, Mumbai) — a real cloud-hosted Linux terminal on Amazon's infrastructure.


What Problem Does This Solve?

In real DevOps work, before deploying any application, an engineer must verify:

Question Type of Check
Can I access the server? SSH / Shell check
Is the code repository ready? Repo structure check
Is the pipeline running? CI/CD pipeline check
Can I monitor the application? Log access check

Doing this manually every time is slow and error-prone. This project automates all 4 checks and generates a timestamped report.


Architecture

Developer (Rey)
      │
      │ types commands in browser
      ▼
┌─────────────────────────────────────────────┐
│         AWS CloudShell (ap-south-1)         │
│   Real Linux environment on AWS servers     │
│                                             │
│  ┌──────────────┐   ┌──────────────────┐   │
│  │   Check 1    │   │    Check 2       │   │
│  │ SSH / Shell  │   │ Repo structure   │   │
│  │ whoami       │   │ app.py           │   │
│  │ uname -n     │   │ config.yml       │   │
│  │ uptime       │   │                  │   │
│  └──────────────┘   └──────────────────┘   │
│  ┌──────────────┐   ┌──────────────────┐   │
│  │   Check 3    │   │    Check 4       │   │
│  │ Pipeline     │   │ Log directory    │   │
│  │ build_status │   │ logs/app.log     │   │
│  │ .txt         │   │                  │   │
│  └──────────────┘   └──────────────────┘   │
│              │                             │
│              ▼                             │
│   access_checklist_report.txt              │
│   (auto-generated report)                  │
└─────────────────────────────────────────────┘
      │
      │ git add → git commit → git push
      │ (SSH key auth via ed25519)
      ▼
┌─────────────────────────────────────────────┐
│              GitHub Repository              │
│         rey26341-sudo/ENVIRONMENT-          │
│           ACCESS-VALIDATION                 │
│                                             │
│  Files pushed:                              │
│  ├── validate_environment.py                │
│  ├── access_checklist_report.txt            │
│  ├── logs/app.log                           │
│  ├── pipeline_simulation/build_status.txt   │
│  ├── repo_simulation/app.py                 │
│  ├── repo_simulation/config.yml             │
│  └── .github/workflows/validate.yml        │
│              │                              │
│              ▼                              │
│       GitHub Actions CI/CD                  │
│   Runs automatically on every push          │
│   Lint → Validate → Archive report          │
└─────────────────────────────────────────────┘

Project Structure

ENVIRONMENT-ACCESS-VALIDATION/
│
├── validate_environment.py           ← Main Python validation script
├── access_checklist_report.txt       ← Auto-generated report
│
├── repo_simulation/
│   ├── app.py                        ← Simulated application
│   └── config.yml                    ← App configuration
│
├── pipeline_simulation/
│   └── build_status.txt              ← Simulated pipeline status
│
├── logs/
│   └── app.log                       ← Application log file
│
├── .github/workflows/
│   └── validate.yml                  ← GitHub Actions CI pipeline
│
└── pipeline_flow_documentation_v1.md ← Full pipeline documentation

The 4 Checks

# Check Commands Used Result
1 SSH / Shell Access whoami uname -n uptime ✅ SUCCESS
2 Repository Structure ls -R ls -l ✅ SUCCESS
3 Pipeline Status cat build_status.txt ✅ SUCCESS
4 Log Directory Access cat app.log ✅ SUCCESS

How To Run

# Clone the repo
git clone https://github.com/rey26341-sudo/ENVIRONMENT-ACCESS-VALIDATION.git
cd ENVIRONMENT-ACCESS-VALIDATION

# Run the validation script
python validate_environment.py

Output

==================================================
  ENVIRONMENT ACCESS VALIDATION
  2026-03-03 09:50:39
==================================================

CHECK 1: SSH / Shell Environment
  whoami   → cloudshell-user
  hostname → (not found — used uname -n)
  uname -n → ip-10-131-17-245.ap-south-1.compute.internal
  uptime   → 09:50:39 up 25 min, 0 users, load average: 0.02
  [✔] SSH / Shell Access: SUCCESS

CHECK 2: Repository Structure
  ✔ Found: repo_simulation/app.py
  ✔ Found: repo_simulation/config.yml
  [✔] Repository Structure: SUCCESS

CHECK 3: Pipeline Simulation
  ✔ pipeline: SUCCESS
  ✔ build #101 completed
  [✔] Pipeline Simulation: SUCCESS

CHECK 4: Log Directory Access
  ✔ application started successfully
  ✔ no errors detected
  [✔] Log Directory Access: SUCCESS

  Report written → access_checklist_report.txt
==================================================
  OVERALL: ALL CHECKS PASSED ✔
==================================================

Real Issues Faced & How I Solved Them

These are actual errors hit while building this in AWS CloudShell:

Issue Error Message Resolution
hostname not available bash: hostname: command not found Used uname -n as fallback
Git had no identity set fatal: empty ident name not allowed Ran git config --global user.email and user.name
SSH key permission too open WARNING: UNPROTECTED PRIVATE KEY FILE! Used correct private key file path
Space in folder name bash: cd: too many arguments Used underscore: repo_simulation

CI/CD Pipeline

GitHub Actions workflow runs automatically on every push to main:

Push to main → Setup Python 3.10 → Lint (flake8)
     → Run validate_environment.py
     → Archive access_checklist_report.txt (30 days)

What I Actually Did — Step by Step

  1. Opened AWS CloudShell in browser (ap-south-1, Mumbai region)

  2. Created project folder: mkdir env_acc_val && cd env_acc_val

    2026-03-03 (5)
  3. Created all files using Linux commands (echo, mkdir, nano)

  4. Ran real validation checks: whoami, uname -n, uptime, ls -R

    2026-03-03 (16) 2026-03-03 (17)

6.Wrote the checklist report using nano

2026-03-03 (19) 2026-03-03 (21)
  1. Initialized Git: git initgit add .git commit

    2026-03-03 (25) 2026-03-03 (26) 2026-03-03 (29)
  2. Fixed Git identity error with git config --global

  3. Generated SSH key pair: ssh-keygen -t ed25519

2026-03-03 (28)
  1. Connected repo to GitHub: git remote set-url origin
  2. Pushed all files to GitHub

What I Learned

  • How a real Linux cloud environment (AWS CloudShell) works
  • Linux commands: mkdir, echo, cat, ls, nano, cd, pwd, whoami, uname, uptime
  • Setting up Git from scratch in a new environment
  • Configuring SSH key authentication for GitHub
  • What pre-deployment checks actually are and why they matter
  • Writing a CI/CD pipeline with GitHub Actions
  • Documenting real issues and their resolutions

Tools & Technologies

  • AWS CloudShell — real Linux terminal on AWS (ap-south-1, Mumbai)
  • Python 3 — scripting and automation
  • Bash / Linux — all file creation done via terminal commands
  • Git — version control initialized from scratch
  • GitHub Actions — CI/CD pipeline automation
  • SSH (ed25519) — secure key authentication to GitHub
  • nano — terminal text editor

Project Status

This is a learning and practice project built to understand DevOps pre-deployment validation concepts. Executed in a real cloud environment (AWS CloudShell) but does not connect to a live production server.


Author

Rey — Aspiring DevOps Engineer Self-taught | DevOps Course Certified | Hands-on Practice GitHub Profile

About

Aligns with Github Sudo mode --performing sensitive actions to prevent misuse

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages