listmonk-messenger
listmonk-messenger copied to clipboard
AWS Lambda Build
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 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 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.
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.
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