🔰 HIGH AVAILABILITY ARCHITECTURE WITH AWS CLI 🔰
Hello connections........!!!!
Presenting my new article on High Availability Architecture with AWS CLI. The architecture includes:
🔅 Web server 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 CloudFront URL on the webapp code for security and low latency.
Cloudfront -
Cloudfront is a CDN (Content Delivery Network). It retrieves data from Amazon S3 bucket and distributes it to multiple data center locations. It delivers the data through a network of data centers called edge locations. The nearest edge location is routed when the user requests for data, resulting in lowest latency, low network traffic, fast access to data, etc.
Configuring Web server On AWS
- Create and launch web server on AWS
2. Now configure the web server on your instance
3. Now we need to add the rules for firewall to access our web server. The port number used for HTTP is 80 shown as follows:
4. Now try to access your web server:
Now we know that if our OS corrupts somehow then data present on our web server also gets corrupt. So to resolve this issue we can keep our data in EBS VOLUME instead of "root" directory.
5. Create an EBS Volume having partitions and then mount is to our folder containing html file.
- Creating a partition in attached EBS
- Format the created partition
- Mount the partition to folder containing .html file
- The .html file contains:
Now one thing to note is that the durability and availability of EBS is less and hence data can be lost. That means the static data such as pictures, PDF etc will be lost. So to resolve this we use the storage having high durability and availability of data - S3 Bucket.
6. Create a S3 Bucket and add your data in it.
aws s3api create-bucket --bucket awsbucketforweb--region ap-south-1 --create-bucket-configuration LocationConstraint=ap-south-1
and make it public.
- Now add this link of S3 bucket in your .html code as shown:
7. Now finally create a Cloudfront distribution
Our cloud front is successful created.
Let’s open the web Server :
Finally our all steps are done, remaining one step is we have insert this cloud front url in our web page and open our page in the browser.
Now our web page is created successfully using cloudfront.
Hope you liked it...😊
Thank You!!✌