How to download from AWS S3 using golang
There are several ways to set credentials. For more details aws/credentials.
For example, you can specify it by setting environment variables:
AWS_ACCESS_KEY = <your_access_key>
AWS_SECRET_KEY = <your_secret_key>
Then just use credentials.NewEnvCredentials()
in your config instance:
sess, _ := session.NewSession(&aws.Config{
Region: aws.String("us-east-1"),
Credentials: credentials.NewEnvCredentials(),
})