How to deploy backend to AWS Lambda #2920
-
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 Has anyone else tried something like this? |
Beta Was this translation helpful? Give feedback.
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.
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.