Amazon API Gateway to AWS Lambda with observability

API Gateway → AWS Lambda

Create an API with metrics, alerts, traces, logs, and dashboard.

This pattern deploys Amazon API Gateway HTTP API with a single route that is integrated with and AWS Lambda function written in Node.js. The pattern uses Amazon CloudWatch Logs, metrics, alerts, dashboards, Embedded Metrics Format, AWS X-Ray, Amazon SNS.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Launch Stack

Clone repo

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

Deploy

npm installsam buildsam deploy --guided


Testing

Once the CloudFormation stack is deployed, fetch its outputs either in the AWS Management Console or by using AWS CLI:
aws cloudformation describe-stacks --stack-name STACK_NAME --query "Stacks[0].Outputs"

Cleanup

1. Delete the stack: sam delete --stack-name STACK_NAME.
2. Confirm the stack has been deleted: aws cloudformation list-stacks --query "StackSummaries[?contains(StackName,'STACK_NAME')].StackStatus"

Created by:

Giedrius Praspaliauskas

Giedrius Praspaliauskas

Giedrius is a senior solutions architect focusing on serverless at Amazon Web Services based in the US.

Follow on LinkedIn