This project demonstrates a basic 3-tier architecture infrastructure setup using Terraform on AWS. It is designed as a learning project to understand Infrastructure as Code (IaC) concepts and how cloud resources are provisioned and connected.
The architecture includes:
- Web Tier
- Application Tier
- Database Tier
-
Web Tier
- EC2 instance running Apache HTTP Server
- Exposed to the internet via public subnet
-
App Tier
- EC2 instance in a private subnet
- Handles backend logic (placeholder setup for learning)
-
Database Tier
- Amazon RDS MySQL instance (or EC2-based DB if configured)
- Hosted in a private subnet for security
-
Networking
- Custom VPC
- Public and private subnets
- Internet Gateway
- NAT Gateway for private subnet internet access
- Terraform
- AWS (EC2, VPC, Subnets, RDS, NAT Gateway)
- Apache HTTP Server
- Ubuntu
-
Terraform creates the AWS infrastructure:
- VPC
- Subnets (public & private)
- Route tables
- NAT Gateway
- EC2 instances
- RDS database
-
User data script installs and configures Apache on the Web Tier EC2.
-
The Web Tier serves a simple HTML page to confirm deployment.
The web server is configured using userdata.sh:
- Installs Apache HTTP Server
- Starts and enables the service
- Creates a default
index.htmlpage
terraform init
terraform plan
terraform apply To destroy the infrastructure:
terraform destroyThis project helps understand:
- Infrastructure as Code (IaC)
- AWS networking (VPC, subnets, routing)
- Multi-tier architecture design
- EC2 and RDS provisioning
- Basic automation using Terraform