SecretsManager 1.0.1
dotnet add package SecretsManager --version 1.0.1
NuGet\Install-Package SecretsManager -Version 1.0.1
<PackageReference Include="SecretsManager" Version="1.0.1" />
<PackageVersion Include="SecretsManager" Version="1.0.1" />
<PackageReference Include="SecretsManager" />
paket add SecretsManager --version 1.0.1
#r "nuget: SecretsManager, 1.0.1"
#:package SecretsManager@1.0.1
#addin nuget:?package=SecretsManager&version=1.0.1
#tool nuget:?package=SecretsManager&version=1.0.1
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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net6.0
- AWSSDK.SecretsManager (>= 4.0.0.20)
- Newtonsoft.Json (>= 13.0.3)
NuGet packages (3)
Showing the top 3 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. |
|
ConfiguredSqlConnection.Abstractions
Abstractions for configuring database connections using environment settings and secure connection strings. |
GitHub repositories
This package is not used by any popular GitHub repositories.