Create High Availability Architecture with AWS CLI

Harsh Agrawal
3 min readMar 21, 2021

--

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.

Today we will cover the above task.

For completing above task basic setup is required that is download and install aws cli on our machine as we will do above task by cli.

Also create an IAM user to login via cli by the command

aws configure 
Authentication via Cli

So after login we firstly need to start an EC2 instance

Next we need to create an EBS volume as..

Now attach the above created volume to the instance we created above

Now start the instance and create the partition of the attached volume.

Formatting the attached volume

Installing the Apache-httpd web server on the ec2 instance

Mounting the attached volume to the httpd folder(/var/www/html)

Now create an S3 bucket on aws

Uploading any random image on AWS s3 bucket

aws s3 cp av.jpg s3://task6h

Next creating and cloudfront-distribution on aws

Lastly we need to put index.html file as below shown and starting the httpd service by the command —

systemctl start httpd

Now to see the output go to web browser and type the public ip address and here is our output….

Thank you for reading

For any queries DM me on linkedin

https://www.linkedin.com/in/harsh-agrawal-38abb016a

Harsh Agrawal

--

--