Klayers
mangum
Klayers | mangum | |
---|---|---|
4 | 17 | |
1,969 | 1,601 | |
- | - | |
8.0 | 2.5 | |
5 days ago | 4 months ago | |
Python | Python | |
GNU General Public License v3.0 or later | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Klayers
-
Lambda with Python libraries
Use public layers maintained by others. For example Klayers which are produced with CI in GitHub Actions. This way you don't have any layers lying around in your Lambda UI. You can point to new layer versions whenever you wish. You can interact with the layer data via an API : https://github.com/keithrozario/Klayers/#api
-
AWS Serverless Menu - Small to Big
If I want to do something more data heavy or complex, I'll sometimes instead go for Python. Having a mixture of languages is one of the big advantages of micro services. Packaging dependencies is a bit tricker for Python, for simple packages I'll usually include in my build script something to copy the relevant directories from my venv's site-packages. However one neat alternative is to use a publicly available precompiled lambda layer from Klayers. These slot neatly in one line of code into my terraform config and enable me to use popular Python packages like numpy and pandas without troubling myself about C extensions, build environment or having to mess with Amazon Linux.
-
Serverless ETL using AWS Lambda, Pandas, PostgreSQL, AWS CDK
Before anything, Huge shoutout to Keith Rozario for providing us with this awesome Repo. where he defined layers for lambda functions to add libraries that doesn't exist by default in the lambda runtime without you having to create them yourself. I used his repo to add the requests, pandas and psycopg2 libraries to the project.
-
Can a lambda use a layer which is stored in S3
I like to use this guy’s layers as an arn: https://github.com/keithrozario/Klayers
mangum
- Why the Serverless Revolution Has Stalled
-
Is there any batteries-included framework designed specifically for serverless functions?(preferably Python)
Hey! I was in the same place as you are, and the best solution I found was to use Mangum (https://mangum.io/). I believe it also works with Django. Mangum is an adapter that transforms lambda events into the corresponding structure to be received by your Framework API endpoints. We are currently using it with FastAPI and it's great. We code our backend without thinking about whether it will run on Lambda, and Magum takes care of the rest.
-
Is it really advisable to try to run fastapi with predominantly sync routes in a real world application?
In the real world I'm never using static cloud resources. It's all serverless, containers, or horizontal auto-scaling. I let the infrastructure handle asynchronous scaling when needed. For FastAPI specifically I've used Mangum: https://mangum.io/ to provide the asynchronous invocation below the ASGI layer. Then all my FastAPI code can just be synchronous.
-
Options to host a ReactJS + FastAPI + SQLlite application?
I discovered https://github.com/jordaneremieff/mangum which basically transforms a fastapi app to be compatible with aws lambda.
-
Serverless Rest API : api gateway + lambda with RDS database
Should I create only 1 apigtw resource with 1 lambda and use mangum + fastapi for my rest api ?
-
Yet another implementation for Slack Commands
Mangum: For the integration of the Aws Lambda and the Api Gateway with the FastApi
-
AWS with a Django app
If you go the lambda route, you can use DRF (or any ASGI app) using https://mangum.io/
-
Running Containers on AWS Lambda
Yes, it's possible to wrap any asgi app to run in a lambda. Check out Mangum https://github.com/jordaneremieff/mangum
-
Observability Best Practices when running FastAPI in a Lambda
But we do not have a handler function, do we? We have a Mangum object wrapping the FastAPI application. Luckily, the Mangum object acts as a handler function, so we can just add the following in example/src/app/__init__.py:
-
Django Rest API with AWS lambda or any other server less
I've used fastapi in a lambda. The package Mangum simplifies the conversion of lambda handler to a more tradition request.
What are some alternatives?
configure-aws-credentials - Configure AWS credential environment variables for use in other GitHub Actions.
Zappa - Serverless Python
python-lambdarest - Flask like web framework for AWS Lambda
docker-flask-example - A production ready example Flask app that's using Docker and Docker Compose.
covid-19-data - A repository of data on coronavirus cases and deaths in the U.S.
aws-simple-websocket - Using AWS's API Gateway + Lambda to run a simple websocket application. For learning/testing.
Zappa - Serverless Python
fastapi - FastAPI framework, high performance, easy to learn, fast to code, ready for production
AWS Data Wrangler - pandas on AWS - Easy integration with Athena, Glue, Redshift, Timestream, Neptune, OpenSearch, QuickSight, Chime, CloudWatchLogs, DynamoDB, EMR, SecretManager, PostgreSQL, MySQL, SQLServer and S3 (Parquet, CSV, JSON and EXCEL).
fastapi-crudrouter - A dynamic FastAPI router that automatically creates CRUD routes for your models
serverless-etl-cdk - Deploy python code for ETL using the AWS CDK
chalice - Python Serverless Microframework for AWS