Add option to set the S3 region to support other regions as eu-west-1

This commit is contained in:
Alexander Lauster
2019-06-23 13:04:37 +02:00
parent 818e5bc444
commit 47d4907a06
3 changed files with 11 additions and 5 deletions

View File

@ -37,9 +37,9 @@ import (
"github.com/golang/gddo/httputil/header"
)
func getAwsSession(accessKey, secretKey, endpoint string) *session.Session {
func getAwsSession(accessKey, secretKey, endpoint string, region string) *session.Session {
return session.Must(session.NewSession(&aws.Config{
Region: aws.String("eu-west-1"),
Region: aws.String(region),
Endpoint: aws.String(endpoint),
Credentials: credentials.NewStaticCredentials(accessKey, secretKey, ""),
}))