From 6dd8a83c5a2e86dd59757fc123fdba5652ba3503 Mon Sep 17 00:00:00 2001 From: Alex Simenduev Date: Thu, 17 Jan 2019 20:31:51 +0200 Subject: [PATCH] change credential chain order in s3 gateway to mimic official docs (#7091) --- cmd/gateway/s3/gateway-s3.go | 4 ++-- docs/gateway/s3.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/gateway/s3/gateway-s3.go b/cmd/gateway/s3/gateway-s3.go index d186bb39b..f706d34ca 100644 --- a/cmd/gateway/s3/gateway-s3.go +++ b/cmd/gateway/s3/gateway-s3.go @@ -182,19 +182,19 @@ func newS3(url string) (*miniogo.Core, error) { // Chains all credential types, in the following order: // - AWS env vars (i.e. AWS_ACCESS_KEY_ID) + // - AWS creds file (i.e. AWS_SHARED_CREDENTIALS_FILE or ~/.aws/credentials) // - IAM profile based credentials. (performs an HTTP // call to a pre-defined endpoint, only valid inside // configured ec2 instances) - // - AWS creds file (i.e. AWS_SHARED_CREDENTIALS_FILE or ~/.aws/credentials) // - Static credentials provided by user (i.e. MINIO_ACCESS_KEY) creds := credentials.NewChainCredentials([]credentials.Provider{ &credentials.EnvAWS{}, + &credentials.FileAWSCredentials{}, &credentials.IAM{ Client: &http.Client{ Transport: minio.NewCustomHTTPTransport(), }, }, - &credentials.FileAWSCredentials{}, &credentials.EnvMinio{}, }) diff --git a/docs/gateway/s3.md b/docs/gateway/s3.md index 0931c7c0d..b739097c3 100644 --- a/docs/gateway/s3.md +++ b/docs/gateway/s3.md @@ -31,8 +31,8 @@ minio gateway s3 Minio gateway will automatically look for list of credential styles in following order. - AWS env vars (i.e. AWS_ACCESS_KEY_ID) -- IAM profile based credentials. (performs an HTTP call to a pre-defined endpoint, only valid inside configured ec2 instances) - AWS creds file (i.e. AWS_SHARED_CREDENTIALS_FILE or ~/.aws/credentials) +- IAM profile based credentials. (performs an HTTP call to a pre-defined endpoint, only valid inside configured ec2 instances) ## Run Minio Gateway for AWS S3 compatible services As a prerequisite to run Minio S3 gateway on an AWS S3 compatible service, you need valid access key, secret key and service endpoint.