API Service with FastAPI + AWS Lambda + API Gateway and Make It Work
<p>The goal of this article is to show one way to create a FastAPI app, deploy it to AWS Lambda via a Docker Container, trigger it with API Gateway, and basically just make it work. Combined together, the FastAPI + AWS Lambda + API Gateway setup allows one to quickly spin up a maintainable and scalable API service.</p>
<h1>Who is The Target Audience?</h1>
<p>This article will focus on the design choices of FastAPI, the procedures of deployment (exclusively via AWS CLI), and the explanation of a few gotchas. It will NOT dive deep into each technology. Thus, it is assumed that the target audience has already had a hands-on understanding of FastAPI, Docker, AWS ECR, AWS Lambda, and API Gateway.</p>
<h1>Why FastAPI + AWS Lambda + API Gateway?</h1>
<p>From my prior experience, AWS Lambda + API Gateway is sufficient to create an API service, in which AWS Lambda handles all the execution of API requests and API Gateway controls the HTTP methods, routes, authentication, traffic, and more. This is a valid approach, but it has two main drawbacks.</p>
<p><a href="https://fanchenbao.medium.com/api-service-with-fastapi-aws-lambda-api-gateway-and-make-it-work-c20edcf77bff"><strong>Read More</strong></a></p>