protoncr / tourmaline

Simple Telegram bot library for Crystal
https://tourmaline.dev
MIT License
158 stars 38 forks source link

How to run a bot on aws lambda #36

Closed razorinc closed 2 years ago

razorinc commented 3 years ago

Hi @watzon and team,

As per $subject, do you have any hints if I would like to run this bot on aws lambda environment ? You think is feasible?

watzon commented 3 years ago

AWS lambda can work with a container image, so I would assume it's feasible. As to how reliable/worth it that would be, I just don't know. I have limited experience with FaaS. If you are able to figure it out though I would be happy to allocate space in the docs for your process so others can have an easier time of it.

razorinc commented 3 years ago

@watzon Awesome, I'll try to investigate/figure it out, and add here in this issue if that's ok for you.

watzon commented 3 years ago

Good with me 👍🏻

watzon commented 2 years ago

Having learned a bit more about Lambda for my job I may look into writing some documentation for this. As far as I can tell Lambda isn't super well suited to bots that are going to be running constantly, as its use case is more geared towards single incoming requests and the charges really build up quickly if you have a lambda that's constantly running.

However, using webhooks with lambda and the API gateway might be possible if you were to follow this article, so I'll definitely explore that. For bots that aren't used super often it could be a really cost effective way to run a bot.