A simple static website hosted on AWS using SST, serving a random number on each page load.
The site demonstrates deploying a static HTML file to AWS S3 and distributing it via CloudFront.
This project deploys infrastructure to your AWS account.
You are fully responsible for any costs incurred.
Please review all AWS resources created by this project before deploying. Running services like S3, CloudFront, or other AWS components may result in ongoing charges, especially if deployed in a production stage or left running.
The author of this repository does not take responsibility for any unexpected charges or misuse.
To avoid ongoing costs, make sure to remove all deployed resources using:
npx sst remove --stage production
- 🛠️ SST (Serverless Stack)
- 🗂️ AWS S3 (Static site hosting)
- 🌐 AWS CloudFront (CDN)
- 🧾 Static HTML (with inline JavaScript and inline CSS for simple use case)
- SST (latest)
- Deploys a static HTML site to AWS S3
- Distributes content globally with CloudFront
- Displays a random number on each page load
- Simple, minimal configuration
- Clone the repository:
git clone https://github.com/krondorl/aws-static-random.git cd aws-static-random
- Install dependencies:
npm install
Please read these on how to set up user and CLI:
- SST AWS Static Site Example
- SST Static Site Docs
- SST Guide: Configure the AWS CLI
- SST Guide: Create an IAM User
- SST IAM Credentials
- Start local development server:
npm run dev
- Deploy to AWS:
npx sst deploy
- Remove from AWS:
npx sst remove --stage production
- These are the commands you need to use the program.
- Please learn what each does, before using them.
npm i
aws --version
aws configure
npx sst dev
npx sst deploy --stage production
npx sst remove --stage production
When deploying your static site with SST, the process includes:
- Uploading files to Amazon S3
- Creating or updating a CloudFront distribution
This full setup generally takes 8–9 minutes. Most of the time is spent waiting for CloudFront to propagate updates globally. No need to worry — this is normal for first-time or updated deployments.
When you are finished testing the live production website, use the remove script. This way there are (probably) no costs on AWS.
✅ After deletion, double-check:
To confirm everything is gone and you're not billed:
- Go to S3 Console – make sure the bucket is gone.
- Go to CloudFront Console – check for no distributions.
- Go to CloudFormation Console – confirm no active stacks.
- Check Billing → Cost Explorer in AWS Console.
See LICENSE file.
- 2025-07-09: Documentation and upload to GitHub.
- 2025-07-08: First working version.