Advantages:
- Cheaper than having your own micro.t1 server and setting crontab. - I have information about how much time it takes to actually run the script.
Findings:
- Test & debug: inside lambda only. Didn't like this, but for trivial stuff like mine it worked.
- "Crontab-like" granularity: you cannot trigger a lambda function every X seconds. The minumum is a cloudwatch periodical "cron-like" trigger.
- The script took much more execution time than I thought. It also required less memory, but this is not a problem ;-).
- Every line you print() to stdout goes to a Cloudwatch log. It's both helpful and something to care about because Cwatch is not free.
It may not be perfect for all uses, but for this little thing it works out really well.
(Aside: Yes,I could have used an off-the-shelf package like Nagios, or a SaaS monitoring service. I did this in part to learn Lambda anyway, and also because I like the idea of something I control and can customize myself, but which doesn't require maintaining a server, yadda-yadda.)
In addition, I've used it as the backend for an Alexa skill, which works quite nicely[1].
Lambdas are great for event-driven tasks and cronjobs though.
I'm struggling a bit to find event patterns that work in cloudwatch to trigger my lambda functions though. For instance when a volume becomes "available" I can't find an event pattern that triggers off of that, etc... If anyone has any tips or documentation you can point me to that would be awesome.
I’m just not sure I’d put it inline for anything life-critical just yet.
It may seem like nothing, but not knowing when the lambda context is going to recycle can also be a real pain in the ass.
Spins like a top and costs very little ro run.