Creating High Availability Architecture With AWS Cli

AWS with Cli

This architecture includes -

1. Webserver configured on EC2 instance

aws ec2 -help

aws ec2 run-instances — image-id ami-0533f2ba8a1995cf9 — instance-type t2.micro — count=1 — security-group-ids sg-0f7ebdf82d74664d2 — key-name mykey

aws emr ssh --cluster-id j-3SD91U2E1L2QX --key-pair-file ~/.ssh/mykey.pem

install httpd service

yum install httpd

systemctl start httpd #to start httpd services

2 . Creating EBS volume and attaching it to /var/www/html

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

aws ec2 create-volume — availability-zone us-east1a — size 1

aws ec2 attach-volume — volume-id vol-074e31ac6d9fe58e8 — instance-id i-0637ffb97ef7e8514 — device=/dev/sdf

Fdisk -l

fdisk /dev/xvdf # (name of storage )

mkfs.ext4 /dev/xvdf1

mount /dev/xvdf1 /var/www/html

3. Creating S3 bucket to store static object

aws s3api create-bucket — bucket adtsk-5 — region us-east-1

4. Creating cloud front

aws cloudfront create-distribution — origin-domain-name

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



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store