Skip to main content

Command Palette

Search for a command to run...

A Beginner's Guide to Amazon CloudFront : Key Features Explained

Updated
3 min read
T

Learning DevOps Engineer passionate about cloud computing, containerization, and automation. Currently exploring Docker, AWS, and CI/CD pipelines to build scalable and efficient workflows. Documenting my learning journey in blog. stay tuned with me for learning.

AWS CloudFront :

  • Content Delivery Network (CDN)

  • Improve read performance, content is cached at the edge.

  • Improves user experience.

  • 216 points of presence globally (edge location)

CloudFront - origins

  • S3 bucket .

  • For distributing files and caching them at the edge.

  • For uploading files to S3 through CloudFront.

  • Secured using origin access control (OAC)

VPC - origins

  • For application hosted in VPC private subnet.

  • Application load balancer / Network Load balancer.

Custom Origin (HTTP)

  • S3 website (must first enable the bucket as a static S3 website).

CloudFront vs S3 Cross Region Replication.

CloudFront :

  • Global Edge Network.

  • Great for static content that must be available everywhere.

S3 Cross Region Replication :

  • Must be setup for each region you want replication to happen.

  • Files are updated in near real-time.

  • Read only.

  • Great for dynamic content that needs to be available at low-latency in few regions.

If the content is already in the location with the lowest latency CloudFront delivers it immediately.

If the content is not in that edge location, CloudFront retrieves it form an origin that you’ve defined as an amazon S3 buckets, MediaPackage channel, or an HTTP server (for example, a web server ) that you have identified as the source for the definitive version of your content.

First we have to create S3 bucket and upload file.

  1. Log in to the AWS Management Console.

  2. S3 services.

  3. Bucket name: Must be globally unique.

  4. Region: Choose your desired AWS region.

  5. Object ownership - ACL disable

  6. Bucket Versioning - disable

  7. Create bucket.

How to upload file or folder

  1. Bucket

  2. Select Upload.

  3. Add file or Add folder

  4. upload.

  5. And allow object publicly accessible.

  6. Click on the object you want to make public.

  7. Select the “Permissions” tab.

  8. Click Edit

  9. I acknowledge that ACLs will be restored.

  10. Click Make public.

Create CloudFront Distribution

Search for CloudFront :

Click "Create Distribution"

  1. Distribution name : (Ex... DemoNewCloudFront).

  2. Distribution type :(Single website app).

  3. Domain name :
    CloudFront works without a custom domain using default distribution URL, but in production we attach a domain.

  4. Origin type : Amazon S3

S3 origin : (bucker name ).

  1. Create Distribution.

ON S3

Select Your Bucket

Go to Permissions Tab

Disable Block Public Access

  1. Open your bucket

  2. Go to Permissions

  3. Scroll → Block Public Access

  4. Click Edit

  5. Uncheck:

    • ✅ Block all public access
  6. Save → type confirm

ACL in S3

  • Click Permissions

  • Find “Access Control List (ACL)

  • Click Edit

  • Go to Object Ownership

  • Click Edit

  • Select:

    • ACLs enabled

  • Save changes

  • Full control (default) :

  • You can allow:

  • Read (⚠️ makes bucket public).

    Enable Static Website Hosting

    1. Go to Properties tab

    2. Scroll → Static website hosting

    3. Click Edit

    4. Select:

      • ✅ Enable
    5. Enter:

      • Index documentindex.html (your image name)

      • Error documenterror.html (optional)

    👉 Save changes

Access Your Website :