samedi 28 février 2015

Can't create Amazon Web Services (AWS) credentials object

I'm trying to get started developing against the local Dynamo DB service. The first step is simply creating a client with their SDK:



var storedAWSCreds = new StoredProfileAWSCredentials();


This throws an exception:



App.config does not contain credentials information. Either add the AWSAccessKey and AWSSecretKey or AWSProfileName



My app.config has the needed properties:



<add key="AWSProfileName" value="justin"/>
<add key="AWSProfilesLocation" value="C:\code\dynamodb\credentials"/>


The credentials profile file:



justin
aws_access_key_id = REMOVED-FOR-POST
aws_secret_access_key = REMOVED-FOR-POST


At this point I thought I would try one of the other overloaded methods and explicitly tell the constructor what the parameters should be:



var storedAWSCreds = new StoredProfileAWSCredentials("justin", @"C:\code\dynamodb\credentials");


Again, the same exception.


Okay, the exception says I can provide the credentials directly in my config so I tried that:



<add key="AWSAccessKey" value="REMOVED"/>
<add key="AWSSecretKey" value="REMOVED"/>


Again, the same exception.


How can I get the StoredProfileAWSCredentials object created? I'm clearly missing something obvious or their exception messages are incorrect.


I will point out, I can create a BasicAWSCredentials object by specifying the access key and secret key in the constructor:



var basicAWSCreds = new BasicAWSCredentials("REMOVED-FOR-POST", "REMOVED-FOR-POST");


But, at some point I would prefer to not have it hard-coded in my application.





1 commentaire: