AWS Hosting Decision
Three options, compared
A side-by-side cost and tradeoff comparison for hosting APICODE.IO on AWS — and the option we recommend shipping on.
Recommended
Option
S3 + CloudFront + Route 53
Static export served from S3 behind CloudFront, with Route 53 for apicode.io and ACM for TLS.
Estimated
$0.50 – $3.00/ month
Pros
- Lowest steady-state cost — CloudFront free tier covers most personal sites.
- Edge cached globally with HTTPS by default and HTTP/3 support.
- No servers to patch; deployments are an S3 sync + CloudFront invalidation.
- Works perfectly with the Next.js static export we already build.
- Simple to layer on Lambda@Edge later for redirects, security headers, or A/B tests.
Cons
- Cache invalidations cost a small amount once you exceed 1,000/month.
- Need to design 404/403 routing rules carefully (handled in IaC).
Pricing notes
- CloudFront free tier (perpetual): 1 TB egress and 10M HTTPS requests / month.
- S3 storage at ~5 MB → < $0.01/month.
- Route 53 hosted zone for apicode.io: $0.50/month.
- ACM certificate for CloudFront: free.
Option
AWS Amplify Hosting
Git-based hosting service with managed builds, atomic deploys, and built-in TLS / custom domain.
Estimated
$0.65 – $5.00/ month
Pros
- Fastest to set up: connect a Git repo and Amplify handles build + deploy + cert.
- Atomic deploys with instant rollback.
- Integrated preview environments per branch.
Cons
- Outbound bandwidth is metered: $0.15 per GB after the (small) free tier.
- Build minutes meter once you exceed the monthly free allowance.
- Less control over caching headers and Lambda@Edge logic compared to raw CloudFront.
Pricing notes
- Amplify Hosting pricing: $0.023/GB stored, $0.15/GB served, $0.01/build minute.
- Includes 1,000 free build minutes/month and 5 GB stored / 15 GB served on the free tier (12 months).
- Plus a Route 53 hosted zone if using a custom domain ($0.50/month).
Option
Lambda + API Gateway (or Function URL)
Server-side rendered Next.js running in Lambda, fronted by API Gateway or a Function URL, optionally with CloudFront.
Estimated
$3.00 – $20.00/ month
Pros
- Useful if/when the site needs server-side rendering, auth, or per-request logic.
- Pay-per-use pricing scales to zero between requests.
Cons
- Operationally heavier for a content site: deploy package, cold starts, request budgets.
- You still want CloudFront in front of it — so this is on top of the CDN cost, not instead of it.
- Higher per-request cost vs. cached CDN responses.
Pricing notes
- Lambda: $0.20 per 1M requests + $0.0000166667 per GB-second (US East, x86, Tier 1).
- API Gateway HTTP API: $1.00 per 1M requests for first 300M/month.
- Recommended only when the workload needs SSR, ISR with secrets, or per-request auth.
Cost scenarios
Estimates assume US East (N. Virginia), public traffic only, and a static-export-friendly architecture. Domain registration is excluded.
| Scenario | Visits / month | Egress (GB) | S3 + CloudFront | Amplify | Lambda + API GW |
|---|---|---|---|---|---|
Personal / portfolio (today) CloudFront free tier easily covers this; cost is dominated by the Route 53 hosted zone. | 5k – 10k | 1 | ~$0.50 – $1.00 | ~$0.65 – $1.00 | ~$1.50 – $3.00 |
Indexed and shared (year 1) Still inside CloudFront free tier; Amplify starts to meter egress; Lambda starts to add up. | 50k – 100k | 10 | ~$0.75 – $2.00 | ~$2.00 – $4.00 | ~$3.00 – $7.00 |
Goes viral on a post (peak) CloudFront still mostly inside the free tier; Amplify and Lambda meter aggressively. | 500k – 1M | 50 | ~$2.50 – $6.00 | ~$8.00 – $20.00 | ~$15.00 – $40.00 |
Recommendation
Ship on S3 + CloudFront + Route 53
Target steady-state: $0.50 – $3.00 per month, dominated by the Route 53 hosted zone.
- APICODE.IO is a content + interactive site — Next.js can produce a static export with no server-side runtime requirements.
- CloudFront free tier (1 TB egress / 10M HTTPS requests per month) covers expected traffic for years.
- Lambda only adds value if we need SSR or per-request logic; that decision can be deferred and added at the edge with Lambda@Edge later without re-architecting.
- Operations are minimal: an S3 sync + CloudFront invalidation, gated by GitHub Actions.