Retrieve lambda event object on FastAPI
See original GitHub issueI use mangum with FastAPI.
Also, I often create an app which authenticates the request by Cognito
I want to obtain a few Cognito
information(eg: cognitoIdentityPoolId
) from lambda event
because I must use the information for business logic on API.
(https://docs.aws.amazon.com/lambda/latest/dg/with-on-demand-https.html)
Unfortunately, Mangum doesn’t pass the raw lambda event object to a function(controller). Is there a way to retrieve an event object of lambda? Or, Could you please implement it? Btw, I don’t know how to pass it to a function 😕
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Python FastAPI and AWS Lambda Container - Medium
To test the Lambda, you have to send to RIE a Lambda event. The event will be forwarded to the Lambda handler which...
Read more >Observability Best Practices when running FastAPI in a Lambda
In this post, we will be looking at instrumenting logging, metrics, and tracing capabilities for a FastAPI application using AWS Lambda ...
Read more >Simple Serverless FastAPI with AWS Lambda - deadbearcode
Click the Test button at the top of the dashboard and the select the Event Template dropdown and search for API Gateway Proxy....
Read more >Migrating AWS Lamda + APIs to FastAPI + Mangum
My current Lambda function (main.py) is set up like this: # Lambda handler def handler(event, context): # if REST call if event. get('routeKey' ......
Read more >Unable to determine handler from trigger event - AWS re:Post
To warm up Lambda function , I created a rule with schedule of 1 min with JSON text { "hello": "test"} with my...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@koxudaxi I’ve merged the changes into master. Here is an example of how you can access the event and context using FastAPI:
@erichonkanen yeah, there is definitely some work needed on the docs. There is an open issue for documentation generally https://github.com/erm/mangum/issues/48.
I’ll try to get to it at some point, but open to PRs as well. 😃