How it works

Serving the page

  1. Browservisitor
  2. Route 53DNS
  3. CloudFrontCDN + HTTPS
  4. S3private bucket

Counting visitors

  1. Page JavaScriptfetch on load
  2. API Gatewaythrottled REST API
  3. LambdaPython
  4. DynamoDBatomic counter

Deploying changes

  1. git pushto main
  2. GitHub ActionsOIDC, no stored keys
  3. S3 syncupload changes
  4. CloudFrontcache invalidation

Highlights

  • Private by default. The S3 bucket blocks public access; only this CloudFront distribution can read it.
  • Locked-down API. CORS allows only this domain, and API Gateway rate-limits requests.
  • Accurate counting. DynamoDB updates the count atomically, so simultaneous visitors are never lost.
  • Keyless CI/CD. GitHub Actions gets short-lived AWS credentials through OIDC, limited to this repository.
  • Cost guardrail. An AWS Budget alert fires if spending passes $10 a month.

Want the details?

The GitHub repository has the full write-up: architecture, security decisions, the deployment pipeline, and the lessons I learned along the way.

View the repository on GitHub