Created high Availability Architecture with AWS CLI

Ishika Mandloi
3 min readOct 31, 2020

This 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.

Let start!!

  1. Launch an EC2 instance using AWS CLI and configure Apache Webserver. to launch instance we use command :

later check in AWS GUI if the new instance is launched?

Now, install httpd in this instance and configure it

to start service we have command:

2.Now, create a new EBS volume, and attach it to this instance

check in gui

now this new volume is attach to this instance

3. AS we have to use this volume for our web page, we need to make partitions in this volume, later format it and mount it to folder(/var/www/html)

create partition using command:

Use n to create new partiton and then give the amount of space for partition

format partition using mkfs.ext2

mount it to /var/www/html using command:

4.Create a bucket in S3 and upload a image file

to create a new bucket we have command:

To upload a image file, we have command:

5. Now, we have to create a cloudfront distribution:

we have command:

Here, we get the domain name that we will link with html file.

6. In instance change directory to /var/www/html and make a new html file and put the link of cloudfront as image source

When we open the web page in server the process will be quit and faster ,the image will load on webpage

Hope you will enjoy, using cloudfront !!

Keep Learning!!

Thank You!!

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

No responses yet

Write a response