This project deploys a static HTML web application on AWS, leveraging various resources for high availability, fault tolerance, and scalability. The deployment utilizes Amazon EC2 instances, a Virtual Private Cloud (VPC) with public and private subnets across two availability zones, security groups, an Internet Gateway, and other AWS services.
-
VPC Configuration:
- VPC with public and private subnets in two availability zones.
- Internet Gateway for communication between instances in the VPC and the Internet.
-
Security Groups:
- Firewalls controlling inbound and outbound traffic.
-
Availability Zones:
- Two availability zones for high availability and fault tolerance.
- Public subnets for resources like Nat Gateway, Bastion Host, and Application Load Balancer.
-
EC2 Instances:
- Hosts the static website.
- Distributed across availability zones using an Auto Scaling Group.
- EC2 Instance Connect Endpoint simplifies resource connection.
-
Internet Gateway:
- Enables communication between instances in the VPC and the Internet.
-
Nat Gateway:
- Allows instances in private subnets to access the Internet.
-
Auto Scaling Group:
- Dynamically creates EC2 instances for high availability, scalability, fault tolerance, and elasticity.
-
Route 53:
- Used to register the domain name and create a record set for DNS resolution.
-
GitHub Integration:
- Web files stored in GitHub for version control and collaborative development.
The deployment script automates the installation of the web app on an EC2 instance. Key steps include:
- Updating the system and installing necessary packages.
- Downloading the web app files from the GitHub repository.
- Extracting and copying the files to the appropriate web server directory.
- Enabling and starting the HTTP server.
#!/bin/bash
sudo su
yum update -y
yum install -y httpd
cd /var/www/html
wget https://github.com/samuelcombey/website/raw/main/website.zip
unzip website.zip
cp -r /var/www/html/website-main/* /var/www/html
rm -rf website.zip website-main
systemctl enable httpd
systemctl start httpd
This project successfully deploys a static website on AWS, utilizing various services and resources to achieve a robust and scalable architecture.