SecretsManagerFacadeLib 1.0.0
See the version list below for details.
dotnet add package SecretsManagerFacadeLib --version 1.0.0
NuGet\Install-Package SecretsManagerFacadeLib -Version 1.0.0
<PackageReference Include="SecretsManagerFacadeLib" Version="1.0.0" />
paket add SecretsManagerFacadeLib --version 1.0.0
#r "nuget: SecretsManagerFacadeLib, 1.0.0"
// Install SecretsManagerFacadeLib as a Cake Addin
#addin nuget:?package=SecretsManagerFacadeLib&version=1.0.0
// Install SecretsManagerFacadeLib as a Cake Tool
#tool nuget:?package=SecretsManagerFacadeLib&version=1.0.0
SecretsManagerFacadeLib
Convenience lib that offers support to retrieve Aws Credentials and Aws Secrets Manager stored properties.
It uses client side caching (supported by official Aws cache lib) to prevent further http calls.
Usage
**1. Declare components in Startup.cs 😗*
services.AddSingleton<ISecretsManagerClient, SecretsManagerClient>();
services.AddSingleton<ISecretsManagerFacade, SecretsManagerFacade>();
services.AddSingleton<ICredentialsFacade<AwsCredentials>, AWSCredentialsFacade>();
**2. Inject the Facade client in your class 😗*
public SqsClient(ICredentialsFacade<AwsCredentials> credentialsFacade)
{
_credentialsFacade = credentialsFacade;
}
3. Retrieve the desired credentials
For AwsCredentials
var awsCredentials = _credentialsFacade.GetCredentials();
Of course: you have to store the credentials in Aws Secrets Manager using a Json format, for example:
{
"accountid": "YOUR-ACCOUNT-ID",
"accesskey": "YOUR-ACCESS-KEY",
"secretkey": "YOUR-SECRET-KEY",
"region": "YOUR-REGION-ID"
}
For string-based properties
var mySecretValue = _credentialsFacade.GetStringProperty("YOUR-SECRET-ID");
For object-based properties
var mySecretValue = _credentialsFacade.GetObjectProperty<YourObjectType>("YOUR-SECRET-ID");
Again, you have to store the object in Aws Secrets Manager using a Json format, for example:
{
"username": "YOUR-USERNAME",
"password": "YOUR-PASSWORD"
}
IMPORTANT
For Aws credentials, the section must be declared in appsettings.json like this:
"Aws": {
"SecretsManager": "YOUR-SECRET-ID"
}
It works parsing hardcoded values too, but is strongly suggested that you use Secrets Manager stored values:
"Aws": {
"AccountId": "YOUR-ACCOUNT-ID",
"AccessKey": "YOUR-ACCESS-KEY",
"SecretKey": "YOUR-SECRET-KEY",
"Region": "YOUR-REGION-ID"
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- AWSSDK.SecretsManager (>= 3.3.102.57)
- AWSSDK.SecretsManager.Caching (>= 1.0.3)
- Microsoft.Extensions.Configuration.Abstractions (>= 3.1.5)
- Microsoft.Extensions.Logging.Abstractions (>= 3.1.5)
- Newtonsoft.Json (>= 12.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.