Demonstration study. This architecture is planned for a personal laboratory. It does not represent an AWS deployment that has already been validated.
Context and architectural decision
A blog with Markdown editorial content, no reader authentication, comments or transactional operations does not need to execute application code for each request. Separating content generation from distribution reduces the number of components that need continuous operation.
In this laboratory, Hugo generates static files, Pagefind generates the search index, Amazon S3 stores the artifacts, and Amazon CloudFront distributes the content. The planned primary region is us-east-1. Public access will use HTTPS on the default distribution hostname, initially without requiring a custom domain.
Responsibility boundaries
| Component | Responsibility | Proposed verification |
|---|---|---|
| Hugo and Pagefind | Site generation and search | Build and artifact validation |
| Amazon S3 | Object storage | Unauthorized direct access denied |
| Amazon CloudFront | HTTPS distribution and caching | Public access via the approved endpoint |
| Terraform | Infrastructure definition | Reviewed plan and controlled recreation |
The site does not require EC2 instances, a Kubernetes cluster, a database or a backend to meet the defined scope. These resources would make sense only if future requirements justified their adoption.
Private origin and explicit URLs
CloudFront should use the regular S3 bucket origin, not the website hosting endpoint. Origin Access Control (OAC) allows the requests sent by the distribution to S3 to be authenticated. The bucket policy should authorize the specific distribution while keeping direct public access blocked.1
Choosing addresses such as /artigos/arquitetura-estatica-s3-cloudfront.html enables the distribution to request the corresponding object key. The homepage uses index.html as the default root object, to be configured on the distribution. No additional function for rewriting every path is assumed. The English homepage explicitly uses /en/index.html for the same reason.
Handling missing objects also requires a real infrastructure test. The presence of 404.html in the artifact does not, by itself, turn private-origin responses into HTTP 404 responses.
Trade-offs and validation criteria
- Operations: managed services reduce server maintenance, but do not eliminate permissions, costs and release management.
- Cost: the target of up to US$10 per month is a laboratory constraint, not a measured or guaranteed cost.
- Reliability: publication must keep HTML, versioned CSS and the search index consistent with one another.
- Performance: caching must be planned by resource type; Core Web Vitals targets will be assessed separately from compilation.
Before considering the architecture validated, we will need to test HTTPS, denial of direct S3 access, navigation using explicit object paths, page removal and cache updates. At this stage, local tests verify only the website structure.
References
- Amazon CloudFront — restrict access to an S3 origin.
- AWS Well-Architected Framework.
- Hugo — official documentation.
OAC requires a compatible S3 origin and appropriate permissions configuration. Consult the official documentation before implementing the infrastructure. ↩︎