I am having trouble getting the AWS Setup Extension to process environment variables.
Following instructions on the AWS Docs + Unofficial Docs.
In my StartUp file, I add the following config and services.
services.AddDefaultAWSOptions(root.GetAWSOptions());
services.AddAWSService<IAmazonDynamoDB>();
My configuration includes a JSON file with AWS settings and also environmental variables.
public static IConfigurationRoot Configuration => new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
.AddEnvironmentVariables()
.Build();
According to the following diagram and the Unofficial Docs. AWS Setup should attempt to configure credentials from environmental variables failing higher priority options.
However, I have found it is able to import an AWS profile but not the environmental variables.
I've been investigating in the following repo under the console app if anyone cared to reproduce. https://github.com/aws/aws-sdk-net/issues/1717
I have resorted to the following workaround. It's fine but it would be good to know if the documentation is incorrect for .NET Core or if I@m doing something wrong.