AWS Lambda to Amazon CloudWatch

AWS Lambda → CloudWatch

Create a Lambda function that publishes custom metrics to CloudWatch

This SAM template deploys a Lambda function that inserts custom metric data into AWS CloudWatch. The AWS SAM template deploys the resources and the IAM permissions required to run the application.

< 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/lambda-cloudwatch

Deploy

sam deploy --guided


Testing

See the GitHub repo for detailed testing instructions.

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:

Rohan Mehta

Rohan Mehta

Associate Cloud Application Architect at AWS.