Amit Bandarkar's · INFRASTRUCTURE

Deploying a static site on Amazon S3

A complete walkthrough for hosting staticsite.bandarkarami.com — from bucket creation to a CloudFront-fronted, SSL-secured domain on Route 53.

Regionap-south-1 (Mumbai)
Domainbandarkarami.com
StackS3 · CloudFront · ACM · Route 53
Amazon S3
Store static website files
CloudFront
CDN for global content delivery
Route 53
Domain and DNS management
ACM
SSL/TLS certificate management
IAM
Access control and permissions
01
Request path
Architecture diagram
Architecture diagram: Internet Users to Route 53 to CloudFront to S3 to HTML/CSS files
  • Internet users request the site by domain name.
  • Route 53 (DNS) resolves the domain to the CloudFront distribution.
  • CloudFront serves the cached response over SSL/TLS, pulling from the origin on a cache miss.
  • S3 static website acts as the origin, holding every asset.
  • The bucket stores the raw HTML, CSS, and other site files.
02
IAM
Permissions required
Amazon S3 Full Access
CloudFront Full Access
Route 53 Full Access
ACM Full Access
03
Walkthrough
Implementation
1
Create the bucket
AWS Console → S3 → Create Bucket
  • Bucket namestaticsite.bandarkarami.com
  • Regionap-south-1 (Mumbai)
S3 console showing general purpose buckets list with staticsite.bandarkarami.com
S3 → Buckets — staticsite.bandarkarami.com created in ap-south-1
2
Upload site files
Upload the site's contents into the bucket root
📄 index.html
📁 css/
📁 images/
S3 bucket object list showing css folder, explore.html, images folder, index.html
Bucket contents after upload
3
Enable static website hosting
S3 Bucket → Properties → Static website hosting
  • Static website hostingEnable
  • Index documentindex.html
Static website hosting settings with Enable selected and index.html as index document
Properties → Static website hosting → Enable
4
Configure the bucket policy
Permissions → Block public access → turn off
Block public access bucket settings with Block all public access set to Off
Block public access — set to Off
Public read access is required for visitors to load pages directly from the bucket. Scope the policy to GetObject only — never grant write or delete to the public.

Attach the following statement under Permissions → Bucket policy:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "PublicReadAccess",
      "Effect": "Allow",
      "Principal": "*",
      "Action": "s3:GetObject",
      "Resource": "arn:aws:s3:::staticsite.bandarkarami.com/*"
    }
  ]
}
S3 bucket policy editor showing the public read access JSON policy applied
Permissions → Bucket policy — applied
5
Create the SSL certificate
AWS Certificate Manager (ACM)
  1. Open ACM and request a certificate
    Navigate to Certificate Manager → Certificates and click Request.
    ACM Certificates list with Request button highlighted
  2. Choose a public certificate
    Select Request a public certificate, then Next.
    Request certificate screen with Request a public certificate selected
  3. Provide the domain name
    Enter the fully qualified domain name and keep the remaining settings at their defaults, then click Request.
    Domain names field with staticsite.bandarkarami.com entered, DNS validation selected
  4. Certificate issued
    Once DNS validation completes, the certificate status reads Issued.
    Certificate list showing staticsite.bandarkarami.com as Amazon Issued
6
Create the CloudFront distribution
CloudFront → Distributions → Create distribution
  1. Select plan and get started
    Choose the Free plan.
    • Distribution namestaticsite.bandarkarami.com
    • Distribution typeSingle website or app
    • Domainstaticsite.bandarkarami.com
    CloudFront distributions list with Create distribution button highlighted
  2. Specify origin
    Set Origin type to Amazon S3, then point the S3 origin field at the bucket: staticsite.bandarkarami.com.s3.<region>...
    Specify origin step with Amazon S3 origin type selected and S3 origin field filled
  3. Enable security
    Leave the included WAF protections at their defaults and click Next.
    Enable security step showing default WAF protections and Next button highlighted
  4. Get a TLS certificate
    Attach the certificate issued by ACM in the previous step.
  5. Review and create
    Confirm every setting, then click Create distribution.
    Create distribution review screen showing distribution name and Route 53 managed domain
7
Configure Route 53
Route 53 → Hosted zones → bandarkarami.com

Create the DNS records that point the subdomain at the CloudFront distribution:

  • Record typeA — alias to CloudFront
  • Record typeAAAA — alias to CloudFront
  • Record typeCNAME
04
Verification
Test the website
Live endpoint
https://staticsite.bandarkarami.com
Served via CloudFront · SSL/TLS active