Production Static Hosting for Pennies: S3 + CloudFront with a GoDaddy Domain
This site is flat HTML/CSS/JS exported by Next.js and served from AWS. Here's the full production setup, including the GoDaddy DNS part most guides skip.
The architecture
GoDaddy DNS (CNAME) ──> CloudFront (TLS via ACM, global edge cache) │ Origin Access Control ▼ Private S3 bucket (static files, no public access)The bucket stays fully private; CloudFront reads it through Origin Access Control. Nobody bypasses your CDN, your cache hit ratio stays honest, and there's no "public S3 bucket" finding in your next audit.
Certificate first
CloudFront only accepts ACM certificates from us-east-1, regardless of where anything else lives:
aws acm request-certificate \ --domain-name mohammadwasim.com \ --subject-alternative-names www.mohammadwasim.com \ --validation-method DNS \ --region us-east-1ACM gives you a validation CNAME - add it in GoDaddy's DNS panel and the cert issues in minutes.
The GoDaddy wrinkle
GoDaddy doesn't support ALIAS/ANAME records at the zone apex, and a CNAME at the apex is invalid DNS. Two workable options:
- Use `www` as canonical - CNAME
wwwto the CloudFront domain, then use GoDaddy's forwarding to send the apex tohttps://www.This is the simplest path. - Move DNS to Route53 ($0.50/month) and keep the domain registered at GoDaddy - Route53 ALIAS records point the apex straight at CloudFront.
Deploying
Every deploy is two commands:
aws s3 sync ./out "s3://$BUCKET" --deleteaws cloudfront create-invalidation \ --distribution-id "$DISTRIBUTION_ID" --paths "/*"Set index.html as the default root object, and add a CloudFront Function to rewrite /blog/ style URIs to /blog/index.html for subdirectories.
The bill
S3 storage for a site this size rounds to zero. CloudFront's free tier covers 1 TB/month of egress. Realistic total: under $1/month, with global edge latency a $40/month VPS can't match. Serverless isn't always the answer - but for static sites, it's not close.