aws / aws-secretsmanager-caching-net

The AWS Secrets Manager .NET caching client enables in-process caching of secrets for .NET applications.
https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieving-secrets_cache-net.html
Apache License 2.0
57 stars 23 forks source link

AWS Secrets Manager Caching Client for .NET

NuGet .NET codecov

The AWS Secrets Manager caching client enables in-process caching of secrets for .NET applications.

Required Prerequisites

To use this client, you must have:

Download

You can get the latest release from Nuget:

<ItemGroup>
     <PackageReference Include="AWSSDK.SecretsManager.Caching" Version="1.0.6" />
</ItemGroup>

Getting Started

The following code sample demonstrates how to start using the caching client:

using System;
using Amazon.SecretsManager.Extensions.Caching.SecretsManagerCache;

namespace LambdaExample {
    public class CachingExample 
    {
        private SecretsManagerCache cache = new SecretsManagerCache();
        private const String MySecretName = "MySecret";

        public async Task<Response> FunctionHandlerAsync(String input, ILambdaContext context)
        {
            String MySecret = await cache.GetSecretString(MySecretName);
            ...
        }
    }
}

Cache Configuration

You can configure the SecretCacheConfiguration object with the following parameters:

Getting Help

We use GitHub issues for tracking bugs and caching library feature requests and have limited bandwidth to address them. Please use these community resources for getting help:

License

This library is licensed under the Apache 2.0 License.