Creating High Availability Architecture Cloud System Design with AWS CLI

Arjun Singh
5 min readNov 2, 2020

This Blog explains how to design a Web Service architecture on Cloud with High Availability using various Cloud services including Cloudfront for Content Delivery Network

AWS Services

The high availability architecture which I can be designed will include:

  • Apache httpd Webserver configured on EC2 Instance
  • Document Root(/var/www/html) made persistent by mounting on EBS Block Device.
  • Static objects such as pictures stored in S3 storage service
  • Setting up Content Delivery Network using CloudFront and using the origin domain as S3 bucket.
  • Finally, place the Cloud Front URL on the web application code for security and low latency.

Note: We will do most of the things using the AWS CLI (Command Line Interface)

Step 1: Webserver configuration on EC2 Instance

First of all, we need to Launch an EC2 Instance by creating a key-pair, security group, and launching the Instance. You can refer to my previous post (blog) where I talked about how to do the above tasks using the AWS CLI

If we already have an instance, we can start that instance using CLI if we know the instance id as follows:

Now, we will use PuTTY in Windows to remote login into the Instance using the Public IP Address from the above description of the Instance.

Now we configure the Apache httpd web server in the following 2 steps:

Step (i): Installing the httpd daemon using yum command

Step (ii): Starting the httpd service

With this, our web server is configured and ready to listen on port 80.

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

Now, we could have configured the webpages to be served in Document Root of EC2 Instance root EBS storage, but that would not a secure way as we could lose our webpages and code if the Instance goes down. Hence, what we do is, we create a new EBS volume and mount it onto the Document Root folder so that our data would remain safe even if the Instance goes down.

I have already explained how to create EBS storage and attach it to Instance using AWS CLI in my previous post (blog) which you can refer via the following link.

After creating and attaching the EBS volume, we would make a partition on the EBS volume, format it, and then mount it onto the Document Root folder.

Attached EBS volume

Creating partition:

Created

Formatting the created Partition in xfs format type

Mounting the partition to the Document Root (/var/www/html)

With this, we have set up our external EBS block device to store the web pages to be served.

Step 3: Static objects such as pictures stored in S3 storage service (Storing picture in S3 using CLI)

Creating Bucket

Upload photograph

Step 4: Setting up Content Delivery Network using CloudFront and using the origin domain as S3 bucket.

We get the URL as: d8i8lx2nxywoo.cloudfront.net/photo.jpeg

This URL can be used in the HTML code of the web page.

Step 5: Finally, place the Cloud Front URL on the web application code for security and low latency.

Finally, the High Availability AWS architecture is successfully deployed.

Note: There could be changes observed in the public IPv4 address. This happens in case you restart the instance, and are assigned with a different IP address by DHCP.

This all for this task.

Thank You.

#awscloud #awscli #aws #vimaldaga #righteducation #educationredefine #rightmentor #worldrecordholder #linuxworld #makingindiafutureready #righeudcation #awsbylw #arthbylw

--

--