Production AWS Deployment Platform
A complete production deployment platform built to demonstrate the full CI/CD and infrastructure-as-code lifecycle on AWS. The system provisions a VPC, EC2 instance, security groups, and an ECR container registry using Terraform with remote state stored in S3. A GitHub Actions pipeline runs tests, builds and pushes a Docker image tagged with the commit SHA, applies Terraform infrastructure changes, deploys the container to EC2 via SSH, and runs automated health checks — all triggered by a single git push. Prometheus and Grafana run alongside the application for real-time monitoring.
Tech Stack
The Challenge
Most teams treat infrastructure provisioning and application deployment as separate manual processes. The goal was to build a single automated system where pushing code triggers everything — infrastructure updates, container builds, deployment, and health verification — with no human steps in between.
Architecture
Terraform defines the full AWS environment — VPC with public subnet, EC2 instance, security groups allowing HTTP, HTTPS, and SSH, and an ECR repository for Docker images. Remote state is stored in S3 with DynamoDB locking for safe concurrent pipeline runs. The application is a lightweight Node.js API with /health and /version endpoints. Docker images are tagged with the git commit SHA so every running container is traceable back to an exact code state. Prometheus scrapes application and system metrics. Grafana visualises them on a live dashboard.
Deployment Strategy
GitHub Actions pipeline runs five sequential jobs: test runs the application test suite and blocks everything if it fails. terraform-plan runs on pull requests and posts the infrastructure diff as a PR comment. terraform-apply provisions or updates AWS infrastructure on merge to main. deploy SSHs into EC2, pulls the new image from ECR by commit SHA, stops the old container, and starts the new one. health-check curls the /health endpoint five times — if any check fails the pipeline fails and a notification fires. The previous container is kept running until the new one passes health checks, giving zero-downtime deployments.
Outcome
Full deployment cycle from code push to live server completes in under 10 minutes. Infrastructure is fully reproducible — the entire AWS environment can be torn down and rebuilt from code in one command. Every deployment is traceable by commit SHA. Health check gate prevents broken deployments from reaching production.