Skip to content

Commit 4e20faf

Browse files
arnitologbwplotka
authored andcommitted
s3: change AWS S3 authentication sequence (#732)
* auth sequence reordered. IAM instance profile moved to the end of the list * update storage.md with the new auth sequence.
1 parent 63c6895 commit 4e20faf

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/storage.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ For debug purposes you can set `insecure: true` to switch to plain insecure HTTP
6363
By default Thanos will try to retrieve credentials from the following sources:
6464

6565
1. From config file if BOTH `access_key` and `secret_key` are present.
66-
1. IAM credentials retrieved from an instance profile.
67-
1. From `~/.aws/credentials`
6866
1. From the standard AWS environment variable - `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`
67+
1. From `~/.aws/credentials`
68+
1. IAM credentials retrieved from an instance profile.
6969

7070
NOTE: Getting access key from config file and secret key from other method (and vice versa) is not supported.
7171

pkg/objstore/s3/s3.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,13 @@ func NewBucketWithConfig(logger log.Logger, config Config, component string) (*B
105105
}}
106106
} else {
107107
chain = []credentials.Provider{
108+
&credentials.EnvAWS{},
109+
&credentials.FileAWSCredentials{},
108110
&credentials.IAM{
109111
Client: &http.Client{
110112
Transport: http.DefaultTransport,
111113
},
112114
},
113-
&credentials.FileAWSCredentials{},
114-
&credentials.EnvAWS{},
115115
}
116116
}
117117

0 commit comments

Comments
 (0)