listmonk-messenger icon indicating copy to clipboard operation
listmonk-messenger copied to clipboard

AWS Lambda Build

Open rallisf1 opened this issue 1 year ago • 4 comments

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.

rallisf1 avatar Mar 14 '23 09:03 rallisf1

@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.

joeirimpan avatar Mar 14 '23 09:03 joeirimpan

@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.

rallisf1 avatar Mar 14 '23 09:03 rallisf1

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.

joeirimpan avatar Mar 14 '23 10:03 joeirimpan

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

symroe avatar Aug 25 '23 08:08 symroe