Static Website

website screenshot

Summary

This website is hosted as a static website in an Amazon S3 bucket and published via an Amazon CloudFront distribution. The domain name is managed by Amazon Route 53 with SSL certificate issued by AWS Certificate Manager. Deployment of the website code to Amazon S3 and distribution via Amazon CloudFront is managed from a GitHub repository using GitHub Actions.

Architecture

website architecture

Services

Service Description Cost
Amazon Route 53 Amazon Route 53 is a highly available and scalable Domain Name System (DNS) web service.

Domain Registration: $9/year

Hosted Zone: $0.50/month

Amazon Simple Storage Service (S3) Amazon S3 is a highly available object storage service. $0.01/month
Amazon CloudFront Amazon CloudFront speeds up distribution of static and dynamic web content. When users request your content, CloudFront delivers it through a worldwide network of edge locations that provide low latency and high performance. Free
AWS Certification Manager AWS Certificate Manager (ACM) helps you to provision, manage, and renew publicly trusted TLS/SSL certificates on AWS-based websites. Free
Total $1.26/month

Description

When a user asks their browser to access the site, the browser requests the website code using the website URL.

Amazon Route 53 checks the best route for the request and gets the data from the edge location and returns it to the browser. The website domain was registered in Route 53.

Amazon Cloudfront caches the website code from Amazon S3 and supplies it to the relevant edge location. This data is secured using an SSL certificate supplied by Amazon Certificate manager.

The original website files are stored in an S3 bucket with the same name as the website URL. When the developer needs to update the files, he commits the new code to a GitHub repository. This triggers a GitHub Actions workflow that uploads the new files to the S3 bucket and invalidates the CloudFront distribution to clear the cache of the obsolete files. Any new request for the website files causes the cache to be populated with the new code.

Conclusion

AWS provides a secure, available service to host static websites like this one. The use of GitHub actions automates the deployment of the website files to update the hosted code. This solution is cheaper than hosting the website with a conventional host.