Loading AWS Secrets Manager secrets from Parameter Store parameters. #178
-
Hello, Its mentioned in the Read me file that its posssible to load AWS Secrets Manager secrets from Parameter Store parameters and below is the code snippet given. Deos this work only if the secret is in key-value pairs format ?Does it work if the secret is a PlainText? Also, it says that the Key/Value pairs could be retrieved from the ConfigurationManager object. Can someone tell me how I can retrieve the secret value that has been read? builder.Services.Configure<Settings>(builder.Configuration.GetSection($"common:settings"));
public class Program
{
public static void Main(string[] args)
{
CreateWebHostBuilder(args).Build().Run();
}
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.ConfigureAppConfiguration(builder =>
{
builder.AddSystemsManager("/aws/reference/secretsmanager/SomeSecret");
})
.UseStartup<Startup>();
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@ManasaBusi Good morning. Could you try changing your code to Thanks, |
Beta Was this translation helpful? Give feedback.
@ManasaBusi Good morning. Could you try changing your code to
builder.AddSystemsManager("/aws/reference/secretsmanager/")
and then try readingSomeSecret
from the configuration. This library requires to specify the parameter prefix and then loads the parameters under that prefix.Thanks,
Ashish