Creating a High Availability Architecture with AWS CLI

Creating a High Availability Architecture with AWS CLI

Problem Statement

✳️Create High Availability Architecture with AWS CLI

✳️The architecture includes-

⭕ Webserver configured on EC2 Instance

⭕Document Root(/var/www/html) made persistent by mounting on EBS Block Device.

⭕Static objects used in code such as pictures stored in S3

⭕Setting up Content Delivery Network using CloudFront and using the origin domain as S3 bucket.

⭕Finally place the Cloud Front URL on the webapp code for security and low latency.

All the above steps must be performed using AWS CLI

Solution Steps:-

Step1:- Download AWS CLI and configure it.

No alt text provided for this image

Step2:- Start an instance

No alt text provided for this image


No alt text provided for this image
No alt text provided for this image

Step3:- Create an EBS volume and then attach it to the instance.

No alt text provided for this image
No alt text provided for this image

Step4:- Now attach the volume to the instance.

No alt text provided for this image
No alt text provided for this image

Before using this attached volume , it must be partitioned and formatted first.

Step5:- PARTITIONING :

No alt text provided for this image

press enter (it will be first partition only)

press enter (it will be counting the space from initial sector)

w (save the partition and exit)

No alt text provided for this image

Step6:- FORMAT the partition with ext4 :

No alt text provided for this image

Step7:- Now Install httpd server using yum command

No alt text provided for this image

Step8:- Start the httpd service:

Check the status of the service:

No alt text provided for this image

Step9:- Now , Mount the /var/www/html folder to the created partition of the EBS volume

No alt text provided for this image
No alt text provided for this image

To check the web server configuration create a small code and access it through the webUI

NOTE : save the code in /var/www/html directory.

No alt text provided for this image
No alt text provided for this image

Step10:- Create a S3 bucket and upload some objects there.

No alt text provided for this image
No alt text provided for this image

Step11:- Add an image as an object in the bucket.

No alt text provided for this image
No alt text provided for this image

Step12:- Now create a cloud Front distribution with the origin as above bucket.

No alt text provided for this image
No alt text provided for this image

Step13:- Add the domain name of the cloud front distribution in the html file 

No alt text provided for this image

Now open the web.html page in browser.

No alt text provided for this image

***********************THANKS FOR READING**************************

To view or add a comment, sign in

More articles by Geetansh Sharma

Others also viewed

Explore content categories