We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d09c25c commit 91c9715Copy full SHA for 91c9715
1 file changed
cloud/common.go
@@ -84,10 +84,11 @@ func (option AWSOption) Check() error {
84
}
85
validKeyConfig := option.SecretID != "" && option.SecretKey != ""
86
validAssumeRoleConfig := option.AssumeRoleArn != "" && option.AssumeRegion != ""
87
- if !validKeyConfig && !validAssumeRoleConfig {
88
- 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 {
89
+ return nil
90
- return nil
91
+ return errors.New("must have valid key pairs config or assume role config")
92
93
94
type CommonOption struct {
0 commit comments