Skip to content

1.6.0

Compare
Choose a tag to compare
@github-actions github-actions released this 07 Sep 15:51
· 1118 commits to refs/heads/develop since this release
123eea7

Summary

With this release, we move Parameters utility from Developer Preview to General Availability 🎉🎉🎉!, we also released Tracing automatic register for services.

Parameters

This new utility provides high-level functionality to retrieve one or multiple parameter values from AWS Systems Manager Parameter Store, AWS Secrets Manager, or Amazon DynamoDB. We also provide extensibility to bring your own providers. Here is an example for SSM Parameter Store.

using AWS.Lambda.Powertools.Parameters;
using AWS.Lambda.Powertools.Parameters.SimpleSystemsManagement;

public class Function
{
    public async Task<APIGatewayProxyResponse> FunctionHandler
        (APIGatewayProxyRequest apigProxyEvent, ILambdaContext context)
    {
        // Get SSM Provider instance
        ISsmProvider ssmProvider = ParametersManager.SsmProvider;

        // Retrieve a single parameter
        string? value = await ssmProvider
            .GetAsync("/my/parameter")
            .ConfigureAwait(false);

        // Retrieve multiple parameters from a path prefix
        // This returns a Dictionary with the parameter name as key
        IDictionary<string, string?> values = await ssmProvider
            .GetMultipleAsync("/my/path/prefix")
            .ConfigureAwait(false);
    }
}

Instrumenting SDK clients and HTTP calls

using Amazon.DynamoDBv2;
using Amazon.DynamoDBv2.Model;
using AWS.Lambda.Powertools.Tracing;

public class Function
{
    private static IAmazonDynamoDB _dynamoDb;

    /// <summary>
    /// Function constructor
    /// </summary>
    public Function()
    {
        Tracing.RegisterForAllServices();
        
        _dynamoDb = new AmazonDynamoDBClient();
    }
}

To instrument clients for some services and not others, call Register instead of RegisterForAllServices. Replace the highlighted text with the name of the service's client interface.

public class Function
{
    private static IAmazonDynamoDB _dynamoDb;

    /// <summary>
    /// Function constructor
    /// </summary>
    public Function()
    {
        Tracing.Register<IAmazonDynamoDB>()
        
        _dynamoDb = new AmazonDynamoDBClient();
    }
}

Changes

🌟New features and non-breaking changes

  • feat: Automatic Register XRay for all services (#428) by @amirkaws

📜 Documentation updates

  • feat: Automatic Register XRay for all services (#428) by @amirkaws
  • chore: include mermaid in mkdocs config. Fix identation and line numbers idempotency (#400) by @hjgraca

🔧 Maintenance

  • chore: Update version release 1.6.0 (#430) by @amirkaws
  • chore: include mermaid in mkdocs config. Fix identation and line numbers idempotency (#400) by @hjgraca
  • chore: Update dependabot.yml (#391) by @hjgraca

This release was made possible by the following contributors:

@amirkaws and @hjgraca