AWS DevOps Pipeline
Production-grade CI/CD that tests, builds and deploys a Next.js app to AWS: GitHub Actions, Packer machine images and Terraform, behind a load balancer with auto scaling and Multi-AZ PostgreSQL.

- 3Deploy jobs
- 1–4Auto-scaling EC2
- Multi-AZPostgreSQL 16
- 0Static AWS keys
Overview
A production-grade CI/CD pipeline that automatically builds, tests and deploys a Next.js application to AWS.
Every pull request is linted, tested and validated. Every push to main bakes a new machine image with Packer, applies the infrastructure with Terraform and rolls it out through an Auto Scaling Group behind an Application Load Balancer, with a Multi-AZ PostgreSQL database and no static cloud keys.
What it does
CI on every pull request
Lint, tests, build check, terraform fmt and terraform validate.
Immutable deploys
Packer bakes Ubuntu 22.04 images with Node.js 20, Nginx and the app pre-installed.
Infrastructure as code
Terraform modules for VPC, ALB, Auto Scaling, RDS, KMS, CloudWatch, ACM and Route 53.
Rolling refresh
New instances launch from the new image and old ones retire only after health checks pass.
Security by default
GitHub OIDC auth, KMS encryption, Secrets Manager and least-privilege IAM.
Monitoring
CloudWatch logs, alarms for 5xx errors and CPU, and a live dashboard.
How it works
Build image
GitHub Actions builds the app and Packer bakes it into a new AMI.
Apply infrastructure
Terraform plans and applies VPC, load balancer, Auto Scaling, RDS and monitoring.
Refresh instances
The Auto Scaling Group rolls out the new image with at least 50% healthy capacity.
Scale & watch
CPU-based scaling between 1 and 4 instances, with CloudWatch alarms and dashboards.