In Depth Guide to Serverless APIs with AWS Lambda and AWS API Gateway (Part 1)
Blog post from Moesif
The article explores the construction of a serverless API utilizing AWS Lambda and API Gateway, emphasizing the advantages of serverless technology such as on-demand pricing, auto-scaling, and reduced operational overhead. It outlines the process of building a RESTful image tagging API that uploads images, tags them using a third-party API called Clarifai, and stores the data in Elasticsearch. The setup involves using API Gateway for RESTful API optimization and Amazon Cognito for authentication, while AWS Lambda handles the computing tasks triggered by events. Images are stored in Amazon S3, and despite Elasticsearch not being serverless, it provides a free tier for initial use. The infrastructure is managed using AWS SAM, simplifying the setup of AWS resources, and the development environment is established with AWS Cloud9. The article delves into creating a basic serverless API with AWS SAM, API Gateway, and Cognito, detailing the steps for implementing authentication and handling HTTP requests, including accessing request bodies and setting response headers. The article is the first part of a two-part series, with the second part focusing on additional Lambda functions for API interaction.