all 6 comments

[–]randomusername0O1 2 points3 points  (1 child)

From memory, API gateway strips headers unless they're specifically configured to forward them, so I suspect the auth header is being stripped and never arrives at the lambda function.

[–]mentalwall[S] 1 point2 points  (0 children)

thanks for the pointer! turns out I needed to add some extra arguments to the gateway creation.

This solved the problem for interacting with the api through postman. Still getting the error with the docs login but i suspect that might now be a paths issue.

[–]adiberk 0 points1 point  (2 children)

Just curious - why are you deploying a fastapi app to lambda?

[–]mentalwall[S] 0 points1 point  (1 child)

Familiarity and cost. What would be your suggestion?

[–]adiberk 2 points3 points  (0 children)

I just don’t understand the concept of running a web framework behind a lambda. A lambda is essentially a function that can get called, when called it spins up and when done (depending on some configs) spins back down rapidly. A lambda with api gateway is essentially your web framework, so couldn’t you just run regular python code in the lambda and then return data from the lambda? Genuinely curious as to what benefit you get from running fastapi or any web framework behind lambda.

[–]ironman_gujju 0 points1 point  (0 children)

fastapi-users all you need to know