tiering: add aws role support for s3 (#12424)

Signed-off-by: Poorna Krishnamoorthy <poorna@minio.io>
This commit is contained in:
Poorna Krishnamoorthy
2021-06-04 12:47:00 -07:00
committed by GitHub
parent 36b2f6d11d
commit f199afcd6c
6 changed files with 33 additions and 11 deletions

View File

@@ -144,12 +144,16 @@ func (config *TierConfigMgr) Edit(ctx context.Context, tierName string, creds ma
newCfg := config.Tiers[tierName]
switch tierType {
case madmin.S3:
if creds.AccessKey == "" || creds.SecretKey == "" {
if (creds.AccessKey == "" || creds.SecretKey == "") && !creds.AWSRole {
return errTierInsufficientCreds
}
newCfg.S3.AccessKey = creds.AccessKey
newCfg.S3.SecretKey = creds.SecretKey
switch {
case creds.AWSRole:
newCfg.S3.AWSRole = true
default:
newCfg.S3.AccessKey = creds.AccessKey
newCfg.S3.SecretKey = creds.SecretKey
}
case madmin.Azure:
if creds.AccessKey == "" || creds.SecretKey == "" {
return errTierInsufficientCreds