This project provisions a highly available web application infrastructure on AWS using Terraform.
It creates a custom VPC, public subnets across multiple Availability Zones, EC2 web servers, an Application Load Balancer (ALB), and supporting networking resources.
The infrastructure is fully automated and reproducible using Infrastructure as Code (IaC).
The deployed architecture includes:
- Custom VPC (
10.0.0.0/16) - Two public subnets in different Availability Zones
- Internet Gateway for public access
- Route Table with outbound internet routing
- Security Group allowing:
- HTTP (80)
- SSH (22)
- Two EC2 web servers
- Bootstrapped via
user_data
- Bootstrapped via
- Application Load Balancer
- Distributes traffic across EC2 instances
- Target Group & Listener
- S3 Bucket for storage
- Terraform Outputs
- Load Balancer DNS name
Ensure you have the following installed and configured:
- Terraform ≥ 1.x
- AWS CLI
- An AWS account
- AWS credentials configured via:
aws configure
- Clone the repository
git clone https://github.com/SamyogGhimire/Terraform-AWS-Project.git
cd Terraform-AWS-Project
- Initialize Terraform
terraform init
- Validate Configuration
terraform validate
- Review Execution plan
terraform plan
- Apply infrastructure
terraform apply
- Access the application Use the load_balancer_dns output in your browser.
To remove all created AWS resources:
terraform destroy
.
├── main.tf
├── userdata.sh
├── userdata1.sh
├── image.png
└── README.md
