AWS Lambda to Amazon Comprehend using REST API

Amazon API Gateway → AWS Lambda → Amazon Comprehend

REST API backed by a Lambda function that invokes the Comprehend DetectSentiment API.

This sample project deploys an Amazon API Gateway REST API with an AWS Lambda integration.
The Lambda function is written in Python, calls the Amazon Comprehend DetectSentiment API, and returns a response containing the detected sentiment.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/apigw-lambda-comprehend-sam

Deploy

sam deploy --guided


Testing

See the GitHub repo for detailed testing instructions.

Cleanup

Delete the stack: sam delete.

Created by:

Pascal Vogel

Pascal Vogel

Pascal Vogel is a Solutions Architect at Amazon Web Services (AWS).

Diana Cheng

Diana Cheng

Diana Cheng is a Senior Solutions Architect at Amazon Web Services (AWS).