High Availability Architecture with AWS CLI

Himanshu Agrawal

--

Task Description📄

🔰 Create High Availability Architecture with AWS CLI 🔰

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

Amazon S3 Bucket:-
Amazon S3 has various features you can use to organize and manage your data in ways that support specific use cases, enable cost efficiencies, enforce security, and meet compliance requirements. Data is stored as objects within resources called “buckets”, and a single object can be up to 5 terabytes in size.

Amazon CloudFront Distribution:-
* Amazon CloudFront is a content delivery network offered by Amazon Web Services. Content delivery networks provide a globally-distributed network of proxy servers which cache content, such as web videos or other bulky media, more locally to consumers, thus improving access speed for downloading the content.

* AWS Cloudfront service provides a private network to transfer data files & Edge location to store local caches temporary ( For some time period only ).

> For this task I have already explained first 2 steps in another article. Visit this article for first 2Steps — ( Step — 1 , Step — 2 )

Create S3 Storage , Upload a image & Give Public Permission so , WebPage which is created in previous step , can use this image -

-> create s3bucket
# aws s3api create-bucket — bucket my-himanshu-bucket-123-arth — region ap-south-1 — create-bucket-configuration LocationConstraint=ap-south-1

-> upload object
# aws s3 cp /root/IMG_6248.JPG s3://my-himanshu-bucket-123-arth/ — acl public-read

Setting up Content Delivery Network using CloudFront and using the origin domain as S3 bucket -
-> Create Cloudfront Distribution
# aws cloudfront create-distribution — origin-domain-name my-himanshu-bucket-123-arth.s3.ap-south-1.amazonaws.com — default-root-object IMG_6248.JPG

"Location”: “https://cloudfront.amazonaws.com/2020-05-31/distribution/E3OXYI5SEN23R3",
Image URL is
“d3ar3yaxk5qf76.cloudfront.net”

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

<H1> Hello World </H1><Br>
This is my first page<Br>
<img src=’https://d3ar3yaxk5qf76.cloudfront.net’>

— — — — — — — — — — — — — Thank you — — — — — — — — — — — — —

--

--

No responses yet