USE CASE
I was tasked with deploying an application to a live server, ensuring high availability, scalability, and monitoring the application performance.
PREREQUISITES
Basic Linux Commands
Ubuntu Server
Custom Domain.
Basic Networking.
DEFINITION OF SERVICES
Virtual Private Cloud: This is a virtual networking environment where you can launch AWS resources.
Elastic Compute Cloud: It is a virtual machine that provides resizable compute capacity in the cloud.
Elastic Block Store: It is a block-level storage service that provides persistent storage for EC2 instances.
EBS Snapshot: It is a point-in-time copy of an EBS volume.
AWS CloudWatch: This provide data and insights about AWS resources and applications.
Auto Scaling Group: This automatically adjust the number of instances in the group based on changing workload demands, ensuring that your application has the necessary resources to handle increased traffic or demand.
VIRTUAL PRIVATE CLOUD (VPC)
Let's start with the networking aspect of our application. In AWS, we utilize a Virtual Private Cloud (VPC) to secure our infrastructure. Since cloud computing relies on shared public infrastructure, a VPC provides a secure, isolated environment for our application. This enables us to control incoming and outgoing traffic, ensuring the security and integrity of our website.
ELASTIC COMPUTE CLOUD
Next, we'll create an Amazon EC2 instance to host our application. On this instance, we'll install Nginx, a popular web server, and configure it to listen on port 80 (the default HTTP port). This will enable our application to serve web content to users.
Next, create a new key pair and utilize the custom VPC previously created. Ensure public IP assignment is enabled.
Next, update the security group created earlier by adding HTTP (port 80) and HTTPS (port 443) inbound rules. This will enable internet access to the web server.
Next, connect to the instance and Update the package list as well as installing Nginx web server software.
Next, enable the firewall to allow inbound traffic on port 80 (HTTP) to permit external access to the web server.
Next, download the HTML files and create a new directory at /var/www to host the website files.
Next, navigate to the /etc/nginx directory and create a symbolic link to the HTML files in the sites-available and sites-enabled directories.
Next, navigate to the /etc/nginx directory and create a symbolic link to the HTML files in the sites-available and sites-enabled directories.
"Next, remove the default Nginx page, as it is no longer needed since we have uploaded our customized HTML files.
Next is to update our DNS manager with the IP address of the instance. Kindly go to your domain provider and update the DNS Manager.
Next is to access the web app using the domain name instead of the IP address.
Next, let's install Certbot to secure the web application.
With the Certbot certificate in place, our web application now has an additional layer of security, safeguarding user information and preventing potential threats.
Elastic Block Store
Next, we will add additional storage to our instance to accommodate surges in traffic on our web application. We will create an EBS volume and attach it to the instance that was created. Firstly, let's check our default EBS Volume attached to our EC2 instance.
Let's leave everything in default and create our EBS volume. Next, let's attach the volume to the instance.
EBS SNAPSHOT
Let's create EBS snapshot, this will serve as a backup for the EBS volume.
Now, let's create another EC2 instance and attached it to the snapshot and connect via ssh.
Next, let's navigate to EBS Volume and create the snapshot.
AWS CLOUDWATCH
Now that the web application is secured, the next step is to set up CloudWatch to monitor its performance and trigger alarms when necessary. This will help us monitor Memory and Disk. Firstly, let's configure CloudWatch agent.
Next, let's create IAM role for the CloudWatch agent.
Now let attached the role created to the instance.
Next is to continue with the configuration for the CloudWatch.
AUTO SCALING GROUP.
Next is to set our auto-scaling for high availability and scalability. Firstly, let create a launch template that will be attached to the auto scaling.
Next, is to launch a new instance and attached the new image as AMI.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x58v220lrtuxcii8pdvs.jpg
CONCLUSION
We successfully launched a fully functional web application leveraging the power of Amazon Web Services (AWS). By utilizing a Virtual Private Cloud (VPC) for secure networking, Elastic Block Store (EBS) for persistent storage, AWS CloudWatch for real-time monitoring, and Auto Scaling Groups for dynamic scalability, we ensured our web application is highly available, scalable, and resilient.
This deployment showcases the effectiveness of AWS services in building a robust and efficient web infrastructure, capable of handling diverse workloads and adapting to changing demands.
Top comments (0)