SecretsManager 1.0.0
dotnet add package SecretsManager --version 1.0.0
NuGet\Install-Package SecretsManager -Version 1.0.0
<PackageReference Include="SecretsManager" Version="1.0.0" />
paket add SecretsManager --version 1.0.0
#r "nuget: SecretsManager, 1.0.0"
// Install SecretsManager as a Cake Addin #addin nuget:?package=SecretsManager&version=1.0.0 // Install SecretsManager as a Cake Tool #tool nuget:?package=SecretsManager&version=1.0.0
SecretsManager
How to use
// Create an instance of the AWS Secrets Manager client
var client = SecretManager.CreateClient();
// Create an instance of the SecretManager class
var secretManager = new SecretManager(client);
// Retrieve the value of a secret
var secretValue = secretManager.GetSecretValue("mySecretId", "mySecretKey");
SecretManager
class
This class provides a way to manage secrets using AWS Secrets Manager.
Properties
client
(IAmazonSecretsManager): The AWS Secrets Manager client used for managing secrets.
Constructors
SecretManager()
: Initializes a new instance of theSecretManager
class using the default AWS Secrets Manager client.SecretManager(IAmazonSecretsManager client)
: Initializes a new instance of theSecretManager
class using the specified AWS Secrets Manager client.
Methods
GetSecretValue(string secretId, string secretKey)
Retrieves the value of a secret identified by secretId
and returns the value associated with secretKey
.
secretId
(string): The ID or name of the secret.secretKey
(string): The key used to retrieve the secret value.
Returns:
- The secret value associated with
secretKey
.
Exceptions:
KeyNotFoundException
: Thrown when the specified secret key does not exist.
CreateClient()
Creates an instance of the AWS Secrets Manager client using the region specified in the AWS_REGION
environment variable or the default region (RegionEndpoint.USEast1
).
Returns:
- An instance of
IAmazonSecretsManager
representing the AWS Secrets Manager client.
RegionProvider
class
This class provides methods for retrieving the AWS region endpoint.
Properties
DefaultRegion
(RegionEndpoint): The default AWS region endpoint.
Methods
GetRegionEndpoint()
Retrieves the AWS region endpoint based on the AWS_REGION
environment variable or returns the default region if the environment variable is not set.
Returns:
- The AWS region endpoint.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. 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. |
-
net6.0
- AWSSDK.SecretsManager (>= 3.7.102.39)
- Newtonsoft.Json (>= 13.0.3)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on SecretsManager:
Package | Downloads |
---|---|
ConfiguredSqlConnection
The NuGet package is a collection of utilities for working with SQL Server database connections using environment settings and secure connection strings. |
|
EthSmartContractIO.SecretsProvider
A EthSmartContractIO module, that facilitates the secure creation of an Ethereum account and the extraction of secrets. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 6,113 | 5/17/2023 |