joeirimpan / listmonk-messenger

Lightweight HTTP server to handle webhooks from listmonk and forward it to different messengers.
MIT License
53 stars 10 forks source link

AWS Lambda Build #8

Open rallisf1 opened 1 year ago

rallisf1 commented 1 year ago

I think it would make better sense for this package to use AWS Lambda, maybe create a new branch for it? You only need to swap the http server block and response functions with the lambda events.

If you are not familiar with it here's a nice example I found: https://dev.to/preethamsathyamurthy/serverless-golang-rest-api-with-aws-lambda-4cn6

P.S. I'd do it myself but I'm swamped and already run a few EC2 instances that I just added this on.

joeirimpan commented 1 year ago

@rallisf1 I don't think this package should move from a HTTP server to lambda events. If possible, you could add it in such a way that it is configurable to use http server / aws lambda events.

rallisf1 commented 1 year ago

@joeirimpan completely removing the http server would be a mistake; that's why I suggested another branch. Proxies to AWS services fit like a glove to Lambda though and it is more generous than EC2 Free Tier.

joeirimpan commented 1 year ago

Like i said earlier, you can make it configurable also. If a specific config is enabled, use lamdba otherwise create http server. That way, this feature can co-exist with current one.

symroe commented 1 year ago

FWIW, this makes running Docker images that communicate over HTTP trivial to host on AWS Lambda:

https://github.com/awslabs/aws-lambda-web-adapter

Simply add

COPY --from=public.ecr.aws/awsguru/aws-lambda-adapter:0.7.0 /lambda-adapter /opt/extensions/lambda-adapter

to the top of the Dockerfile