Terraform β’ AWS β’ Docker β’ EC2 β’ VPC β’ Infrastructure as Code
This project demonstrates how to build a modular AWS infrastructure using Terraform and Infrastructure as Code (IaC) principles.
The platform provisions:
- AWS VPC
- Public and Private Subnets
- Internet Gateway
- Route Tables
- Security Groups
- Frontend EC2 Instance
- Backend EC2 Instance
- Dockerized Application Stack
- Reusable Terraform Modules
The goal of this project is to showcase cloud infrastructure design, Terraform best practices, modular architecture, and AWS networking fundamentals.
Internet
β
Internet Gateway
β
VPC (10.0.0.0/16)
β
βββ Public Subnet (10.0.1.0/24)
β βββ Frontend EC2
β βββ Dockerized Nginx
β βββ Port 8080
β
βββ Private Subnet (10.0.11.0/24)
βββ Backend EC2
βββ Dockerized API
βββ Port 3000
| Technology | Purpose |
|---|---|
| Terraform | Infrastructure as Code |
| AWS EC2 | Compute Resources |
| AWS VPC | Networking |
| Security Groups | Access Control |
| Docker | Containerization |
| Nginx | Frontend Web Server |
| Ubuntu Linux | Operating System |
terraform-aws-3tier-platform/
βββ diagrams/
β βββ terraform-aws-3tier-platform.drawio
β βββ terraform-aws-3tier-platform.png
β βββ terraform-aws-3tier-platform.svg
β
βββ modules/
β βββ ec2/
β βββ security-groups/
β βββ vpc/
β
βββ screenshots/
β
βββ main.tf
βββ provider.tf
βββ variables.tf
βββ outputs.tf
βββ versions.tf
βββ README.md
Responsible for:
- VPC Creation
- Public Subnet
- Private Subnet
- Internet Gateway
- Route Tables
Responsible for:
- Frontend Security Group
- Backend Security Group
- Access Rules
Responsible for:
- Frontend EC2 Instance
- Backend EC2 Instance
- Instance Networking
terraform initterraform validateterraform planterraform applyterraform destroyImplemented security controls:
- SSH Access via Key Pair Authentication
- Frontend Service exposed on Port 8080
- Backend Service restricted to internal communication
- Security Group based traffic control
- Infrastructure resources isolated within custom VPC
The project exposes useful deployment information:
- VPC ID
- Public Subnet ID
- Private Subnet ID
- Frontend Public IP
- Frontend Private IP
- Backend Private IP
View outputs:
terraform outputRead the full technical article:
https://devriston.com.pk/blog/terraform-aws-3tier-platform.html
https://dev.to/muhammadkamrankabeeross
Interview preparation notes:
docs/interview-guide.md
- Application Load Balancer (ALB)
- Auto Scaling Groups (ASG)
- S3 Remote Backend
- DynamoDB State Locking
- GitHub Actions CI/CD
- AWS CloudWatch Monitoring
- RDS Database Tier
- Multi-Environment Deployment
DevOps Engineer focused on Cloud Infrastructure, Linux, Terraform, AWS, Automation, and Infrastructure as Code.
π Website: https://devriston.com.pk
π Dev.to: https://dev.to/muhammadkamrankabeeross
π GitHub: https://github.com/muhammadkamrankabeer-oss
If you found this project useful, consider giving it a star β.





