Amazon Web Services
Building a serverless website with S3

What is S3: Simple Storage Solution
Amazon S3 is a cloud based storage solution that gives its users the ability to have a highly-scalable, reliable, and low-latency data storage infrastructure at very low costs.
S3 Overview
Simple Storage Service: A safe place to store your files.
- Object based storage: Users can store flat files like word documents, videos, photos, PDFs, etc.
- Files can be from 0 bytes to 5TB in size with unlimited storage
- Files stored in Buckets (Buckets are just Folders) that must be unique globally
- Read after Write Consistency for new objects and Eventual Consistency for overwrites and deletes
- Amazon offers 99.99% Availability and 99.99999999% Durability Guarantee
Running a Serverless Website
Static websites can run on S3 without a server. A static site displays fixed content in HTML to all visitors without writing to a backend or requiring database deployment.
Steps To Build
- Go to S3 inside AWS Services
- Create a new bucket with a globally unique name
- Set permissions to grant public read access
- Go to bucket properties and select static web hosting
- Enter the name of your index document (e.g., index.html)
- Enter the name of your error/404 page
- Upload all HTML, CSS, and JS files to the bucket
- Set permissions to grant public read access on upload
- Get your endpoint URL inside static web hosting properties
- Your static application is live!
AWS Lambda
AWS Lambda is an event-driven, serverless computing platform that runs code in response to events. You pay only for compute time consumed.
Conclusion
S3 offers an inexpensive way to deploy static websites. The setup requires only one AWS resource instead of multiple components like computing instances and security groups.
Amazon Web ServicesAWSS3Serverless