![](https://codelido.com/assets/files/2023-01-29/1674989668-281221-image.png)
Why
When
Where.
There are three words every person wants to know then they want to learn something new.
in order to this ,the basic content and the basic services the cloud practitioner comes to know is website hosting.
S3 is the simple storage service which is used to store our content.
ok,
then
what about cloud front?
A service called Amazon CloudFront speeds up the delivery to users of your static and dynamic web content, including html, css, js, and picture files. Edge locations are a global network of data centres that CloudFront uses to serve your content.
WHY:
Another service that is frequently used with S3 for distributing data digitally over the world is CloudFront. Amazon has a CDN called CloudFront that has edge servers all around the world.
With an average response time of 137ms per request, it’s almost twice as fast as loading directly from S3, and slightly faster than loading directly from the server.
WHEN?
We can use the cloud front when we want to host our application faster globally.
Simple steps to create cloud front distribution.
- log in to your AWS management console
- explore the service s3.
- create a bucket and add files to your bucket.
- add metadata
- enable static hosting and add your bucket policy.
- add enter and exit files of your applications in static enable.
- view your endpoint in properties.
- your application is ready.
CREATING DISTRIBUTION:
- Explore cloud front.
2.click create distribution.
3.ORIGIN DOMAIN NAME once you place the cursor in that you should see your available s3 buckets. and pick waht you want.
4.if it was not listed, type your bucket name which is ready for hosting.
5.click yes to restrict bucket access
6.origin access identity->create new.
7.for default cache behaviour:
8.undre view protocol policy->redirect http to https.
9.for cache based on selected request leave default
10.under default root object type in entry file.
11.logging setting set to off.
12.finally set distribution state ti enabled.
it will take time to create distribution.
after enable .
paste the distribution name.
you can see your web application.
RESTRICT OUR S3 bucket policy to cloud front.
in s3 bucket policy
click permissions in your bucket placed in s3.
WE CAN SEE THE CLOUD FRONT HAS ADDED WHAT WE CALLE AN ORIGIN ACCESS IDENTITY TO THE POLICY.
SO,
REMOVE THE PUBLIC S3 ACCESS SECTION SO IT LOOKS MORE LIKE.
NOW.
CLICK ON SAVE.
AND WAIT FOR DISTRIBUTION.
NOW THE DISTRIBUTION OS READY.
![](https://codelido.com/assets/files/2023-01-29/1674989435-332126-image.png)
![](https://codelido.com/assets/files/2023-01-29/1674989448-533750-image.png)
![](https://codelido.com/assets/files/2023-01-29/1674989459-759810-image.png)
![](https://codelido.com/assets/files/2023-01-29/1674989469-554585-image.png)
![](https://codelido.com/assets/files/2023-01-29/1674989478-716322-image.png)
![](https://codelido.com/assets/files/2023-01-29/1674989513-587621-image.png)
![](https://codelido.com/assets/files/2023-01-29/1674989530-711812-image.png)
![](https://codelido.com/assets/files/2023-01-29/1674989541-936417-image.png)
![](https://codelido.com/assets/files/2023-01-29/1674989550-376230-image.png)
![](https://codelido.com/assets/files/2023-01-29/1674989558-618151-image.png)
![](https://codelido.com/assets/files/2023-01-29/1674989567-784472-image.png)
![](https://codelido.com/assets/files/2023-01-29/1674989574-687831-image.png)
![](https://codelido.com/assets/files/2023-01-29/1674989582-280858-image.png)
![](https://codelido.com/assets/files/2023-01-29/1674989592-157661-image.png)
![](https://codelido.com/assets/files/2023-01-29/1674989598-689295-image.png)
![](https://codelido.com/assets/files/2023-01-29/1674989608-195092-image.png)
![](https://codelido.com/assets/files/2023-01-29/1674989618-594100-image.png)
Advantages:
Security. Protection against network and application layer attacks. …
Edge computing. CloudFront Functions. …
Real-time metrics and logging. Real-time metrics. …
DevOps friendly. Fast change propagation and invalidations. …
Cost-effective. Pricing options for every level of usage.
It provides high security with the ‘Content Privacy’ feature. It facilitates GEO targeting service for content delivery to specific end-users. It uses HTTP or HTTPS protocols for quick delivery of content. It is less expensive, as it only charges for the data transfer.
For all geographies tested, Amazon CloudFront delivered the 12KB objects to customer devices approximately 20 percent faster than the average latency across all CDNs tested. Figure 2: A lower time indicates faster performance in the chart below. Avg = 1.616 Sec.
REFER:https://www.linkedin.com/pulse/cloud-distribution-front-aws-lokesh-mara