aboutsummaryrefslogtreecommitdiff
path: root/weed/remote_storage/s3/aliyun.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/remote_storage/s3/aliyun.go')
-rw-r--r--weed/remote_storage/s3/aliyun.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/weed/remote_storage/s3/aliyun.go b/weed/remote_storage/s3/aliyun.go
index 37e1e1fb4..6cfc0130f 100644
--- a/weed/remote_storage/s3/aliyun.go
+++ b/weed/remote_storage/s3/aliyun.go
@@ -27,15 +27,16 @@ func (s AliyunRemoteStorageMaker) Make(conf *filer_pb.RemoteConf) (remote_storag
config := &aws.Config{
Endpoint: aws.String(conf.AliyunEndpoint),
+ Region: aws.String(conf.AliyunRegion),
S3ForcePathStyle: aws.Bool(false),
}
- if conf.AliyunAccessKey != "" && conf.AliyunSecretKey != "" {
+ if accessKey != "" && secretKey != "" {
config.Credentials = credentials.NewStaticCredentials(accessKey, secretKey, "")
}
sess, err := session.NewSession(config)
if err != nil {
- return nil, fmt.Errorf("create aws session: %v", err)
+ return nil, fmt.Errorf("create aliyun session: %v", err)
}
client.conn = s3.New(sess)
return client, nil