Skip to content

1.9.0

Compare
Choose a tag to compare
@github-actions github-actions released this 11 Mar 09:50
· 233 commits to refs/heads/develop since this release
9288404

Summary

With this release, we add feature to existing Parameters to retrieve values from AWS AppConfig.

using AWS.Lambda.Powertools.Parameters;
using AWS.Lambda.Powertools.Parameters.AppConfig;

public class Function
{
    public async Task<APIGatewayProxyResponse> FunctionHandler
        (APIGatewayProxyRequest apigProxyEvent, ILambdaContext context)
    {
        // Get AppConfig Provider instance
        IAppConfigProvider appConfigProvider = ParametersManager.AppConfigProvider
            .DefaultApplication("MyApplicationId")
            .DefaultEnvironment("MyEnvironmentId")
            .DefaultConfigProfile("MyConfigProfileId");
        
        // Retrieve a single configuration, latest version
        IDictionary<string, string?> value = await appConfigProvider
            .GetAsync()
            .ConfigureAwait(false);

        //Working with feature flags
        
        // Check if feature flag is enabled
        var isFeatureFlagEnabled = await appConfigProvider
            .IsFeatureFlagEnabledAsync("MyFeatureFlag")
            .ConfigureAwait(false);
        
        if (isFeatureFlagEnabled)
        {
            // Retrieve an attribute value of the feature flag
            var strAttValue = await appConfigProvider
                .GetFeatureFlagAttributeValueAsync<string>("MyFeatureFlag", "StringAttribute")
                .ConfigureAwait(false);
            
            // Retrieve another attribute value of the feature flag
            var numberAttValue = await appConfigProvider
                .GetFeatureFlagAttributeValueAsync<int>("MyFeatureFlag", "NumberAttribute")
                .ConfigureAwait(false);
        }
    }
}

Changes

🌟New features and non-breaking changes

AWS.Lambda.Powertools.Logging - 1.5.1
AWS.Lambda.Powertools.Metrics - 1.6.1
AWS.Lambda.Powertools.Tracing - 1.4.1
AWS.Lambda.Powertools.Parameters - 1.3.0
AWS.Lambda.Powertools.Idempotency - 1.1.1
AWS.Lambda.Powertools.BatchProcessing - 1.1.1

📜 Documentation updates

🔧 Maintenance

This release was made possible by the following contributors:

@amirkaws and @hjgraca