Skip to content

AWS Lambda Powertools for .NET

AWS Lambda Powertools for .NET (which from here will be referred as Powertools) is a suite of utilities for AWS Lambda functions to ease adopting best practices such as tracing, structured logging, custom metrics, and more. Please note, Powertools is optimized for .NET 6 only.

The GitHub repository for this project can be found here.

Do not use this library in production

AWS Lambda Powertools for .NET is currently released in preview and is intended strictly for feedback purposes only. This version is not stable, and significant breaking changes might incur as part of the upcoming production-ready release.

Your support is much appreciated. If you encounter any problems, please raise an issue.

Do not use this library for production workloads.

Available Powertools libraries

Utility Description
Tracing Decorators and utilities to trace Lambda function handlers, and both synchronous and asynchronous functions
Logger Structured logging made easier, and decorator to enrich structured logging with key Lambda context details
Metrics Custom AWS metrics created asynchronously via CloudWatch Embedded Metric Format (EMF)

Install

Powertools are available as NuGet packages. You can install the packages from NuGet gallery or from Visual Studio editor. Search AWS.Lambda.Powertools* to see various utilities available.

SAM CLI custom template

We have provided you with a custom template for the Serverless Application Model (AWS SAM) command-line interface (CLI). This generates a starter project that allows you to interactively choose the Powertools features that enables you to include in your project.

1
sam init --location https://github.com/aws-samples/cookiecutter-aws-sam-dotnet

To use the SAM CLI, you need the following tools.

Examples

We have provided a few examples that should you how to use the each of the core Powertools features.

Other members of the AWS Lambda Powertools family

Not using .NET? No problem we have you covered. Here are the other members of the AWS Lambda Powertools family:

Connect

Credits


Last update: 2022-08-03