How to deploy backend to AWS Lambda #2920
hragbalian
announced in
Q&A
Replies: 1 comment 1 reply
-
The backend uses websockets, so I'm not sure if it will work on AWS Lambda. Reflex can work with a basic REST protocol rather than websockets, we could potentially look into enabling that, but not sure if anyone's deployed on Lambda yet. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there,
I'd like to deploy the backend service to AWS Lambda with an ECR / image deployment. I was thinking this would be pretty straightforward since the backend is using FastAPI which works really well with Mangum as a standalone API. I'm finding that it's not plug and play, unfortunately.
The closest I got is this:
and then calling the Lambda handler from the Dockerfile as
using the example todo app.
This is producing the following error:
LAMBDA_WARNING: Unhandled exception. The most likely cause is an issue in the function code. However, in rare cases, a Lambda runtime update can cause unexpected function behavior. For functions using managed runtimes, runtime updates can be triggered by a function change, or can be applied automatically. To determine if the runtime has been updated, check the runtime version in the INIT_START log entry. If this error correlates with a change in the runtime version, you may be able to mitigate this error by temporarily rolling back to the previous runtime version. For more information, see https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html
[ERROR] TypeError: App.call() takes 1 positional argument but 3 were given
Traceback (most recent call last):
File "/var/lang/lib/python3.11/site-packages/awslambdaric/bootstrap.py", line 188, in handle_event_request
response = request_handler(event, lambda_context)
Has anyone else tried something like this?
Beta Was this translation helpful? Give feedback.
All reactions