Create CloudFront Architecture with AWS CLI

Create CloudFront Architecture with AWS CLI

What is AWS ?
No alt text provided for this image

AWS is a Public-Cloud platform providing world-wide service and offer over 170 fully-featured services. It has millions of customers in the world and most recognized companies like NASA, Samsung, Uber, etc, are using AWS services. AWS has the largest community of customers and partners.

What is S3 ?
No alt text provided for this image

S3 is known as Simple Storage Service. it is a fully managed service offered by AWS. It is designed to make web-scale computing, especially for the developer. It is Global Service and it offers durability 99.999999999% and availability of 99.99%. It offers infinite storage(that simply means AWS provide storage according to your demand).

What is CDN ?

Content Delivery Network is referred to as a geographically distributed group of the server which helps in faster delivery of Internet content throughout the world. AWS offers CDN service as the name of CloudFront. AWS has connected all over the world through its own network which will help it deliver internet content all over the world. AWS has achieved CDN with the help of Edge-locations. AWS has 155 Edge locations all over the world.

Coming to the task ...!

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 a Content Delivery Network using CloudFront and using the origin domain as an S3 bucket. 

?Finally, place the Cloud Front URL on the web app code for security and low latency.

Now let's start the task and perform each step using CLI.

?? First, we have to launch the instance over the AWS and in that instance, we will configure our webserver and perform other processes.

No alt text provided for this image
aws ec2 run-instances --image-id { } --instances-type { } --count {} --subnet-id {} --security-group-ids {} --keyname {}

it's time to perform the first step - means configure the webserver.

To configure webserver we use "httpd" software. First, we install the software

yum install httpd -y
No alt text provided for this image

Then start the service of httpd.

systemctl start httpd

The next step would is to add the web pages, but before attaching the volume so that webpage becomes persistent.

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

Before proceed to step to we create one EBS volume and then we mount the root directory (/var/www/html) on the ebs volume. This volume we create because we want to store all my website pages in a separate volume so that due to any reason if my OS crashes, in that case, we do not lose the data.

No alt text provided for this image
aws ec2 create-volume --avalability-zone {} --size {}

Once you create the volume then attach with the Instances.

No alt text provided for this image
aws ec2 atatch-volume --device {} --instance-id {} --volume-id {}

Once it is attached, but cannot use it until you do not make a partition and format it.

No alt text provided for this image
fdisk {device name}
No alt text provided for this image
mkfs.ext4 {device name}

After format, mount root directory of httpd(/var/www/html) with the ebs volume .

No alt text provided for this image


This make /var/www/html made persistent.

Now we can proceed with making HTML pages for the website.

No alt text provided for this image
This is the code of the my html page.
No alt text provided for this image

Step3: Static objects used in code such as pictures stored in S3.

We generally put the static content in the S3. For this crate one S3 bucket and put the static content.

No alt text provided for this image
aws s3api create-bucket --bucket task6bucket --region ap-south-1 --create-bucket-configuration LocationConstraint=ap-south-1

Put the object in the S3 bucket

No alt text provided for this image
aws s3 cp {obejct name} s3://{bucketname} --acl public-read-write

acl refers to the Access Control List. acl is one of the resource-based access policy, that you can manage the bucket access.

STEP 4: Finally, place the Cloud Front URL on the web app code for security and low latency.

Now it's time to create Cloud Front in the AWS so that our content would reach each edge location spread all over the world.

No alt text provided for this image
aws cloudfront create-distribution --origin-domain-name {}

Now put the Cloudfront URL in the webpage code.

No alt text provided for this image

?

The Result of all the processes.

No alt text provided for this image

Hope you like the Article..????

Thank You & Have A Nice Day.

Rishabh .

AI/ML Engineer | Building Scalable Solutions with NLP, Computer Vision, and Advanced AI Systems

4 年

Nicely done ??

回复

要查看或添加评论,请登录

Ankit Kumar的更多文章

  • How Kubernetes Is Changing The Business ????

    How Kubernetes Is Changing The Business ????

    What is Kubernetes?? ???? Kubernetes is an open-source platform for managing containers. The product is created by…

    1 条评论
  • AWS Customer Success Story

    AWS Customer Success Story

    What is Cloud Computing? The company that provides their resources over the internet and charges according to the…

  • Big Data

    Big Data

    Today is the world of data and most of the big companies like Facebook, Google, Microsoft, Netflix, Amazon, etc are…

  • Flutter Music Player

    Flutter Music Player

    This article refers to the creation of a Music App with the use of one great Platform know as Flutter. There are many…

  • Integration of Ansible with Docker

    Integration of Ansible with Docker

    This is the first task of Ansible under Mr. Vimal Daga Sir.

    1 条评论
  • FLUTTER ENVIRONMENT SETUP

    FLUTTER ENVIRONMENT SETUP

    What is Flutter? Flutter is Google’s UI toolkit for building beautiful, natively compiled applications for mobile, web,…

  • AWS + KUBERNATES = AMAZON E

    AWS + KUBERNATES = AMAZON E

    Amazon Elastic Kubernetes Service (Amazon EKS) is a fully managed Kubernetes service. Amazon EKS automatically detects…

  • End to End INTEGRATION Of Docker, Jenkins, Github, Git, Redhat

    End to End INTEGRATION Of Docker, Jenkins, Github, Git, Redhat

    DevOps task2 Let us first understand what we are going to do in this task. Task description 1.

    2 条评论
  • TASK 1 COMPLETE INTEGRATION OF JENKINS WITH GITHUB

    TASK 1 COMPLETE INTEGRATION OF JENKINS WITH GITHUB

    Task Description TASK 1 JOB#1 If Developer push to dev branch then Jenkins will fetch from dev and deploy on the…

  • FACE RECOGNITION USING TRANSFER LEARNING

    FACE RECOGNITION USING TRANSFER LEARNING

    Task4 Create a project using transfer learning solving various problems like Face Recognition, Image Classification…

社区洞察

其他会员也浏览了