I created a new I-AM user set that user permission to full access for S3 then I see the environment variable for the MacBook with the correct Key and Key-ID . I then followed the amazon docs http://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/common-examples.html#s3 to list all of my buckets and I received the error Failed to list buckets EnvAccessKeyNotFound: AWS_ACCESS_KEY_ID or AWS_ACCESS_KEY not found in environment
I do not know why it is not recognizing my code which is this
func UploadProfile() {
svc := s3.New(session.New(&aws.Config{Region: aws.String("us-west-2"),Credentials:credentials.NewEnvCredentials()}))
result, err := svc.ListBuckets(&s3.ListBucketsInput{})
if err != nil {
log.Println("Failed to list buckets", err)
return
}
log.Println("Buckets:")
for _, bucket := range result.Buckets {
log.Printf("%s : %s
", aws.StringValue(bucket.Name), bucket.CreationDate)
}
}
I had one of the variables before as AWS_SECRET_ACCESS_KEY but removed the secret portion because it still gave me the same error. Any suggestions on how to fix this