Task 6 Description — ARTH 👨🏻‍💻
✳️Create High Availability Architecture with AWS CLI
✳️The architecture includes-

Shubham kumar
3 min readOct 29, 2020

AGENDA:

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

1.Webserver configured on EC2 Instance:

I. First get the instance id to get start and and after ip for connecting to instance by using
aws ec2 describe-instances — filters Name=instance-type,Values=t2.micro

start instance by :
aws ec2 start-instances — instance-ids i-012bc612f4372d99f
connect with :
ssh -i “awskey0722.pem” ec2-user@ec2–13–232–115–254.ap-south-1.compute.amazonaws.com

yum install httpd -> to install httpd
systemctl start http -> start httpd
sytemctl status httpd -> check the status

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

Firstly mount an volume to my instances using
aws ec2 attach-volume — device /dev/sdh — instance-id i-012bc612f4372d99f — volume-id vol-08757cd6a73d339d9

(for creating volume and getting volume id and instance id refer to my previous post/blog)

create partition using 3 steps commands are below and mount to /var/www/html

3.Static objects used in code such as pictures stored in S3

create s3 bucket and upload file by using these 2 commands:-
1. aws s3api create-bucket — bucket jayman — region ap-south-1 — create-bucket-configuration LocationConstraint = ap-south-1
2.aws s3 cp shubham.png s3://jayman/ — acl public-read-write

confirming by web

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

Using this make cloud front on s3:-
aws cloudfront create-distribution — origin-domain-name jayman.amazonaws.com

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

cmd used :- aws cloudfront create-distribution — origin-domain-name jayman1.amazonaws.com

and finally added it to html code at /var/www/html

\

--

--