Secure Web Application Deployment Across Multiple Availability Zones in a VPC
ojo temitope seun

ojo temitope seun @ojotemitopseun

About: My name is Temitope Ojo. I have 10 years of experience in networking and MPLS networks, with over 3 years of experience in cloud computing, security, and network automation.

Location:
Nigeria , Lagos
Joined:
May 2, 2023

Secure Web Application Deployment Across Multiple Availability Zones in a VPC

Publish Date: Jun 30
4 1

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

Image description

STEP 2 : Draw the topology to meet this requirement

Image description

STEP 3 : Create Management VPC

Image description

STEP 4 :Create public subnets in two availability zones, eu-west-1a and eu-west-1b, respectively.

eu-west-1a

Image description

eu-west-1b

Image description

STEP 5: Create a Route Table for Each Subnet.

Image description

Image description

STEP 6: Create an EC2 Instance and Install the Web Application on It

Create an EC2 instance

Image description

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.

Image description

STEP 8: Create a Target Group for the Application Load Balancer.

Image description

Image description

STEP 9: Create an Application Load Balancer

Image description

STEP 10 : Create a launch template

Image description

STEP 11 : Create an Auto Scaling Group

Image description

Image description

Attach to load balancer

Image description

Image description

Image description

STEP 12 : Each of the two instances is running in a different Availability Zone.

Image description

Image description

STEP 13: Copy the DNS Name of the Elastic Load Balancer and Access It via a Web Browser.

Image description

elb-url (WEB-APP-LB-909414547.eu-west-1.elb.amazonaws.com)

Image description

STEP 14 : Create A record and attach to load balancer DNS name

Create a record from existing hosted zone

Image description

Image description

Image description

Open the website (http://web.dbesttech.it.com/)

Image description

STEP 15: Create a secured website access with the help of AWS Certificate Manager.

Image description

Image description

Image description

STEP 16: Create a record in Route 53 for AWS Certificate Manager validation.

Image description

Image description

STEP 15: Change the load balancer listener port from port 80 to 443.

Image description

Image description

Image description

Image description

STEP 15: Open a secured website (https://web.dbesttech.it.com/).

Image description

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.

Comments 1 total

Add comment