SecretsManager

De Banane Atomic
Version datée du 10 juin 2024 à 15:59 par Nicolas (discussion | contributions) (Page créée avec « Category:AWS = Load the secrets into a dictionary = <kode lang='cs'> var secretsManagerConfig = new AmazonSecretsManagerConfig() { Profile = new Profile("MyProfile"), RegionEndpoint = RegionEndpoint.EUCentral1 }; var secretsManager = new AmazonSecretsManagerClient(secretsManagerConfig); var request = new GetSecretValueRequest { SecretId = "MySecretName" }; var response = await secretsManager.GetSecretValueAsync(request); var secret = JsonConver... »)
(diff) ← Version précédente | Voir la version actuelle (diff) | Version suivante → (diff)
Aller à la navigationAller à la recherche

Load the secrets into a dictionary

Cs.svg
var secretsManagerConfig = new AmazonSecretsManagerConfig()
{
    Profile = new Profile("MyProfile"),
    RegionEndpoint = RegionEndpoint.EUCentral1
};
var secretsManager = new AmazonSecretsManagerClient(secretsManagerConfig);

var request = new GetSecretValueRequest
{
    SecretId = "MySecretName"
};

var response = await secretsManager.GetSecretValueAsync(request);

var secret = JsonConvert.DeserializeObject<Dictionary<string, string>>(response.SecretString);

return secret;