karan.dev
All projects

DevOps Ultimate CI/CD Pipeline on AWS

Sep 2025 — Oct 2025

End-to-end CI/CD pipeline on AWS automating build, test, security scans, and Kubernetes deployments.

AWSJenkinsDockerKubernetesTerraformAnsible

Problem

Manual deployments to a Kubernetes cluster on AWS were error-prone, slow, and missed security checks. Each new microservice required engineers to repeat ~80% of the same setup.

Approach

  1. Codified the entire AWS substrate (VPC, EKS, IAM, S3) in Terraform — one apply provisions a fresh environment.
  2. Used Ansible for post-provisioning config (Jenkins, Nexus, SonarQube on a control-plane VM).
  3. Built a 10+ stage Jenkins pipeline: checkout → unit test → SonarQube → Maven build → Docker build → Trivy scan → Nexus push → Helm deploy to EKS → Prometheus scrape config update.
  4. Pinned every tool version and wrote pipeline-as-code in Jenkinsfile so onboarding a new service is a copy-paste of ~30 lines.
  5. Wired Prometheus + Grafana for app and pipeline metrics; alerts for failed deploys and stuck pods.

Outcomes

  • Setup time for a new microservice cut by ~80%.
  • Deployment effort reduced ~90% via pipeline automation.
  • Trivy gate blocks images with critical CVEs from reaching prod.

Learnings

The Terraform + Ansible split is worth it: Terraform owns infra state, Ansible owns config drift. Putting security scanning early (pre-Nexus) means you don't waste artifacts you can't deploy. Helm is great for templating but resist the urge to template everything — keep app-specific values minimal.