Skip to content

Commit

Permalink
fix: aws s3 support instance role (#21)
Browse files Browse the repository at this point in the history
Co-authored-by: pengyu.liu <pengyu.liu@ewp-group.com>
  • Loading branch information
xiaoheiwowo and pengyu.liu authored Dec 20, 2024
1 parent d09c25c commit 91c9715
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cloud/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,11 @@ func (option AWSOption) Check() error {
}
validKeyConfig := option.SecretID != "" && option.SecretKey != ""
validAssumeRoleConfig := option.AssumeRoleArn != "" && option.AssumeRegion != ""
if !validKeyConfig && !validAssumeRoleConfig {
return errors.New("must have valid key pairs config or assume role config")
validInstanceRoleConfig := option.AssumeRoleArn == "" && option.AssumeRegion == "" && option.SecretID == "" && option.SecretKey == ""
if validKeyConfig || validAssumeRoleConfig || validInstanceRoleConfig {
return nil
}
return nil
return errors.New("must have valid key pairs config or assume role config")
}

type CommonOption struct {
Expand Down

0 comments on commit 91c9715

Please sign in to comment.