Show HN: Deploy a Go Lambda to Ping a Site in 20 Seconds
github.com
github.com
Perhaps to be less wasteful, the HTTP request should be a HEAD instead of GET? There’s little point downloading a whole page if you are going to just throw away the contents...
For example; you would do a head request and node.js and php would still need to be configured to handled the HEAD request but instead of its handler returning "1" it would simply return.
1. Why go? (nothing wrong with it in itself, but last I had checked (before go on lambda was released)...Python was supposed the fastest of the bunch available)
1 a. Python can be embedded into a CF template...meaning deployment is slightly nicer (maybe not recommended though?)
2. I think the ability to change the time (20 secs) based on an SSM parameter would be cool!
2. Sorry, I include the "20 Seconds" as a symbol of how easy it is to deploy!
The URL is set in terraform.tfvars, which then gets passed to the lambda resource.
(1 month) / (5 minutes) = 8760
"$3.50 per million API calls received, plus the cost of data transfer out, in gigabytes." [0]
8760 * ($3.50 / 1000000) = $0.03.
https://github.com/nzoschke/gofaas
The guide on periodicnworker functions is how I would build this pinger.
https://github.com/nzoschke/gofaas/blob/master/docs/worker-f...
https://docs.aws.amazon.com/lambda/latest/dg/with-scheduled-...
I have a personal use case of this: pinging my heroku "dev" tier instance so it stays alive a bit longer.