A production-ready DevOps project that provisions AWS cloud infrastructure using Terraform (Infrastructure as Code) and deploys a containerized Node.js application through an automated GitHub Actions CI/CD pipeline. Everything from cloud resources to application deployment is fully automated — no manual AWS console clicks required.
node-terraform-devops-project/
├── .github/
│ └── workflows/
│ └── deploy.yml # GitHub Actions CI/CD pipeline
├── terraform/
│ ├── main.tf # Core AWS infrastructure resources
│ ├── variables.tf # Input variables (region, instance type, etc.)
│ ├── outputs.tf # Output values (public IP, URLs)
│ └── provider.tf # AWS provider configuration
├── app.js # Node.js application entry point
├── package.json # Node.js dependencies and scripts
└── Dockerfile # Container image definition
| Layer | Technology | Purpose |
|---|---|---|
| Application | Node.js + JavaScript | Backend API / web server |
| Containerization | Docker | Package the application |
| Infrastructure as Code | Terraform | Provision AWS resources |
| Cloud Provider | AWS (EC2 / ECS / VPC) | Host and run the application |
| CI/CD | GitHub Actions | Automate build → push → deploy |
| Image Registry | AWS ECR / Docker Hub | Store Docker images |
git clone https://github.com/Aijazkhan123/node-terraform-devops-project.git
cd node-terraform-devops-projectaws configure
# Enter: AWS Access Key, Secret Key, Region (e.g. us-east-1)cd terraform
terraform init # Download provider plugins
terraform plan # Preview what will be created
terraform apply # Create AWS resourcesdocker build -t node-terraform-app .
docker run -p 3000:3000 node-terraform-appVisit: http://localhost:3000
cd terraform
terraform destroyOn every git push to main, the GitHub Actions workflow automatically:
- Checks out the source code
- Builds the Docker image
- Pushes the image to AWS ECR or Docker Hub
- Runs
terraform applyto provision/update AWS infrastructure - Deploys the latest container to EC2 / ECS
AWS credentials are stored securely as GitHub Secrets (
AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY).
| Secret Name | Description |
|---|---|
AWS_ACCESS_KEY_ID |
Your AWS IAM access key |
AWS_SECRET_ACCESS_KEY |
Your AWS IAM secret key |
AWS_REGION |
Target AWS region (e.g. us-east-1) |
DOCKER_USERNAME |
Docker Hub username (if used) |
DOCKER_PASSWORD |
Docker Hub password (if used) |
- Writing Terraform configurations to provision real AWS infrastructure from scratch
- Deploying containerized applications to AWS EC2 / ECS using Docker
- Building end-to-end automated CI/CD pipelines with GitHub Actions
- Managing cloud credentials securely with GitHub Secrets
- Understanding Infrastructure as Code (IaC) and its role in modern DevOps
- Add an Application Load Balancer (ALB) in front of EC2
- Use Terraform remote state with AWS S3 + DynamoDB locking
- Add Terraform workspaces for dev / staging / prod environments
- Integrate AWS CloudWatch for monitoring and logging
- Add auto-scaling group for high availability
MIT License — free to fork, learn from, and build upon.
Node.js · Terraform · AWS · Docker · GitHub Actions · IaC · CI/CD · DevOps · EC2 · VPC