I am currently writing a Python server to deploy on AWS Lambda. I want to use the firebase-admin package to send notifications with FCM and read data from cloud firestore. however when I try deploying my function to AWS Lambda with the .zip file archives, I get this error on execution:
[ERROR] Runtime.ImportModuleError: Unable to import module 'lambda_function': Failed to import the Cloud Firestore library for Python. Make sure to install the "google-cloud-firestore" module.
I installed the module with this: pip install --target . firebase-admin into a folder, added my code files (to the root as instructed), zipped it recursively and uploaded it with the aws-cli, I can clearly see that there is a google-cloud-firestore folder inside the .zip so i'm not sure whats going on. any help is appreciated!
From the look of it you have bundled your code correctly and deployed successfully. The error occurs because Firestore relies on a C-based implementation of GRPC. By default this does not work on AWS Lambda. I'm currently creating a work-around and will update this post with my results.
Firebase-Admin with AWS Lambda Python