This project experiments with setting up infrastructure (via terraform
/OpenTofu
) to serve a speed test via a CDN and collect the speed measurement data.
This repo's speedtest is currently served here.
To follow these instructions, you will need to have:
- either
terraform
orOpenTofu
(an open-license fork ofterraform
) installed, - the AWS CLI installed and configured with credentials, and
make
(you can get by without this, but you'll have to adapt theMakefile
recipes to your context)
Create a file in /infra/
named secrets.tfvars
and fill in the following variables for your situation.
aws_region = "us-east-2"
domain_name = "SampleWebsiteDomainName"
tld = "com"
website_bucket_name = "bucket-for-your-website-files"
data_bucket_name = "bucket-for-your-speedtest-data"
Note: you'll have to own the domain_name
in the indicated top level domain (tld
), and this project assumes that domain is registered through AWS's domain registry Route 53
.
Run make package
to prepare the zipped up lambda_func zip archive.
Run make plan
to plan out tofu resources.
Run make apply
to apply the plan and create the resources.
Run make deploy-static
to push the site files up into the website_bucket
.