Project Overview
The primary objective of this project is to design and implement a highly available and scalable web application infrastructure within Amazon Web Services (AWS). The application will be deployed across multiple Availability Zones (AZs) within a Virtual Private Cloud (VPC) to ensure redundancy, fault tolerance, and load distribution.
Objectives
- Designing a custom VPC with appropriate public subnets across two Availability Zones (eu-west-1a and eu-west-1b).
- Deploying a web server with Apache and a sample web page.
- Creating an Amazon Machine Image (AMI) for EC2 replication.
- Configuring an Application Load Balancer (ALB) to evenly distribute traffic.
- Setting up Auto Scaling Groups to handle variable traffic loads and improve fault tolerance.
- Ensuring the entire setup is resilient, scalable, and publicly accessible through the ALB endpoint.
- Register a custom domain and configure Route 53 DNS records for public accessibility.
- Secure web traffic using AWS Certificate Manager (ACM) and HTTPS (port 443).
STEP 1 : Design a suitable network
STEP 2 : Draw the topology to meet this requirement
STEP 3 : Create Management VPC
STEP 4 :Create public subnets in two availability zones, eu-west-1a and eu-west-1b, respectively.
eu-west-1a
eu-west-1b
STEP 5: Create a Route Table for Each Subnet.
STEP 6: Create an EC2 Instance and Install the Web Application on It
Create an EC2 instance
Install Apache
sudo apt update
sudo apt install apache2 -y
Empty apache file using tee with /dev/null
sudo tee /var/www/html/index.html < /dev/null
Create the HTML file
sudo nano /var/www/html/index.html
- Paste your HTML code into the file.
- Save and exit (CTRL+O, ENTER, then CTRL+X)
Restart the web server
sudo systemctl restart apache2
STEP 7 : Create an AMI from the EC2 Instance Running the Web Application.
STEP 8: Create a Target Group for the Application Load Balancer.
STEP 9: Create an Application Load Balancer
STEP 10 : Create a launch template
STEP 11 : Create an Auto Scaling Group
Attach to load balancer
STEP 12 : Each of the two instances is running in a different Availability Zone.
STEP 13: Copy the DNS Name of the Elastic Load Balancer and Access It via a Web Browser.
elb-url (WEB-APP-LB-909414547.eu-west-1.elb.amazonaws.com)
STEP 14 : Create A record and attach to load balancer DNS name
Create a record from existing hosted zone
Open the website (http://web.dbesttech.it.com/)
STEP 15: Create a secured website access with the help of AWS Certificate Manager.
STEP 16: Create a record in Route 53 for AWS Certificate Manager validation.
STEP 15: Change the load balancer listener port from port 80 to 443.
STEP 15: Open a secured website (https://web.dbesttech.it.com/).
Conclusion
This project successfully demonstrated the end-to-end deployment of a web application across multiple Availability Zones within a custom Virtual Private Cloud (VPC) on AWS. By designing a robust network architecture and leveraging key AWS services such as EC2, AMI, Application Load Balancer (ALB), and Auto Scaling Groups, the solution achieved high availability, scalability, and fault tolerance.
The use of public subnets in multiple Availability Zones ensured that the web application remained accessible even in the event of an AZ failure. The load balancer provided efficient traffic distribution, while the launch template and auto-scaling configuration enabled the infrastructure to adapt dynamically to varying workloads.
This deployment aligns with cloud architecture best practices and lays a strong foundation for building resilient, performant, and scalable web applications in the cloud. Future improvements include integrating AWS WAF for enhanced security, using RDS in private subnets for data persistence, deploying CloudFront for global content delivery, and adding centralized monitoring and logging with Amazon CloudWatch and AWS Config for improved visibility.
Awesome, this is well detailed