I am working on a .NET Core application for AWS. After reading this post, I added a file named credentials
(without extension) in the folder: C:\Users\Daan\
. In this text file, the access key and the secret access key are both there.
Unfortunately, the Credentials
property is not set after running my code. Other properties, such as Region
and Profile
, are set correctly based on my appsettings
file.
What becomes clear is that my program modifies the credentials file by adding this to the credentials file:
toolkit_artifact_guid=[A GUID]
Can someone explain to me what this means, and how I fix it? By fixing, I mean that my credentials file is not modified but just read to set the Credentials
property of my awsOptions
variable.
It is important to know that I created this file myself (not with the CLI), I double checked that the credentials are correct, and that this is my code. Moreover, I do have .NET experience, but I just started working with AWS.
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();
var awsOptions = Configuration.GetAWSOptions();
services.AddDefaultAWSOptions(awsOptions);
services.AddAWSService<Amazon.S3.IAmazonS3>();
}