File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -105,8 +105,13 @@ All metrics have the label `name` equals to the config `name` key.
105105
106106### AWS
107107
108- - ` AWS_ACCESS_KEY_ID ` : AWS secret key ID
109- - ` AWS_SECRET_ACCESS_KEY ` : AWS secret access key
108+ - ` AWS_ACCESS_KEY_ID ` : AWS access key ID (optional)
109+ - ` AWS_SECRET_ACCESS_KEY ` : AWS secret access key (optional)
110+
111+ When running in Kubernetes with a service account that has the appropriate
112+ bucket permissions (for example IAM Roles for Service Accounts), the
113+ application automatically uses the service account credentials and these
114+ variables are not required.
110115
111116### Minio
112117
Original file line number Diff line number Diff line change @@ -27,14 +27,17 @@ type S3File struct {
2727}
2828
2929func NewS3Bucket (s3 * config.S3 ) * S3Bucket {
30- s3Session := session .Must (session .NewSession (& aws.Config {
31- Region : aws .String (s3 .Region ),
32- }))
33-
34- return & S3Bucket {
35- Session : s3Session ,
36- S3 : s3 ,
37- }
30+ s3Session := session .Must (session .NewSessionWithOptions (session.Options {
31+ Config : aws.Config {
32+ Region : aws .String (s3 .Region ),
33+ },
34+ SharedConfigState : session .SharedConfigEnable ,
35+ }))
36+
37+ return & S3Bucket {
38+ Session : s3Session ,
39+ S3 : s3 ,
40+ }
3841}
3942
4043func (bucket * S3Bucket ) Upload (filename string , destFolder string ) error {
You can’t perform that action at this time.
0 commit comments