This code provisions an AWS API Gateway- and Lambda-based website, and uses DynamoDB to store the hit counter. All infrastructure is "serverless" and pay per usage so there aren't any persistent servers. The project is defined in TypeScript infrastructure as code so that it's easy to spin up and tear down environments without manual steps.
Here is a live instance: https://nltg0oruy1.execute-api.us-west-2.amazonaws.com/stage/
To get it up and running:
- Clone the repo and
cd
into it - Install Pulumi
- Run
pulumi stack init
to create a new stack - Run
pulumi config set aws:region us-west-2
to initialize the region (feel free to choose an alternate) - Run
pulumi up
- Now the website is running, visit it by going to the URL printed by
pulumi stack output url