Thanks for your question Faraj.
Using AWS Lambda + API Gateway for creating an API service is a valid approach, but it has drawbacks like managing multiple Lambda functions to handle different API requests. Once the number of API routes and methods scale up, the large number of Lambda functions become unmanageable. The API design (i.e., routes and methods) is embedded in API Gateway, if one does not use AWS, updating the API design is difficult.
FastAPI addresses these issues by centralizing API source code and takes over the API design responsibility. It simplifying Lambda configuration as only one Lambda is needed to run the FastAPI app, this code will have all the API routes and methods, while for API Gateway only one route and one integration is needed. We can select "ANY" method and send it to lambda. Hence. all the other API design details are delegated to FastAPI.
Another benefit of FastAPI is that if one decides that Lambda is no longer a suitable way to deploy the API service, the source code can be easily re-packaged and re-deployed elsewhere (e.g., EC2, ECS etc.) without much modification.
Hence, FastAPI inclusion offers flexibility in the API design.
Hope it answers your question.