Static hosting using S3

Introduction

In this article, we are going to get on about static file hosting in S3 also; let's see about its advantages. 

Architecture  

Architecture

Components Insight
 

Name What it does
Route 53 The name for our service (Route 53) comes from the fact that DNS servers respond to queries on port 53 and provide answers that route end users to your applications on the Internet.
Cloud Front The CloudFront edge locations will cache and deliver your content closer to your users to reduce latency and offload capacity from your origin.
TLS/SSL To access the website securely
S3 It's a public cloud storage container for objects stored. S3 buckets can be likened to file folders and object storage.


Configuration Steps

  1. S3
    1. First, create an S3 bucket; please ensure the bucket name is the same as the hosting name.
    2. Enable S3 to do static website hosting.
    3. Change "Block new public bucket policies", "Block public and cross-account access if the bucket has public policies", and "Block new public ACLs and uploading public objects" to false and save.
    4. Update the bucket policy with permission accordingly.
  2. Route 53 DNS 
    1. To invoke the S3 content, we have to map between our domain name and vs S3 link.
    2. This mapping could be done using the CNAME record inside DNS.
  3. Cloud Front
    1. The cloud front is introduced here to avoid latency issues. 
    2. It will cache the request and distribute it based on the edge location.
  4. Files Uploading
    1. Please navigate into the S3 upload section; please drag and drop or add files in the S3 bucket.
    2. This bucket supposes to have default permission options.

Advantages

  • No maintenance since we are not deploying these static files in the web server. 
  • Lower cost on hosting, since it just takes standard S3 price  
  • high availability and durable service

Conclusion 

static file hosting in S3 offers several advantages. By leveraging Route 53, CloudFront, and TLS/SSL, it ensures efficient content delivery, reduced latency, and secure access. The configuration steps involve creating an S3 bucket, enabling static website hosting, updating permissions, and mapping the domain with Route 53 DNS. With no maintenance required and lower hosting costs than web servers, S3 provides a highly available and durable service for static file hosting.


Similar Articles