View a markdown version of this page

Tutorial: Using Lambda with API Gateway - AWS Lambda

Tutorial: Using Lambda with API Gateway

In this tutorial, you create a REST API through which you invoke a Lambda function using an HTTP request. Your Lambda function performs create, read, update, and delete (CRUD) operations on a DynamoDB table. This function is provided here for demonstration, but you learn to configure an API Gateway REST API that can invoke any Lambda function.

Services and resources used in this tutorial.

Using API Gateway provides users with a secure HTTP endpoint to invoke your Lambda function and can help manage large volumes of calls to your function by throttling traffic and automatically validating and authorizing API calls. API Gateway also provides flexible security controls using AWS Identity and Access Management (IAM) and Amazon Cognito. This is useful for use cases where advance authorization is required for calls to your application.

Tip

Lambda offers two ways to invoke your function through an HTTP endpoint: API Gateway and Lambda function URLs. If you're not sure which is the best method for your use case, see Select a method to invoke your Lambda function using an HTTP request.

To complete this tutorial, you go through the following stages:

  1. Create and configure a Lambda function in Python or Node.js to perform operations on a DynamoDB table.

  2. Create a REST API in API Gateway to connect to your Lambda function.