अर्थ Program Task — 6

SIBAYAN BAG
3 min readNov 4, 2020

Task 6 Description
✳ Create High Availability Architecture with AWS CLI
✳ The architecture includes-

1-> Webserver configured on EC2 Instance
2-> Document Root(/var/www/html) made persistent by mounting on EBS Block Device.
3-> Static objects used in code such as pictures stored in S3
4-> Setting up Content Delivery Network using CloudFront and using the origin domain as S3 bucket.
5-> Finally place the Cloud Front URL on the webapp code for security and low latency.

* Launching An instances :-

To launch instance ->

>aws ec2 run-instances — image-id ami-052c08d70def0ac62 — instance-type t2.micro — count 1 — security-group-ids sg-0341318d6091607aa — key-name mykey

Instance launch successfully………

* Configure Web Server :-

* Creation of EBS volume:-

To create EBS volume ->

>aws ec2 create-volume — volume-type gp2 — size 1 — availability-zone ap-south-1b

EBS volume created……..

* To attach the above created EBS volume to the instance :-

To attach volume ->

> aws ec2 attach-volume — volume-id vol-0fe5c1584e4d57688 — instance-id i-0856b1f47852457f3 — device /dev/sdf

Attach volume successfully…….

* Creation of Partition :-

>fdisk /dev/xvdf

For Format the Partition Use ->

>mkfs ext4 /dev/xvdf1

For Mount The Drive Use ->

>mount /dev/xvdf1 /var/www/html

* Creation Of S3 Bucket :-

To create bucket ->

>aws s3api create-bucket — bucket sibayan — create-bucket-configuration LocationConstraint=ap-south-1

Bucket created……..

* Uploading the image to S3 bucket :-

To upload ->

>aws s3 cp C:\Users\admin\Pictures\my.jpg s3://sibayan

Successfully uploaded …….

* Creation Of Content Delivery Network using CloudFront and using the origin domain as S3 bucket :-

To create CloudFront ->

>aws cloudfront create-distribution — origin-domain-name sibayan.s3.ap-south-1.amazonaws.com

Created successfully……….

* Place the Cloud Front URL on the webapp code for security and low latency :-

Done…..

Task Completed !!!!!!!!!!!

--

--