Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error when using AWS-SDK-GO (NoCredentialProviders: no valid providers in chain)

I've recently started using the aws-sdk-go package.
Walking through the instructions, my folder structure is as follows:

  • bin/ , pkg/ (as always)
  • src/
    • app/main.go (code taken from the docs)
    • github.com/aws

Now when I run go install, and then execute the app.exe (using windows here),
I'm getting the following error:

panic: NoCredentialProviders: no valid providers in chain

Any ideas?

like image 722
Asaf Avatar asked Jun 13 '15 20:06

Asaf


2 Answers

You need to provide an AWS access key and secret key to authenticate and use AWS services.

See the README here https://github.com/aws/aws-sdk-go#configuring-credentials

like image 136
djhworld Avatar answered Sep 21 '22 07:09

djhworld


If anyone runs into the same issue I had with this:

I read a doc that said to put the file at %USERPROFILE%.awscredentials on a Windows, but they just forgot the slash. It should be %USERPROFILE%.aws/credentials.

like image 39
Chris Gregory Avatar answered Sep 18 '22 07:09

Chris Gregory