top | item 25701043

(no title)

gwph | 5 years ago

https://lofichess.com

I wanted a trimmed down interface for following live chess streams. To keep the website updated I run an AWS Lambda every two minutes that does the following:

1. Pulls active streams from the Twitch API.

2. Uses the Go templates library to repackage the response as static HTML.

3. Uploads the static HTML to S3, where it is served behind CloudFront.

discuss

order

woutr_be|5 years ago

Interesting approach to generate a static website. Is this completely free? Or do you end up paying for the Lambda task?

gwph|5 years ago

Average latency for the Lambda over the last week is 4.84s and it runs with 128mb of memory. Running every two minutes, that comes to ~25,000 invocations and ~15,000 GB-seconds of compute time per month. The AWS Lambda free usage tier includes 1M free requests per month and 400,000 GB-seconds of compute time per month so the Lambda is definitely free.

The website is tiny (homepage < 20kb excluding the thumbnails which are hosted by Twitch), so I'm also inside the free tier on S3 and CloudFront. I paid $12 upfront for the domain registration.