Skip to content

Instantly share code, notes, and snippets.

@daleki
Created October 6, 2016 23:36
Show Gist options
  • Save daleki/b1d176902bdce94de3a8e5abf900c682 to your computer and use it in GitHub Desktop.
Save daleki/b1d176902bdce94de3a8e5abf900c682 to your computer and use it in GitHub Desktop.
Check AWS Go SDK credentials
//Check if credentials have been found
//https://github.com/aws/aws-sdk-go/issues/579
_, err := session.Config.Credentials.Get()
if err != nil {
log.Fatalf("ERROR: Unable to load credentials. Check ~/.aws/credentials or IAM instance profile. \n%s\n", err.Error())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment